Skip to main content

sonnet-storage

Virtual file storage backed by PostgreSQL for sonnet-server applications.

Provides a UPath-compatible filesystem abstraction over a database table. Consumers use standard pathlib operations (read_text(), write_text(), iterdir(), etc.) and the backend (local filesystem or database) is transparent.

Quick Start

from sonnet_storage import get_storage_root, register_protocol

# Register the db:// protocol (once at startup)
register_protocol()

# Use like pathlib
root = get_storage_root()
rules = root / "rules"
for f in rules.iterdir():
    content = f.read_text()

Features

  • Text, JSON (native JSONB), and binary content storage
  • Soft delete with recovery
  • Versioning (monotonic counter per file)
  • Seeding from local directories / package data
  • Configurable UPath protocol name (default: db://)
  • Pre-built REST router factory
  • Optional StorageExtension for auto-registration

Database

PostgreSQL only. See docs/data-model.md for the complete schema reference. Consumers own their Alembic migrations -- see ADR-0002.

Documentation

Metadata

Release files for sonnet-storage 0.1.2

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

Source distribution (sdist)

Source distribution for sonnet-storage 0.1.2
File Size Uploaded
sonnet_storage-0.1.2.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sonnet-storage 0.1.2
File Interpreter ABI Platform
sonnet_storage-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 34.2 kB

Release files / sonnet_storage-0.1.2.tar.gz

Download URL sonnet_storage-0.1.2.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
87e4f54e823ca9c086d5185f34673af63dbf0b4d5584dcd3b61a1d77513a829b
BLAKE2b-256 checksum
How to use checksums
0747426ea623e4857d7e9e084213ef22193928a4fccfa47525270024d2e6cde7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 12, 2026.

Transparency log

Release files / sonnet_storage-0.1.2-py3-none-any.whl

Download URL sonnet_storage-0.1.2-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abac6e45f73004aae5481844148061d7d950ade15c093ad62afe94b0ad948008
BLAKE2b-256 checksum
How to use checksums
eea8681e456c1da046a00b892d13f251cbf83e0e78344f7c8d5c1c4f842f8ec3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 12, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.4

2 release files

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.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