Skip to main content

mountable.io SDK for Python

Read, write, delete, list and follow the files of a mountable.io filesystem over HTTPS from a backend, without mounting it, create one-time mount tickets for sandboxes, and manage filesystems, their limits, mount sessions and webhooks.

pip install mountable-sdk

Python 3.10+, synchronous, one dependency (httpx).

Example

from mountable_sdk import Mountable, MountableError

client = Mountable()  # MOUNTABLE_API_KEY; MOUNTABLE_API_URL or https://mountable.io
fs = client.filesystem("fs_…", mode="rw")  # sends nothing until first used

info = fs.write("tickets/AB-42.md", "# AB-42\n")
fs.write("tickets/AB-42.md", "# AB-42, edited\n", if_match=info.etag)
try:
    fs.write("tickets/AB-42.md", "lost update", if_match=info.etag)
except MountableError as e:
    if e.code == "precondition_failed":
        print("changed meanwhile; now", e.current_etag)

file = fs.read("tickets/AB-42.md")  # file.data (bytes), file.info (FileInfo)
fs.delete("tickets/AB-42.md", if_match=file.info.etag)

ticket = client.create_mount_ticket(
    "fs_…", mode="ro", max_duration_seconds=12 * 3600, idempotency_key="job-42"
)
# hand ticket.ticket to the sandbox: mountable mount --ticket-stdin DIR


# Stay in sync: take a cursor first, then list, then follow changes from it.
def resync() -> str:
    cursor = fs.changes().cursor  # 1. a cursor first
    page = fs.list("tickets")  # 2. then list (page.next pages on)
    for entry in page.entries:
        print(entry.path, entry.etag)
    return cursor


cursor = resync()
while True:  # 3. then follow changes from the cursor
    try:
        batch = fs.changes(cursor=cursor, wait=25)
    except MountableError as e:
        if e.code != "cursor_expired":
            raise
        cursor = resync()  # history is gone: start over
        continue
    for event in batch.events:  # invalidations: reconcile each path to event.file
        print(event.type, event.path, event.file and event.file.etag)
    cursor = batch.cursor

Managing filesystems

client = Mountable()  # org_id: MOUNTABLE_ORG, else the API key's organisation

info = client.create_filesystem(
    "agent-workspace", spending_cap_cents=2_000, byte_quota=5 * 2**30
)
client.update_filesystem(info.id, mutations_per_minute=None)  # the platform default
print(client.filesystem_usage(info.id).retained_bytes)

hook = client.create_webhook(
    info.id, "https://example.com/hooks/mountable", path_prefix="/tickets"
)
save_secret(hook.secret)  # whsec_…, returned only here and by rotate_webhook_secret
Method Returns
list_filesystems() list[FilesystemInfo]
create_filesystem(name, *, spending_cap_cents, mutations_per_minute, byte_quota, entry_quota) FilesystemInfo; limits not given take the API's defaults
get_filesystem(fs_id) FilesystemInfo
update_filesystem(fs_id, *, spending_cap_cents, mutations_per_minute, byte_quota, entry_quota) FilesystemInfo; only the limits passed change, None removes the spending cap or the mutation rate
filesystem_usage(fs_id) FilesystemUsage
list_mount_sessions(fs_id) list[MountSession]
revoke_mount_session(session_id) None
create_webhook(fs_id, url, *, path_prefix) Webhook with .secret
list_webhooks(fs_id) list[Webhook] (.secret None)
delete_webhook(fs_id, webhook_id) None
rotate_webhook_secret(fs_id, webhook_id) Webhook with the new .secret
enable_webhook(fs_id, webhook_id) Webhook

These calls use the API key, and the API checks what it may do:

  • An API key limited to one filesystem cannot create or update filesystems (403 key_limited_to_filesystem); creating and updating also need the key's creator to be an owner or admin of the organisation.
  • Updating a filesystem and every webhook call, listing included, need read-write access to the filesystem.
  • A key lists only its own live sessions and revokes only its own sessions.
  • The API checks the ranges: spending_cap_cents 0–1,000,000,000 or None (no cap), mutations_per_minute 1–1,000 or None (the platform default), byte_quota 1 GiB–100 GiB, entry_quota 10,000–1,000,000. The two quotas cannot be removed.

Behaviour

  • The handle creates a one-hour token session on its first call and keeps the token in memory only. A 401, or a session within 60 seconds of its expiry, makes it create a new one and send the call once more.
  • Every failure raises MountableError with status, the API's stable code, message, current_etag (for precondition_failed) and retry_after. Network failures have code == "network_error". API keys, tokens and webhook secrets never appear in errors.
  • Only a 2xx answer is a success; redirects are not followed.
  • Only reads (read, list, changes, and the get_, list_ and filesystem_usage calls) and the repeatable revoke_mount_session and enable_webhook are retried, once, after a network failure. write, delete, create_filesystem, update_filesystem, create_webhook, rotate_webhook_secret and delete_webhook are never retried: after a timeout the outcome is unknown, and a conditional write makes your own retry safe.
  • A request fails with network_error after 60 seconds without an answer; changes waits 60 seconds plus wait.
  • create_mount_ticket returns the ticket once, in .ticket; it is left out of the result's repr. Reuse your idempotency_key to retry after an unknown outcome; a replay returns the session with ticket None. A Webhook's .secret is left out of its repr the same way.

Documentation: https://mountable.io/docs. The behaviour shared with the TypeScript SDK is listed in sdk/contract.md.

License

Apache-2.0.

Metadata

Release files for mountable-sdk 0.2.0

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

Source distribution (sdist)

Source distribution for mountable-sdk 0.2.0
File Size Uploaded Provenance Actions
mountable_sdk-0.2.0.tar.gz 37.8 kB With provenance Details for mountable_sdk-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mountable-sdk 0.2.0
File Interpreter ABI Platform Actions
mountable_sdk-0.2.0-py3-none-any.whl Python 3 none any Details for mountable_sdk-0.2.0-py3-none-any.whl

Total release size: 52.9 kB

Release files / mountable_sdk-0.2.0.tar.gz

Download URL mountable_sdk-0.2.0.tar.gz
Size 37.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3322ed3ec99349ff8ec487252b08cb4513121aabb96709b3ac7fa20a07c031ec
BLAKE2b-256 checksum
How to use checksums
d03f680169fee6a5811b911691607f2ec79f227dd525c49bdcb63060ba285459
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Release files / mountable_sdk-0.2.0-py3-none-any.whl

Download URL mountable_sdk-0.2.0-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a690a5a9a6b086e30a00bf4bf7f7803e72622235feb4bc2dee5052d1b813c890
BLAKE2b-256 checksum
How to use checksums
389ac99a52a026bc6c8cce83ab5a5d6a0e0b209c17fae4a7c9b0bb6279c7169b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Security for mountable-sdk 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mountable_sdk-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

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.

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