peekin 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- peekin-0.1.0/.github/workflows/ci.yml +14 -0
- peekin-0.1.0/.github/workflows/publish.yml +18 -0
- peekin-0.1.0/.gitignore +6 -0
- peekin-0.1.0/LICENSE +21 -0
- peekin-0.1.0/PKG-INFO +90 -0
- peekin-0.1.0/README.md +70 -0
- peekin-0.1.0/docs/superpowers/plans/2026-09-25-peekin.md +2012 -0
- peekin-0.1.0/docs/superpowers/specs/2026-09-25-peekin-design.md +237 -0
- peekin-0.1.0/pyproject.toml +39 -0
- peekin-0.1.0/src/peekin/__init__.py +3 -0
- peekin-0.1.0/src/peekin/__main__.py +3 -0
- peekin-0.1.0/src/peekin/app.py +187 -0
- peekin-0.1.0/src/peekin/auth.py +88 -0
- peekin-0.1.0/src/peekin/cli.py +121 -0
- peekin-0.1.0/src/peekin/fs.py +99 -0
- peekin-0.1.0/src/peekin/preview.py +29 -0
- peekin-0.1.0/src/peekin/static/app.css +76 -0
- peekin-0.1.0/src/peekin/static/app.js +259 -0
- peekin-0.1.0/src/peekin/static/code.css +164 -0
- peekin-0.1.0/src/peekin/static/index.html +41 -0
- peekin-0.1.0/src/peekin/thumbs.py +40 -0
- peekin-0.1.0/tests/conftest.py +33 -0
- peekin-0.1.0/tests/test_app.py +147 -0
- peekin-0.1.0/tests/test_auth.py +71 -0
- peekin-0.1.0/tests/test_cli.py +119 -0
- peekin-0.1.0/tests/test_fs.py +72 -0
- peekin-0.1.0/tests/test_preview.py +42 -0
- peekin-0.1.0/tests/test_thumbs.py +56 -0
- peekin-0.1.0/uv.lock +392 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
pull_request:
|
|
5
|
+
jobs:
|
|
6
|
+
test:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
strategy:
|
|
9
|
+
matrix:
|
|
10
|
+
python: ["3.10", "3.13"]
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v7
|
|
13
|
+
- uses: astral-sh/setup-uv@v10.2.0
|
|
14
|
+
- run: uv run --python ${{ matrix.python }} pytest -q
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: publish
|
|
2
|
+
on:
|
|
3
|
+
release:
|
|
4
|
+
types: [published]
|
|
5
|
+
jobs:
|
|
6
|
+
pypi:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
environment: pypi
|
|
9
|
+
permissions:
|
|
10
|
+
id-token: write # PyPI trusted publishing: no API token stored anywhere
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v7
|
|
13
|
+
- uses: astral-sh/setup-uv@v10.2.0
|
|
14
|
+
- name: Check the release tag matches the package version
|
|
15
|
+
run: test "${GITHUB_REF_NAME#v}" = "$(uv run python -c 'import peekin; print(peekin.__version__)')"
|
|
16
|
+
- run: uv run pytest -q
|
|
17
|
+
- run: uv build
|
|
18
|
+
- run: uv publish
|
peekin-0.1.0/.gitignore
ADDED
peekin-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Suman Michael
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
peekin-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: peekin
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Lightweight read-only file browser and previewer in your web browser
|
|
5
|
+
Project-URL: Homepage, https://github.com/sumanmichael/peekin
|
|
6
|
+
Author: Suman Michael
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: file browser,file viewer,gallery,pdf,syntax highlighting
|
|
10
|
+
Classifier: Environment :: Web Environment
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Topic :: Desktop Environment :: File Managers
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Requires-Dist: pygments>=2.17
|
|
15
|
+
Requires-Dist: starlette>=0.40
|
|
16
|
+
Requires-Dist: uvicorn>=0.30
|
|
17
|
+
Provides-Extra: thumbs
|
|
18
|
+
Requires-Dist: pillow>=10; extra == 'thumbs'
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# peekin
|
|
22
|
+
|
|
23
|
+
A lightweight, read-only file browser for your web browser. Browse a folder and
|
|
24
|
+
preview images (swipeable gallery), video, audio, PDF, and source code with
|
|
25
|
+
syntax highlighting. Works on desktop and phone. Fully offline.
|
|
26
|
+
|
|
27
|
+
## Run
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
uvx peekin # share the current folder on http://127.0.0.1:8000
|
|
31
|
+
uvx peekin ~/Pictures --open # share a folder and open the browser
|
|
32
|
+
python -m peekin # after: pip install peekin
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Until the first PyPI release:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
uvx --from git+https://github.com/sumanmichael/peekin peekin
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Share on your network
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
uvx peekin --host 0.0.0.0
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
peekin needs a password whenever it listens on something other than
|
|
48
|
+
localhost. If you don't set one, it generates one and prints it at startup.
|
|
49
|
+
Set your own with `PEEKIN_PASSWORD=...` or `--password-file FILE`.
|
|
50
|
+
`--no-password` turns the password off (not recommended on shared networks).
|
|
51
|
+
|
|
52
|
+
## Options
|
|
53
|
+
|
|
54
|
+
| Option | Default | Meaning |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| `FOLDER` | `.` | Folder to share |
|
|
57
|
+
| `--host` | `127.0.0.1` | Address to listen on (`0.0.0.0` for your network) |
|
|
58
|
+
| `--port` | `8000` | Port |
|
|
59
|
+
| `--password-file` | | Read the password from this file's first line |
|
|
60
|
+
| `--no-password` | off | Never ask for a password |
|
|
61
|
+
| `--thumbs` | off | Image thumbnails in grid view (install with `uvx --from 'peekin[thumbs]' peekin --thumbs`) |
|
|
62
|
+
| `--show-hidden` | off | Show dotfiles |
|
|
63
|
+
| `--open` | off | Open the browser |
|
|
64
|
+
|
|
65
|
+
## Security
|
|
66
|
+
|
|
67
|
+
- Read-only: nothing in the shared folder can be changed through peekin.
|
|
68
|
+
- Paths cannot escape the shared folder, including through symlinks.
|
|
69
|
+
- Five wrong passwords lock that IP address out for 60 seconds, doubling each time.
|
|
70
|
+
- HTML and SVG files are downloaded, never rendered, so files you share can't run scripts in peekin.
|
|
71
|
+
- Other websites you visit can't read your files through peekin: cross-site requests are blocked, and
|
|
72
|
+
without a password peekin only answers to IP addresses, `localhost`, and `*.local` names.
|
|
73
|
+
- No HTTPS: use it on networks you trust, not on the public internet.
|
|
74
|
+
|
|
75
|
+
## Develop
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
uv run pytest
|
|
79
|
+
uv run peekin .
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Release
|
|
83
|
+
|
|
84
|
+
1. Bump `__version__` in `src/peekin/__init__.py` and commit.
|
|
85
|
+
2. `gh release create vX.Y.Z --generate-notes` (the tag must match the version).
|
|
86
|
+
3. The `publish` workflow tests, builds, and uploads to PyPI via trusted publishing.
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT
|
peekin-0.1.0/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# peekin
|
|
2
|
+
|
|
3
|
+
A lightweight, read-only file browser for your web browser. Browse a folder and
|
|
4
|
+
preview images (swipeable gallery), video, audio, PDF, and source code with
|
|
5
|
+
syntax highlighting. Works on desktop and phone. Fully offline.
|
|
6
|
+
|
|
7
|
+
## Run
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
uvx peekin # share the current folder on http://127.0.0.1:8000
|
|
11
|
+
uvx peekin ~/Pictures --open # share a folder and open the browser
|
|
12
|
+
python -m peekin # after: pip install peekin
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Until the first PyPI release:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
uvx --from git+https://github.com/sumanmichael/peekin peekin
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Share on your network
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
uvx peekin --host 0.0.0.0
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
peekin needs a password whenever it listens on something other than
|
|
28
|
+
localhost. If you don't set one, it generates one and prints it at startup.
|
|
29
|
+
Set your own with `PEEKIN_PASSWORD=...` or `--password-file FILE`.
|
|
30
|
+
`--no-password` turns the password off (not recommended on shared networks).
|
|
31
|
+
|
|
32
|
+
## Options
|
|
33
|
+
|
|
34
|
+
| Option | Default | Meaning |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| `FOLDER` | `.` | Folder to share |
|
|
37
|
+
| `--host` | `127.0.0.1` | Address to listen on (`0.0.0.0` for your network) |
|
|
38
|
+
| `--port` | `8000` | Port |
|
|
39
|
+
| `--password-file` | | Read the password from this file's first line |
|
|
40
|
+
| `--no-password` | off | Never ask for a password |
|
|
41
|
+
| `--thumbs` | off | Image thumbnails in grid view (install with `uvx --from 'peekin[thumbs]' peekin --thumbs`) |
|
|
42
|
+
| `--show-hidden` | off | Show dotfiles |
|
|
43
|
+
| `--open` | off | Open the browser |
|
|
44
|
+
|
|
45
|
+
## Security
|
|
46
|
+
|
|
47
|
+
- Read-only: nothing in the shared folder can be changed through peekin.
|
|
48
|
+
- Paths cannot escape the shared folder, including through symlinks.
|
|
49
|
+
- Five wrong passwords lock that IP address out for 60 seconds, doubling each time.
|
|
50
|
+
- HTML and SVG files are downloaded, never rendered, so files you share can't run scripts in peekin.
|
|
51
|
+
- Other websites you visit can't read your files through peekin: cross-site requests are blocked, and
|
|
52
|
+
without a password peekin only answers to IP addresses, `localhost`, and `*.local` names.
|
|
53
|
+
- No HTTPS: use it on networks you trust, not on the public internet.
|
|
54
|
+
|
|
55
|
+
## Develop
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uv run pytest
|
|
59
|
+
uv run peekin .
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Release
|
|
63
|
+
|
|
64
|
+
1. Bump `__version__` in `src/peekin/__init__.py` and commit.
|
|
65
|
+
2. `gh release create vX.Y.Z --generate-notes` (the tag must match the version).
|
|
66
|
+
3. The `publish` workflow tests, builds, and uploads to PyPI via trusted publishing.
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT
|