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

Uploaded CPython 3.14Windows x86-64

bear_shelf-0.3.20-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.20-cp314-cp314-macosx_11_0_arm64.whl (355.4 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

bear_shelf-0.3.20-cp313-cp313-win_amd64.whl (161.2 kB view details)

Uploaded CPython 3.13Windows x86-64

bear_shelf-0.3.20-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.20-cp313-cp313-macosx_11_0_arm64.whl (354.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bear_shelf-0.3.20-cp312-cp312-win_amd64.whl (161.2 kB view details)

Uploaded CPython 3.12Windows x86-64

bear_shelf-0.3.20-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.20-cp312-cp312-macosx_11_0_arm64.whl (355.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: bear_shelf-0.3.20-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 160.9 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.20-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 4dfbc0d8b3260728f1100f01135ace1502e9f3d16461d11c4ebc7d7aa697c3b5
MD5 f1aedbef4745288556f8f504b2c9f611
BLAKE2b-256 9307c9f1d39a53b833864b503cae28feea2de8c58c46d785da9030e6ed588b55

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.20-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.20-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.20-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2324c5f8c2a27babed81fd0e6d2a86187f4be8cd28d010ad157c4ead6f38dcc8
MD5 de684b3e10b65951200acce7309387ec
BLAKE2b-256 4ffde054e7840ac61d472de05dee5b48427e750b0a56d02fe8c5952d37cc0b19

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.20-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6526ac664d888fcd6f682507d4ee5a341108381a3195f2840dc0afeade829cf5
MD5 0300778a894c6ae0574ee2723023d9d9
BLAKE2b-256 e3bce52ec88b9dd53482cbec8e01885ffa846ac80b851177935e0ba9be971a08

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bear_shelf-0.3.20-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 161.2 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.20-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 38726fa9239ed074101a5ad147aac62d8b1c3f4cdf0d74a4d6983ba39e814c43
MD5 e15b2bec9871530a04b17b3752a041cc
BLAKE2b-256 27bc6d977da83d9e15f00e58ed1b04be3179cca561d8a41cae9ab9426f44dbb3

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.20-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.20-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.20-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3ac4cb8a66911b43ac9df0b855e65c39d8a4b05f39935b18e2637735382d46de
MD5 e17dd4c826911cdd0e605a37e5018e82
BLAKE2b-256 f8eea9077e530e8a9440821a95379c2fff302ff000141c3888a89497ac993fe9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.20-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2becd7c8c2645d46d0d1a610b6ad224200af02c1e425fd28339ae4ad40085810
MD5 4fe6a99dab15b36471ec5c61d2a07a6e
BLAKE2b-256 611b7d957766a44294cebb4edb1c2e26b682655228faf4222ab72d4b77516aca

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bear_shelf-0.3.20-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 161.2 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.20-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1579d4d6215b867dbca2f9705d047034194849ce288ea253adf0c7e53c61a943
MD5 48926ae84db86bbf1403c590621e1f62
BLAKE2b-256 6134faea140628b5030a69b0665763db637870e10f42b67fe689e94fbba2c766

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.20-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.20-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.20-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7bbb15bc6a433accc2a6a91e598c5e14d9c5f4c4939a61ab1ffaf4a4e4ea6248
MD5 00c4014a083ec871cf3b558d77baf634
BLAKE2b-256 f45311b3a31c3dedd7ae8febaf218ee5fe9d05b0d7e4bf6da8a455f0b2c0c62a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.20-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f55fe8a5b9485e1129450b677c90e3273a762bf0b1a5b4aa5c3b4858048718f5
MD5 06984621b8e970b047dcfe671212bf34
BLAKE2b-256 ae531eb6e6866d6cc00b8397fb8b716fe2fe105e533178b9088906ec7adf5bf6

See more details on using hashes here.

Provenance

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