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

Uploaded CPython 3.14Windows x86-64

bear_shelf-0.3.21-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.21-cp314-cp314-macosx_11_0_arm64.whl (354.3 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

bear_shelf-0.3.21-cp313-cp313-win_amd64.whl (160.0 kB view details)

Uploaded CPython 3.13Windows x86-64

bear_shelf-0.3.21-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.21-cp313-cp313-macosx_11_0_arm64.whl (353.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bear_shelf-0.3.21-cp312-cp312-win_amd64.whl (160.0 kB view details)

Uploaded CPython 3.12Windows x86-64

bear_shelf-0.3.21-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.21-cp312-cp312-macosx_11_0_arm64.whl (354.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: bear_shelf-0.3.21-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 159.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.21-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e17c93a44c32a2d41b4b8d669dcec102309b892adce59bc5d61e88589eaa0d8e
MD5 a81dd1633524d3fad2e1ed49206ce936
BLAKE2b-256 b9224395d22fba45c0fd3ac491db4413104842b3a05579c3221cb6c4b21d9f08

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.21-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.21-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.21-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 31f4c407c44a2f9782d3149565f6f458a9fdc725f3c6cc91e4f15140c385ae5a
MD5 41fd3a2458f741a60d88aa42616f10b2
BLAKE2b-256 02047182af930e10519abd38c6a3d963206c963878214e66fb855bf39f6c27c8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.21-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f02490d529cab81b0b2e53db2a02852c9bd18ba025d7e9a91a248b4061e319f9
MD5 ac715f5ad90f2c55bcba1683e9ecb50a
BLAKE2b-256 3b0b9928bed2591a212d3a02ac085a5bed4a95cad7f8c72e760e519c03d647d8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bear_shelf-0.3.21-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 160.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.21-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b248797be3a2dc6b34b22438bf0852399c48d267ebc285aec8788bb5c9b445aa
MD5 37b19c22ff56dfe3411d46891fdd837d
BLAKE2b-256 945668e7a705bdbc483609970486ffc08e761c404661540585598f2341514ed1

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.21-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.21-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.21-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 16cac64b440a9f4a288cc1bb7ed756eb7c0a82488321104e57fe16d3d7916400
MD5 fc95ed4816a7c47aa735fc893b56219f
BLAKE2b-256 34f52db85adc21f7d043f3f7190f2d2fe5536b1378055c3a7bbab8c6f88cf957

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.21-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 95b471c4fd833fb54a3edb6c0a48658d2a09a18570dbe9db56cbb3595e28849f
MD5 3b4ee85a32bb8063f1861aeb3c419089
BLAKE2b-256 fff796e0fb91ded3ffae336c2801173b17a3b0b77d003b1663a11ef5cd220c83

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bear_shelf-0.3.21-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 160.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.21-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3bbb30cd8e52393af6ac379313f00d16eb93742ed142c41ae95778b6a081e5c4
MD5 61f1e09a338522182e4f18dd3d7a20be
BLAKE2b-256 9d82d63d23302edc64e2024bbe564b2b9f660e6bf7fb2e8347dee185e3d04611

See more details on using hashes here.

Provenance

The following attestation bundles were made for bear_shelf-0.3.21-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.21-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.21-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 738249cdc090fa516c06976a4f28e17e00c3efabb0f1ad6cc310c8327902ce2f
MD5 d42470dd96624b164fd74545a21cc46f
BLAKE2b-256 3069760185722a379b774b326ad0c8da8d908d56040debdf0188498ad2bf9b7c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.21-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b19fec3ece80bcb7c73cc8695d3ec89d2df00af31775f2997b7e72bbdbd6f221
MD5 23e45fe55bd05904c2956ed44158d061
BLAKE2b-256 44bccc80c629c0018a8ed9abba8c5cda2897f6c37941c9ebb39283ef2723b7d0

See more details on using hashes here.

Provenance

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