Skip to main content

protonfs

Sync a local directory tree with Proton Drive, via the official Proton Drive CLI, with conflict-aware push/pull and a local sync manifest.

Originally built to replace git-lfs as the storage layer for large, write-once simulation output — data that doesn't need version history, just somewhere durable to live and a way to fetch it back on demand.

The command surface (setup, status, ls, push, pull, rm, restore, refresh, install-drive, auth) is implemented — see src/protonfs/cli.py.

Requirements

  • Python >= 3.9
  • The proton-drive CLI binary — install it with protonfs install-drive (below), or supply your own on PATH / via PROTONFS_DRIVE_BIN.

Install

pip install protonfs
protonfs install-drive     # downloads + SHA-512-verifies the official proton-drive binary
protonfs auth login        # opens a URL to authenticate (passthrough to proton-drive)

install-drive detects your platform (linux-x64/arm64, macOS x64/arm64 — all checksum-pinned), requires AVX2 for the linux-x64 prebuilt (with an instructive fallback otherwise), and never installs a binary whose SHA-512 does not match the pinned checksum. Override the version with PROTONFS_DRIVE_VERSION and the expected checksum with PROTONFS_DRIVE_SHA512. On Windows, use WSL — native Windows is out of scope for 1.0.

Headless Linux (SSH, no desktop)

proton-drive keeps its session in the OS keyring, which on Linux means the freedesktop Secret Service reached over the D-Bus session bus. An SSH login has neither, which produces two failures that look like bugs in Proton Drive but are really a missing environment:

Cannot autolaunch D-Bus without X11 $DISPLAY          # no session bus at all
Cannot create an item in a locked collection          # bus exists; the keyring is sealed

The second one is the nastier of the two: if the machine has ever had a graphical login, ~/.local/share/keyrings/login.keyring exists, is the default collection, and is locked with a password you cannot type over SSH — so auth login completes the whole browser flow and only then fails to save the session.

protonfs handles both for you. Every command that shells out to proton-drive first reuses (or starts, and caches) a session bus, and runs gnome-keyring-daemon against a protonfs-owned keyring directory so it never has to unlock the sealed system keyring. To check a host:

protonfs doctor          # binary, session bus, Secret Service, and a real keyring write test
protonfs doctor --fix    # ...and repair what it can

Requires dbus-launch, gnome-keyring-daemon and gdbus (packages dbus/dbus-x11, gnome-keyring, glib2). No root needed. To run the proton-drive binary by hand in the same environment, use eval "$(protonfs shell-init)".

Escape hatches: PROTONFS_KEYRING_PASSWORD supplies your own keyring password instead of the generated one, and PROTONFS_NO_KEYRING_BOOTSTRAP=1 turns all of this off if you'd rather manage the environment yourself.

Scoping what gets synced

.protonfs/ignore is a denylist in gitignore syntax, scoped to a repo and independent of its own .gitignore — patterns like *.tmp or core.* are excluded from every push/pull/refresh/status/ls.

Syncing only matching files

Sometimes you want the opposite: sync only files of certain types (e.g. only simulation dumps, ignoring notes/scratch/logs). Add an allowlist at .protonfs/include, in the same gitignore syntax:

# .protonfs/include
*.ev
*.sink
*_[0-9][0-9][0-9][0-9][0-9]

When .protonfs/include exists and has at least one active (non-blank, non-comment) line, a file is synced only if it matches one of its patterns — and still not matched by .protonfs/ignore, which always wins over include. If include is absent, or every line in it is blank/commented out, behaviour is unchanged: everything not matched by ignore is synced.

Patterns are plain gitignore file patterns, matched only against file paths. You don't need !*/ or dir/** tricks here — directories are always descended into regardless of include/ignore, so a plain *.ev reaches files at any depth.

If you'd rather not add a second file, the same "only these files" behaviour can be expressed with .protonfs/ignore alone, but it needs a double-negation recipe and has two sharp edges:

# .protonfs/ignore -- sync only *.ev/*.sink and files ending in a 5-digit run number
*
!*/
!*_[0-9][0-9][0-9][0-9][0-9]
!*.ev
!*.sink
*mload*/**
  • !*/ is mandatory: once a parent directory is excluded, a later re-include pattern (like !*.ev) cannot resurrect files under it — gitignore semantics never descend into an already-excluded directory to re-evaluate its contents.
  • to exclude a whole subtree again (here, anything under a *mload* directory) you must write dir/**, not dir/ — a trailing-slash directory pattern does not match the files beneath it when tested against file paths the way protonfs's matcher does.

.protonfs/include avoids both pitfalls, which is why it exists as a separate first-class file rather than only being achievable via ignore.

Releasing (maintainers)

See CHANGELOG.md for release history and upgrade notes. To upgrade an installation: pip install --upgrade protonfs, then protonfs upgrade to bring the proton-drive binary and any repo state current (docs: Upgrading).

Merges to main auto-tag a release, but only after the full test matrix passes with an 80% coverage floor on the exact commit being tagged (auto-release.yml calls the CI workflow before creating the tag). Before milestone or manual tags, also run the live suite against a disposable Drive directory — it exercises real uploads/downloads that CI never can:

PROTONFS_TEST_REMOTE=/my-files/test .github/scripts/release_gate.sh

License

PolyForm Noncommercial 1.0.0 — free for noncommercial use with attribution; contact the author for commercial use.

Release files for protonfs 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for protonfs 1.0.1
File Size Uploaded
protonfs-1.0.1.tar.gz 174.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for protonfs 1.0.1
File Interpreter ABI Platform
protonfs-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 261.3 kB

Release files / protonfs-1.0.1.tar.gz

Download URL protonfs-1.0.1.tar.gz
Size 174.7 kB
Tags Source
SHA-256 checksum
How to use checksums
18d106327a9673b9d350884aca3b6ddf7c58bdcd0d0a21120bd6a5210c8ec9e0
BLAKE2b-256 checksum
How to use checksums
351fb0ee36b29807f2b5a5bed58f8da8bcc07475cbfe3d12cfaa6afbf2b7c570
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / protonfs-1.0.1-py3-none-any.whl

Download URL protonfs-1.0.1-py3-none-any.whl
Size 86.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c312129530b92846ea367d4b7d476ab864bcf4bac4e15e12b676537766a2b655
BLAKE2b-256 checksum
How to use checksums
9a79f665d4e023d0d5bd561f7e0fff52a6ccd79b122f074308e70372902f9c50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

2.1.0

2 release files

2.0.0

2 release files

1.12.3

2 release files

1.12.2

2 release files

1.12.1

2 release files

1.12.0

2 release files

1.11.3

2 release files

1.11.2

2 release files

1.11.1

2 release files

1.11.0

2 release files

1.10.2

2 release files

1.10.1

2 release files

1.10.0

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page