Scheduled wrapper around Paperless-ngx's document_exporter plus a _Steuer/YYYY tax-view post-processor.
Project description
paperless-export
A thin scheduled wrapper around Paperless-ngx's
built-in document_exporter, plus the one thing it doesn't do: a materialized
_Steuer/YYYY/ tax view built from your Steuer-YYYY tags.
Paperless's exporter already produces the full no-lock-in export — every
document laid out by your storage-path template, originals and PDF/A archive
versions, and a complete manifest.json (tags, correspondents, types, custom
fields). This tool deliberately does not rebuild any of that. It:
- runs
document_exporter <target> --use-filename-format --compare-checksums --delete(each flag toggleable), surfacing failures honestly and falling back to a flat export with a clear warning when a path exceeds the OS limit, - reads
manifest.jsonand builds_Steuer/<YYYY>/— one symlink (or copy) per document taggedSteuer-YYYY— plus a greppable_Steuer/INDEX.csv, - optionally embeds tags/correspondent/type into the exported PDFs' XMP
(
--embed-tags, needs the[pdf]extra).
export/
Bescheid/Finanzamt/2024-05-01 Steuerbescheid.pdf # ← document_exporter
manifest.json # ← document_exporter
_Steuer/
2024/2024-05-01 Steuerbescheid.pdf → ../../Bescheid/Finanzamt/…
INDEX.csv # year,title,correspondent,created,original_path
Install
pipx install paperless-export # + 'paperless-export[pdf]' for --embed-tags
# or
brew install fileworks/tap/paperless-export
(Not yet published — first release pending; until then: uv run paperless-export from a checkout.)
Usage
# the nightly job (run from the directory containing your compose file):
paperless-export run --export-dir /volume1/paperless/export
# rebuild only the tax view from an existing export:
paperless-export tax-view --export-dir /volume1/paperless/export
# FAT/exFAT or cloud targets that don't preserve symlinks:
paperless-export run --export-dir ./export --copy
Notes:
--exporter-target(default../export) is the path as the exporter process sees it inside the container;--export-diris the same directory on this host. With the standard compose setup they're the same bind mount.PAPERLESS_URL+PAPERLESS_TOKEN(env or flags) enable a preflight check so a bad token fails fast with a clear message — they're optional because the exporter itself runs inside the container and needs no API access.--embed-tagsrewrites the exported PDFs, which changes their checksums, so those files are re-exported on the next--compare-checksumsrun. The manifest already preserves all metadata — only embed if you want tags inside the files.
Behavior guarantees
- Read-only against Paperless — writes only into the export directory.
- Idempotent — the
_Steuer/view is rebuilt from scratch each run; safe nightly. - Verifiable — after a run,
_Steuer/2025/contains exactly the documents taggedSteuer-2025;INDEX.csvmatches a manifest query. - Honest failures — a non-zero
document_exporterexit surfaces its stderr and exit code; symlink-unsupported filesystems auto-switch to copies with a notice.
Exit codes
| Code | Meaning |
|---|---|
| 0 | success |
| 2 | bad configuration / authentication failure |
| 3 | Paperless (or Docker) not reachable |
| 4 | export dir missing / manifest unreadable |
| n | document_exporter failed with exit code n |
Scheduling on a Synology (DSM Task Scheduler)
cd /volume1/docker/paperless && \
/usr/local/bin/paperless-export run --export-dir /volume1/paperless/export
Nightly, after the Paperless backup window; the export target should live on a share covered by your backup chain.
Development
uv sync --all-extras --dev
uv run ruff check . && uv run ruff format --check . # lint
uv run mypy # strict types
uv run pytest # tests
uv build
Conventional Commits drive releases (python-semantic-release): merge to
main → version bump + changelog + GitHub Release + PyPI publish (OIDC) +
Homebrew formula bump.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paperless_export-0.0.3.tar.gz.
File metadata
- Download URL: paperless_export-0.0.3.tar.gz
- Upload date:
- Size: 63.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c81906d908ec2cbb248c4a0ce2795f9a64bcce8733b6231ab802106079523f9
|
|
| MD5 |
e9e4b648b7f772f573f58aab833968e6
|
|
| BLAKE2b-256 |
ca7d963c511f39e05696584f1dc540e56aa1977b2e449bf2c973cfc48590eed7
|
Provenance
The following attestation bundles were made for paperless_export-0.0.3.tar.gz:
Publisher:
release.yml on fileworks/paperless-export
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
paperless_export-0.0.3.tar.gz -
Subject digest:
6c81906d908ec2cbb248c4a0ce2795f9a64bcce8733b6231ab802106079523f9 - Sigstore transparency entry: 2159836779
- Sigstore integration time:
-
Permalink:
fileworks/paperless-export@5f963adeeb93dfd1133a1e2add8f022a1ab7aa4b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/fileworks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5f963adeeb93dfd1133a1e2add8f022a1ab7aa4b -
Trigger Event:
push
-
Statement type:
File details
Details for the file paperless_export-0.0.3-py3-none-any.whl.
File metadata
- Download URL: paperless_export-0.0.3-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52e807a9d4257386e56b62f3c8c7817cd09a7a8ff768d9d65680026ece5853a7
|
|
| MD5 |
658d40610347044657d5ed42bb4eabdb
|
|
| BLAKE2b-256 |
0b75a4661285bf8423c195cdffc34a88279bca1ef5645f0f01ebe799580c39d3
|
Provenance
The following attestation bundles were made for paperless_export-0.0.3-py3-none-any.whl:
Publisher:
release.yml on fileworks/paperless-export
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
paperless_export-0.0.3-py3-none-any.whl -
Subject digest:
52e807a9d4257386e56b62f3c8c7817cd09a7a8ff768d9d65680026ece5853a7 - Sigstore transparency entry: 2159838170
- Sigstore integration time:
-
Permalink:
fileworks/paperless-export@5f963adeeb93dfd1133a1e2add8f022a1ab7aa4b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/fileworks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@5f963adeeb93dfd1133a1e2add8f022a1ab7aa4b -
Trigger Event:
push
-
Statement type: