CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-beanie

Asynchronous Python ODM for MongoDB with modern Pydantic-based document mapping

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

custom-types.mddocs/

Custom Types

Pydantic-compatible custom field types for MongoDB-specific data types like Decimal128 and Binary.

Capabilities

DecimalAnnotation

DecimalAnnotation: TypeAlias
"""Pydantic annotation for handling BSON Decimal128 types."""

BsonBinary

BsonBinary: TypeAlias
"""Pydantic-compatible BSON binary field type."""

Usage Examples

from beanie import Document, DecimalAnnotation, BsonBinary
from decimal import Decimal

class Product(Document):
    name: str
    price: DecimalAnnotation  # High-precision decimal
    image_data: BsonBinary    # Binary data
    
    class Settings:
        collection = "products"

# Create with custom types
product = Product(
    name="Laptop",
    price=Decimal("1299.99"),
    image_data=b"binary_image_data"
)
await product.insert()

Install with Tessl CLI

npx tessl i tessl/pypi-beanie

docs

bulk-operations.md

custom-types.md

documents.md

events-actions.md

fields-types.md

index.md

initialization.md

migrations.md

query-operations.md

time-series.md

tile.json