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.28-cp314-cp314-win_amd64.whl (150.5 kB view details)

Uploaded CPython 3.14Windows x86-64

bear_shelf-0.3.28-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.28-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

bear_shelf-0.3.28-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.28-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

bear_shelf-0.3.28-cp313-cp313-macosx_11_0_arm64.whl (377.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

bear_shelf-0.3.28-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.28-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

bear_shelf-0.3.28-cp312-cp312-macosx_11_0_arm64.whl (377.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: bear_shelf-0.3.28-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.12

File hashes

Hashes for bear_shelf-0.3.28-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 d50c858ce5f8cdc290c9e111a4f3cac565cd1bc1b0870eba6f4bbfeb9d04c5be
MD5 a2bd520ef7ef5a867498c46679c0c3aa
BLAKE2b-256 a032ac19a8cf4129acb1fb48b1d47c7cd4cbebc0c30dd17e05b897c998296d38

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.28-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.28-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.28-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9d1a65c197fc05080c2290984e2c942ddfcabb98961b38965edf5d673df4b0c7
MD5 5e610cec25ba418b56a48327c4f20d2f
BLAKE2b-256 bf41f619f09b826ba001cb6392f7f3bf18da97a2c1321737f77ebfe617da0907

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.28-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.28-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.28-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 473451d2eacd8226e98864637df6b1e49d7242d9f951e0a0797997655d42447e
MD5 9501c129e466c82b2ec049c4af9b828d
BLAKE2b-256 59e141dcb9129fe6f1bd5f8d608322b4a4a80ce38f6f7561a8b7a8e9059b0393

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.28-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.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.28-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.28-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d6132f1e1dce6e7bfcb4c43688ff37c3bdcbb4ca66e598b3d86978691f35ccb7
MD5 fa634313a0e608d3e020ac9a89aa7325
BLAKE2b-256 037020c5d74992769581f4893df302ca70c5fbf461910327b90eb507f719ef2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.28-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.28-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: bear_shelf-0.3.28-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.12

File hashes

Hashes for bear_shelf-0.3.28-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d769d9ca60238a1812380ca7c30c5cf2c4bafdcbf0b3b6df13f01a164693ea17
MD5 e1caf50e098d4ff423d2ea22644ab954
BLAKE2b-256 61f9056b2efff64b1003562031b41e0995f93878e8bf3f15b8014ce3828e43d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.28-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.28-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.28-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f825b4cf7bd22267e9caa78814181ebe2a7c652bb448b0f129fd038e0565896b
MD5 06bb2a226531daadb397bd0d0f773fa0
BLAKE2b-256 c0422a6345e3fa41cc06756e21f35ab19d0438977df3bc0cb77ff674e90efa21

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.28-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.28-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.28-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 18cbe883a98366c08d7e40a2819c729c8c60700804ad3060c61eabff58ca1a24
MD5 b1e229cbe5962f241508c0fc78c42246
BLAKE2b-256 f4e607138ea17075e18179183713f549511795982c5d6295b062b36828ad4a7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.28-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.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.28-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.28-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 170d81ee08c60165c81f5ddc7eb34ac555e8dcced786d4cfa0c2d2536e42bda4
MD5 815e370b9964b663247315172c190217
BLAKE2b-256 18bfb49feb1732cbc1339a38b8cc9c082e3b7bde4520d8027331e8ef92ff6d61

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.28-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.28-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: bear_shelf-0.3.28-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.12

File hashes

Hashes for bear_shelf-0.3.28-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d5bc14f8869c8806c8e064a467e862607c4a13c5595e700210186f1d250ade71
MD5 754ab5afcfec80c0e276c78661052f73
BLAKE2b-256 a58a5abb9e674430692086948f6f668fb344c795b609db8f0aab0545b4e6bd39

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.28-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.28-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.28-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4c58ded2ab69163309d850af3e0ce3f4a60ee5c3fdef29601f05b0b4ca69df94
MD5 c79832e716757f0fb119f4c1fe7ef443
BLAKE2b-256 97bf1587c128ad6cf277c32ac15eb1c9955ae82ae54a98402f59ccea6917e68e

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.28-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.28-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.28-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d5b6aa14f85740ff62517d2fb390a2884727c7f636b19cfdc982c52c6588dd22
MD5 036b0efb32ce9dd563f021b5c31e61b0
BLAKE2b-256 04155f6034d3af63ee8a0ca64926259c8aba22701f0f6912835398da00d4da4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.28-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.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.28-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.28-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9e62ec9559c6fa53eda5e8242a987167a89f610fa6b938853db46916f19e024c
MD5 b8a95164542406012cee1ce9fcceaa48
BLAKE2b-256 ea2060f5cdef3dceabee9803d7d26ac53726dc4582b81b5ec4217467337e2328

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.28-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