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

Uploaded CPython 3.14Windows x86-64

bear_shelf-0.3.19-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.4 MB view details)

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

bear_shelf-0.3.19-cp314-cp314-macosx_11_0_arm64.whl (355.1 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

bear_shelf-0.3.19-cp313-cp313-win_amd64.whl (160.8 kB view details)

Uploaded CPython 3.13Windows x86-64

bear_shelf-0.3.19-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.4 MB view details)

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

bear_shelf-0.3.19-cp313-cp313-macosx_11_0_arm64.whl (354.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bear_shelf-0.3.19-cp312-cp312-win_amd64.whl (160.8 kB view details)

Uploaded CPython 3.12Windows x86-64

bear_shelf-0.3.19-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.5 MB view details)

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

bear_shelf-0.3.19-cp312-cp312-macosx_11_0_arm64.whl (355.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: bear_shelf-0.3.19-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 160.6 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.19-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 14a31f500e4f9d34c786adb589b75dba6ddc9726249d12cc66e918c575fc6c62
MD5 055ffcb39c4b70b66daf9a495c798a70
BLAKE2b-256 3e68db5e8d905141d04beac50f1ad8cc6e1e844ab8c6f9098880825b141caea9

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.19-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.19-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.19-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d579ed90d61ddab6c2e0b844039acf9a493ee431f84d2f89d1660d2e5d7f9513
MD5 d309fbeb3b05e327284c1eb942e5313b
BLAKE2b-256 35e29d105c59f6de5f24ba5e0431674137b516b45696357f229962fcec39806c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.19-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_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.19-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.19-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e57ab0270942f67519598df21471ca9f3ada1f33b14b1880aea580be9ae415bc
MD5 7fa4dec1d04477796180f14923294fb4
BLAKE2b-256 fa526c198d99cea9223f163fc94afa558bad42e8802c97c762c2be7e8de56679

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bear_shelf-0.3.19-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 160.8 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.19-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f934ada88e69e4e0ca3107b892ee7b6d45be21df462c20378ceaa3d624bc4794
MD5 cfddb353e57e81bd4936a2d28a28d1d8
BLAKE2b-256 ab152c2b738ee5d4166c4b44405f1dcfdd5574a76a68e52e99ae069c7a100610

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.19-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.19-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.19-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ec2485dfa507f0cb487f1dc92bf0e0634151392b2ca070c3318c8ef74f8777c6
MD5 b50e208cb2d46fcc5c22d362c1316975
BLAKE2b-256 03baa298c91e4c0f70e3535e782033311b0542dcc8a4f23b19d187a46c5727ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.19-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_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.19-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.19-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 05eb63286ee6f448a2ebe8853d5276e08c31e885ba639e9e3c6a0df7fcf85f2b
MD5 b1760f6ff702d53230bdad00e30091b2
BLAKE2b-256 2d7edbc013d3c21616446085314a83d5f0746507e3c1abfdce33c3bd1012da59

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bear_shelf-0.3.19-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 160.8 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.19-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c14ddc09cdc6ec0625dc7e7492187c1f6940dcf88b3071b14f5547b42cd199eb
MD5 012a2c7f2e0825d0a5bf5f3953656e9b
BLAKE2b-256 b7a3517d45bcb797f1969676fb1e281705ba3f8772f80355341b23b155526f9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.19-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.19-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.19-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2ca8a70f0db3d1c65325f7e9c1b0f1c3cd5d64f2545e6981165a2f9e0c95c5c0
MD5 f97345fbfa1ceea366837d459dd69946
BLAKE2b-256 25778119a662442f604c37c03fb7cca589dc98cc5b6802dd5e8731eaa12b0778

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.19-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_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.19-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.19-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8c8f26cca1ec5240b9090c9f1f74d8607d6f60cce6226ce3aa0c6d9c9f9cd371
MD5 9b2533a65ea5f274c2ad8336bad29d7a
BLAKE2b-256 ffa39255ac253776c21c7a4626e7e4db9cb2fbd89c9b41112a6aa716a86203f4

See more details on using hashes here.

Provenance

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