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.1.tar.gz (15.8 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.1-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sonnet_storage-0.1.1.tar.gz
  • Upload date:
  • Size: 15.8 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.1.tar.gz
Algorithm Hash digest
SHA256 e92fa362338818af87d623b02882ca776e24c5da13b8a19dd4ec556cb23e1f95
MD5 3552773210b55c3897f9f4a17cf0103f
BLAKE2b-256 bf6b25297b0861a93393658a30dfc37d0ccbf37aa3d236919b59a3f29cb76f81

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonnet_storage-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: sonnet_storage-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e020308caa3482165a8c0d90c2afc6b6ab568d6be89d009c0e02df7c90b5156c
MD5 ff4943a6e15703a092713aaaae403b2c
BLAKE2b-256 e1b66ca49fedcee3a6692801685daa6447ae9e9f3ba0fe84f4ac3c37cf984427

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonnet_storage-0.1.1-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