Skip to main content

A lightweight document storage system with SQLAlchemy dialect support. Where your data or honey, hibernates.

Project description

🐻📚 Bear-Shelf

pypi version

The shelf where your data hibernates. 🐻💤

A lightweight document storage system with SQLAlchemy dialect support. Store your data in JSONL, JSON, TOML, YAML, XML, MessagePack, or in-memory formats with a clean, type-safe interface.

Features

  • 🔌 SQLAlchemy Integration: Use familiar SQLAlchemy syntax with file-based storage
  • 📦 Multiple Backends: JSONL (default), JSON, TOML, YAML, XML, MessagePack, or in-memory storage
  • 🔒 Type-Safe: Full type hints and Pydantic models throughout
  • 🚀 Lightweight: No heavy database engine required
  • 📝 Write-Ahead Logging: Optional WAL support for data durability
  • 🛠️ CLI Tools: Built-in command-line utilities for debugging and management

Installation

With uv:

uv tool install bear-shelf

Quick Start

from sqlalchemy import create_engine, Integer, String
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, Session

# Create engine with bearshelf dialect (file extension determines backend)
engine = create_engine("bearshelf:///path/to/users.jsonl")

class Base(DeclarativeBase): ...

class User(Base):
    __tablename__ = "users"
    id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
    name: Mapped[str] = mapped_column(String, nullable=False)
    email: Mapped[str] = mapped_column(String, unique=True, nullable=False)

# Use it like any SQLAlchemy database!
Base.metadata.create_all(engine)

with Session(engine) as session:
    user = User(name="Bear", email="bear@shelf.com")
    session.add(user)
    session.commit()

🎯 Storage Backends

Bear Shelf auto-detects the storage backend from file extension:

  • JSONL (default): bearshelf:///path/to/data.jsonl
  • JSON: bearshelf:///path/to/data.json
  • TOML: bearshelf:///path/to/data.toml
  • YAML: bearshelf:///path/to/data.yaml
  • XML: bearshelf:///path/to/data.xml
  • MessagePack: bearshelf:///path/to/data.msgpack
  • Memory: bearshelf:///:memory:

🐻 About

Built with ❤️ by Bear. Part of the Bear-verse ecosystem:

  • funcy_bear: Lightweight functional programming and type introspection utility
  • bear-epoch-time: Timestamp handling
  • codec_cub: Codec utilities

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

bear_shelf-0.3.26-cp314-cp314-win_amd64.whl (150.5 kB view details)

Uploaded CPython 3.14Windows x86-64

bear_shelf-0.3.26-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bear_shelf-0.3.26-cp314-cp314-macosx_11_0_arm64.whl (377.6 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

bear_shelf-0.3.26-cp313-cp313-win_amd64.whl (150.7 kB view details)

Uploaded CPython 3.13Windows x86-64

bear_shelf-0.3.26-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bear_shelf-0.3.26-cp313-cp313-macosx_11_0_arm64.whl (377.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bear_shelf-0.3.26-cp312-cp312-win_amd64.whl (150.7 kB view details)

Uploaded CPython 3.12Windows x86-64

bear_shelf-0.3.26-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

bear_shelf-0.3.26-cp312-cp312-macosx_11_0_arm64.whl (377.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file bear_shelf-0.3.26-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: bear_shelf-0.3.26-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 150.5 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bear_shelf-0.3.26-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 886109f14a8c16b22204d0a290941a7b9cea817a3a191a7835fa5c0a3f834fb2
MD5 5431d6d07bd4b1297e81981bd9fd3f3f
BLAKE2b-256 710da681ef4b2a42c4b031e63d727612a83e886922ac360f5866b9dba1b07c04

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.26-cp314-cp314-win_amd64.whl:

Publisher: build-wheels.yml on sicksubroutine/bear-shelf

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

File details

Details for the file bear_shelf-0.3.26-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.26-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c692c3ddb35b8268eec40712d04e1468b28fb2746fc38b933b0c0c40350075c6
MD5 a68d1fd7687e083322a30f39693dfaa9
BLAKE2b-256 c0afb155715357f1e015d7f75f4d7121d6115dba8a3dd935d7ecc3fe89d0619b

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.26-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on sicksubroutine/bear-shelf

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

File details

Details for the file bear_shelf-0.3.26-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.26-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2116e097187f315397c715d56a850ef67b076193e6907b651e545a7583295c99
MD5 86168edffe574b263d8629d87c8ade05
BLAKE2b-256 0c91ec5a534c46028409ae287746e4b98f47118461d08d7b7cba0a852d03263f

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.26-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on sicksubroutine/bear-shelf

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

File details

Details for the file bear_shelf-0.3.26-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: bear_shelf-0.3.26-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 150.7 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bear_shelf-0.3.26-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 61005ec884f69f1bcb84345751c7d677d27c4314f41b60784291634d57d6e8f6
MD5 99d0aae4cab8d1e573f36a6aff2cc126
BLAKE2b-256 3f11adaa87af3be0d127f4a01e485f6cdb0689e922d9f43c05cae0ff85e2eb8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.26-cp313-cp313-win_amd64.whl:

Publisher: build-wheels.yml on sicksubroutine/bear-shelf

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

File details

Details for the file bear_shelf-0.3.26-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.26-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 03f88aab1f8081668271fa6c261ce6d3896915b79dacd7a40daea525b9e141c8
MD5 a2a2b0ea146439053ca716b068c460bf
BLAKE2b-256 9e2d1d268a22d0a8248b743b95056da4989e57a16dfd57bc7afe203f917cffb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.26-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on sicksubroutine/bear-shelf

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

File details

Details for the file bear_shelf-0.3.26-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.26-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad90cc70da36630a8db82c93d820d4a91db84377c7d672fac169ad382a3a698f
MD5 3d9154b224904cc9b021e089ccdcbd39
BLAKE2b-256 6828138bdacca4af2c227a1ba9a72b58db92a604a4040bf62d55b9f0f3c4f4e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.26-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on sicksubroutine/bear-shelf

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

File details

Details for the file bear_shelf-0.3.26-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: bear_shelf-0.3.26-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 150.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bear_shelf-0.3.26-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a55a8889b5404ade468c39264be819767e4bef13986ea6243bcc3466e267502f
MD5 42178edadd80c7f56d53c28cc37f0d4d
BLAKE2b-256 1714319aa26a67b03d63968413502a3b80a5fc633a8a52a12492fa926f85bd68

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.26-cp312-cp312-win_amd64.whl:

Publisher: build-wheels.yml on sicksubroutine/bear-shelf

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

File details

Details for the file bear_shelf-0.3.26-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.26-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d2fc5eb855e19b3efd779814076668d765e63be93ced2bfdee835667a151c52b
MD5 0b3b25eafbd586ee4f7739e8df8c9b6a
BLAKE2b-256 f46732ea098f1d7c571de0551e7fb349b91ea0abba758a3b98135edc1ea87ae2

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.26-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-wheels.yml on sicksubroutine/bear-shelf

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

File details

Details for the file bear_shelf-0.3.26-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.26-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 75477c134ee9983611be16f60cf5ce49a6035a873970ef40bf39e8f05b4bc27a
MD5 00def6f6e12d957254c1e47bbeb0b123
BLAKE2b-256 0ff85df042172ce4b479a72b62274d3601a6e8bb8c9adbc3eb39e3351b09f1ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.26-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build-wheels.yml on sicksubroutine/bear-shelf

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