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

Uploaded CPython 3.14Windows x86-64

bear_shelf-0.3.24-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.24-cp314-cp314-macosx_11_0_arm64.whl (383.0 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

bear_shelf-0.3.24-cp313-cp313-win_amd64.whl (156.2 kB view details)

Uploaded CPython 3.13Windows x86-64

bear_shelf-0.3.24-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.24-cp313-cp313-macosx_11_0_arm64.whl (382.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

bear_shelf-0.3.24-cp312-cp312-win_amd64.whl (156.2 kB view details)

Uploaded CPython 3.12Windows x86-64

bear_shelf-0.3.24-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.24-cp312-cp312-macosx_11_0_arm64.whl (383.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: bear_shelf-0.3.24-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 156.0 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.24-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 ec8869316bc89dfe9b35f87e0dbc2775e3c9086d6c1effb7ff570286703f8385
MD5 fa6a336d730996ebb71a016ef7865a60
BLAKE2b-256 b18c2875e30e7bbe49e2335893c22f93c187f4b0e3bb797bc7f79401f922d1be

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.24-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b92f1f0315a99391d6151ef2d1e54c7419a6ddbd33638b96738a3bf4c4ec01ae
MD5 2b27bbefdc1d1bf679c2ebe31d2f87a3
BLAKE2b-256 bf25d49fb5f65359e2dd5412f2a1a5969a5a2c80c20b9ff525238b7c6cf834a2

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.24-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e2302aaf7a47c17417988303834a835c4fd2e2f51b367c7747f1a43d3c0f5e90
MD5 5f654c4702812ac81656c21e998404b5
BLAKE2b-256 3912d93e4b018904eea6889d297157f9ff0b0b1d3c26ae159a90cdbb86eb63eb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bear_shelf-0.3.24-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 156.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.24-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2995f94cb2105c7fc28fdbdb93ea66854ace1c4212de8895587708e9a96691e8
MD5 96870345374b57110f36aa3e29dae925
BLAKE2b-256 39c3f3d63ebcea72bbd5f216ce5a20ef7454a29885e72fec8e99f448f31127de

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.24-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 190588ed6ecbd6b57639d482f4092b693d4abf498912f89d0cac1d77af5d3aa7
MD5 f8d66740bcd9a60a6ef5ede66ed4e37d
BLAKE2b-256 256006b2c2adad803fbcf1ea2202696053e66a0c992ef8b2204d807243f3ed13

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.24-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 51ffe21db4d1c8425e33d57062d3997a5ff94e83598bc2d0193ed34cda76d609
MD5 31dfb5f0761c67d0fe7053e6d5983162
BLAKE2b-256 bfd077365fb8aec12815bb98bcdcf4365cded019b48c5b4ff943c8af0a775580

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bear_shelf-0.3.24-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 156.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.24-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 b7fa2800375b455ab18971df6021b9d7a5b3c0d82256aedfcdcdbaf5f1d4f3ce
MD5 087a993cd466cba1f10f43697245842c
BLAKE2b-256 1fedbba50f62857ed69b8362a0d75bf6fd6b91a5cb06803fd7ff9e1af8acdb66

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.24-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0bbde0aa7a1385c57daf44896613d2fa0b6860917584df12c2160fe09347e02f
MD5 6eb8cddf3598d05a5d44816856b76104
BLAKE2b-256 177381118d00ce889f1871648c487d35713964d8b66ea10c6a3cacc1efcb4bc8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bear_shelf-0.3.24-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 84f9e37c59b748e0df55c597bdc6c2e476833b0acd998f326dbba56a9f8dbd3e
MD5 5b177e98463d7f24e20b52450fbcf97f
BLAKE2b-256 55a2cf196cf48e69567a36c2407517431f4a53fc789a5d6a9e062aa92ca1953e

See more details on using hashes here.

Provenance

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