podpack-notes
A small notes app for podpack sites, and the worked example of what an app is.
It is deliberately not a stub: it has a model, a template, shipped data, per-app configuration and a nav entry, which between them exercise every part of the registry a real app would use.
Installing it into a site
Add the distribution as a dependency, then the import name to the site's app list:
# the site's pyproject.toml -- both, because an app does not pull in its framework
dependencies = ["podpack", "podpack-notes"]
[tool.uv.sources]
podpack = { git = "https://github.com/holdenweb/podpack.git" }
podpack-notes = { git = "https://github.com/holdenweb/podpack-notes.git" }
# the site's config/app.toml
[site]
apps = ["podpack_notes"]
[apps.notes] # keyed by the app's name, not its import name
page_size = 20
Three spellings of one thing, and they are not interchangeable:
podpack-notes |
the distribution — what you depend on |
podpack_notes |
the import name — what goes in apps |
notes |
the app's own name, from its blueprint — what keys [apps.notes], [site.mounts], and its directories on disk |
A site that wants it somewhere other than /notes says so in [site.mounts];
the app is not consulted and its nav entry follows anyway, because a Section
names an endpoint rather than a path.
What it gives the site
A note belongs to the user who wrote it, and a user sees only their own.
GET /notes/ |
the caller's notes, in the site's own chrome |
GET /notes/list |
the same as JSON |
POST /notes/ |
{"text": "..."} → stores a row owned by the caller |
POST /notes/uploads/<name> |
writes a file to the app's own data directory |
The first three need a signed-in user — a browser session, or an
Authentication-Token header carrying the token flask-security returns from a
JSON POST to /login?include_auth_token (it withholds it without that
parameter). flask-security answers an unauthenticated page request with a
redirect to /login and an unauthenticated API call with a 401, and podpack
installs it on every site, so a site has a login already. The upload
route is unguarded: those files land in the app's one shared data directory and
have never been anybody's in particular.
Notes are owned through podpack's own user table, which this app declares in
needs_tables rather than defining. A site that installs it therefore needs at
least one user before anybody can write anything:
flask --app <site> users create you@example.com --active
It ships a welcome.md, which podpack seeds into the app's host data directory
the first time it is installed and never again. The app then reads the host
copy, so editing it takes effect with no rebuild — which is the point of the
convention rather than a detail of this app.
Upgrading a site to a version that owns its notes
This app ships no migrations, and cannot. There is one alembic history per site (podpack ADR-0009), so a site generates this app's schema into its own history and nothing will remind it to. Adding the owner column is a change a site has to make deliberately:
uv run alembic revision --autogenerate -m "notes: notes belong to a user"
Run that with the site's full app list enabled — with an app disabled,
alembic faithfully proposes dropping its tables — and read the revision before
applying it. owner_id is NOT NULL, so the generated upgrade() needs a line
adding before it:
op.execute("DELETE FROM notes") # no note predates ownership
That discards every existing note, which is the assumption this release was
written under. A site with notes worth keeping should instead add the column
nullable, backfill an owner into every row, and only then tighten it — a direct
NOT NULL add fails on a table with rows in it.
Developing it
uv sync --all-groups
uv run pytest
uv run mypy
The tests build a real podpack site with this app installed, so what they prove is that the app conforms to the contract, not merely that its own functions work.
pyproject.toml points podpack at a sibling checkout, which is right for
local work and cannot survive a container build — a path source fails there with
Distribution not found. A site deploying this needs both packages from git.
Metadata
Release files for podpack-notes 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| podpack_notes-0.1.3.tar.gz | 8.0 kB | Without provenance | Details for podpack_notes-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| podpack_notes-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for podpack_notes-0.1.3-py3-none-any.whl |
Total release size: 18.0 kB
Release files / podpack_notes-0.1.3.tar.gz
| Download URL | podpack_notes-0.1.3.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b39fdaf1afa2813bf57e84ce72e4e180474d7f43f6bae47d3f972a92aaacd73b
|
|
BLAKE2b-256 checksum How to use checksums |
82b5b70ff3fa1cccc60f6f75ff5715ec7ca99da420c38de15fe86af1fb51aa3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / podpack_notes-0.1.3-py3-none-any.whl
| Download URL | podpack_notes-0.1.3-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ec2e49066076b22a093e93d708318496e2649738a6d8b174034778af2b5a076
|
|
BLAKE2b-256 checksum How to use checksums |
ef2a1f9f91e5fe43cfd2d801f6bb791af5369a9d5f43b0a568301baaee7d7d20
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for podpack-notes 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.