Skip to main content

Virtual file storage backed by PostgreSQL for sonnet-server applications

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sonnet_storage-0.1.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sonnet_storage-0.1.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file sonnet_storage-0.1.0.tar.gz.

File metadata

  • Download URL: sonnet_storage-0.1.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sonnet_storage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 17bb9da5642e76ea2d2c0191c28f593e90038f14c1333d8e6b6b4a1b58e64372
MD5 f30887c1091aa88d48b391976b56698b
BLAKE2b-256 71bc8761f50b312f556a6c045d3456ef2cf98ceac2050386d64c751fedae154c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonnet_storage-0.1.0.tar.gz:

Publisher: publish.yml on petrarca/sonnet-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sonnet_storage-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sonnet_storage-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sonnet_storage-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7aa6fef700bc96a292f2b5e299e72479c6a905df147395db22e663f376f4e6dd
MD5 20c3eab743b39952791a10b71d6f5b7e
BLAKE2b-256 79fd121bd4586d2c2a5b560be0b581ba9c97731f4f02ca4f06053bb9fd23ac04

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonnet_storage-0.1.0-py3-none-any.whl:

Publisher: publish.yml on petrarca/sonnet-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page