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

Uploaded CPython 3.14Windows x86-64

bear_shelf-0.3.23-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.23-cp314-cp314-macosx_11_0_arm64.whl (381.3 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

bear_shelf-0.3.23-cp313-cp313-win_amd64.whl (154.4 kB view details)

Uploaded CPython 3.13Windows x86-64

bear_shelf-0.3.23-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.23-cp313-cp313-macosx_11_0_arm64.whl (380.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bear_shelf-0.3.23-cp312-cp312-win_amd64.whl (154.4 kB view details)

Uploaded CPython 3.12Windows x86-64

bear_shelf-0.3.23-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.23-cp312-cp312-macosx_11_0_arm64.whl (381.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: bear_shelf-0.3.23-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 154.2 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.23-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 8414754753bb87b9077637a679abbe883f6eccd994d1a6d0a53c72a3784fbb0d
MD5 db082f604506a264e92b0718cacb3d7d
BLAKE2b-256 7b85fb2f2f06f48b1c93ee8b2b6be4b181a7f8933503271c3ebb6e6fda39dc45

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.23-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 699b0e5caac0931436fa5bf361d6ca5a97f940c4af0a8097da6a834fcddf641c
MD5 efbfd463ba6ef1ba3be035add10a7b33
BLAKE2b-256 d9a1193a2dc9a8d54696db151888f588d5b2a95e8a526df1fafc2c2e5a7da729

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.23-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1dbdc526ea69205a870bd6d1bf2353cde04ee4c06a71a9698f307a6b0db8e2a8
MD5 13b8bff68bd9e5978d3439b5bf1d36a6
BLAKE2b-256 df37b2c9315b2b368259d6af6a6236da4ba6fb586c6e304f5784c6e6b1772dcc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bear_shelf-0.3.23-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 154.4 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.23-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a91a63a0f30ace2b125cfca3b5baf6af0d07ba07d9a84879b7d2bc8bac819a48
MD5 423748deb672d66d5454b567331720a0
BLAKE2b-256 64767b00d8325514ceb6d74c14d75fe36e5705c8351563393bbc997fc4f82592

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.23-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7c1f1d277c7f5bc0fd619d78f51ddda9ade0c661ac887b5c507b20b10a0f49b1
MD5 2fdd913b7fe0f4e61236aef2dd7b8e05
BLAKE2b-256 dc9d1edcb14e783beb598686d984d5f98957788163a197fa4e1a101976f084f7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.23-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e798e16c24b7888034634dfa6fbc506ea532dcb45be3b8acfb22618f2a91981a
MD5 d228e38dfde4f492b7766cf4c9849991
BLAKE2b-256 5d5d32d8fd17290a81d2bfbb3f1458aa0b8d7c2a5c2d91376f7fb00568cd7cdd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bear_shelf-0.3.23-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 154.4 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.23-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 22778b53c02452a94704620db8b3dd957382afcb418fde81828d41b09af9623c
MD5 45eb7ebe2edad97c668785014f96d8fd
BLAKE2b-256 af9471e187c091147afb75882607e602d212b416ba73f73e2f263fbe2b6be0b6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.23-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4417a36f3bc0f44171ebc73a2698b4f22cc3aa0213d872da4ab911a01044df6d
MD5 855ab5946a8f698ef2cb5ba9a4bc11bb
BLAKE2b-256 be726c0f6235e618829f3ecad877ddbd402e378afc4142693920d2830b5b86cb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.23-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e278fa68977fb39858b6dbbadc17183b4ef21276f35d91bd922c9496d95e9964
MD5 d9be7cba1a937822cfbb42cbded33274
BLAKE2b-256 505af0a32948475a46edbbd1b450ffd21b413a64da1682d990e6547e7b4491dc

See more details on using hashes here.

Provenance

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