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

Uploaded CPython 3.14Windows x86-64

bear_shelf-0.3.25-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.25-cp314-cp314-macosx_11_0_arm64.whl (377.9 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

bear_shelf-0.3.25-cp313-cp313-win_amd64.whl (151.0 kB view details)

Uploaded CPython 3.13Windows x86-64

bear_shelf-0.3.25-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.25-cp313-cp313-macosx_11_0_arm64.whl (377.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bear_shelf-0.3.25-cp312-cp312-win_amd64.whl (151.0 kB view details)

Uploaded CPython 3.12Windows x86-64

bear_shelf-0.3.25-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.25-cp312-cp312-macosx_11_0_arm64.whl (378.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: bear_shelf-0.3.25-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 150.8 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.25-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a2e57ea6627c2513812a3915763a3f24c4a017fb60ca484d36914e0cc04f76e7
MD5 dc2e587f4dfa02ad76c1986c701670ad
BLAKE2b-256 5f3f6870cb3443e57cf8998c5786314f41f4d293b4215cde343cb4a43afbe949

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.25-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7a05bd850d411a4b3727a0aac3e4e620541d26fce3332d9282d3751868e08885
MD5 ef29536d0a8ec34ede39ca5ac3097486
BLAKE2b-256 c0932b0ca5d93f411d4ef03bb9d8e457dcb5ef24f9a0607c310e666923ecb9d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.25-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.25-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.25-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2da6deb0f7c656a7dd159f49199be84df303025957be9e719c030b054d06a9fc
MD5 16a53aaabe2a20fb5e9418063024dc04
BLAKE2b-256 3d57387597beb422d968c20b707221aea93fc9a9f2809422f09c3e67c6cc6e72

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bear_shelf-0.3.25-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 151.0 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.25-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3a7d52befc98394c85aae0d5f032b581c62850442cf73631053d5563c3a3b058
MD5 cc0a3fe7a5ab472f2886c07b6f10f208
BLAKE2b-256 a7a756e667a067062d45226754165eb9d48afd9aa84d568d856ece6515aabe90

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.25-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 504734747c9ec6db1220fa089d34b31e17cf8be9b15c3d15e054c657b5beb918
MD5 0acc4795d366962b57e45ada8b4ea04f
BLAKE2b-256 260124802d446dbdf5c19ce726b3d0b6013880152a50d09371cc41cb46c14a04

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.25-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.25-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.25-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1d0b6b0ebd75117c3577226cf2372e17e6ad1c60a176317c0cac996483fff8a7
MD5 115ddb2d8d0fd2e3166d745a38120918
BLAKE2b-256 94eed271759ac3c21a05e249929c9f3da09b6574ceab3af4994d1c08b93e2648

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bear_shelf-0.3.25-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 151.0 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.25-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7f22999aaf849989d63979aebd993108f5ccfa5c93e348751eead3cfc25b627c
MD5 bf1e3fa9fd899f92db6d0e2fbacd484e
BLAKE2b-256 50aac14a85fe9150644c61d8e4a243ca4c12f62f4649fb6866d9342b2a1f8566

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.25-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 89e6967f780af4a7ea4d156502cafeb3d1ae9bca5e9ee3d12a6b9cc3ed66968c
MD5 4d3e2a79e497bb8e54747b34b101e54f
BLAKE2b-256 9a875dbacc4c0a6757ab54fd5cb654635f4083caf8f797a3e3d93f20e31c305c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.25-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.25-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bear_shelf-0.3.25-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b8c49de1cb1e5524f72d24b6ebf9e437757acbff39f4243ce4436af0d90d1368
MD5 67a57293ce73ac1dfb06a50a1175ca22
BLAKE2b-256 40ff0e9378cef67d98d0be9551958211ca581859900a997efe6de367153d37bd

See more details on using hashes here.

Provenance

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