Skip to main content

A modern, fully-typed Python ODM for Google Cloud Datastore.

Project description

Google Cloud Datastore ODM

CI/CD Coverage

Google Cloud Datastore ODM is a modern, fully-typed Python library that brings the beloved developer experience of App Engine's NDB to the modern Datastore SDK. Built for Python 3.10+, it bridges the gap between raw API calls and enterprise-grade application development. It features a declarative property system, intuitive AST-based query building, and intelligent, context-aware ACID transactions with automatic concurrency retries.

Documentation

https://trebbble.github.io/google-cloud-datastore-odm/


Local Setup & Dependencies

The project uses uv for lightning-fast dependency management.

# Install the package in editable mode along with all dev dependencies
uv sync
# or use makefile commands
make setup

Local emulators

# Start all emulators in the background
docker compose -f docker-compose.yml up -d --build

# Tear down and wipe data
docker compose -f docker-compose.yml down --volumes
  • Environment variables to connect to emulators

    • Datastore dev emulator - make sure to set them up in case of local dev; see .env.example:

      DATASTORE_EMULATOR_HOST=localhost:10000
      GOOGLE_CLOUD_PROJECT=google-cloud-datastore-odm-dev
      
    • Datastore tests emulator - hardcoded already in test suite:

      DATASTORE_EMULATOR_HOST=localhost:10001
      GOOGLE_CLOUD_PROJECT=google-cloud-datastore-odm-test
      
  • Datastore emulator user interface at localhost:10002

Running examples, testing & linting

# Start all emulators in the background
docker compose -f docker-compose.yml up -d --build
# or start only datastore container dedicated for testing
docker compose -f docker-compose.yml up -d --build datastore-test

# run examples from examples folder
uv run python examples/01_properties.py

# run tests with uv
uv run pytest 
# or use makefile commands
make test

# Run tests with coverage and generate an XML report
uv run pytest --cov=google_cloud_datastore_odm --cov-report=xml --cov-report=term-missing
# or use makefile commands
make test-cov

# Run the linter & formatter
uv run ruff check
# or use makefile commands
make lint
# for autofixes
uv run ruff check --fix

Local docs:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google_cloud_datastore_odm-0.1.0.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

google_cloud_datastore_odm-0.1.0-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file google_cloud_datastore_odm-0.1.0.tar.gz.

File metadata

File hashes

Hashes for google_cloud_datastore_odm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5a251e35a19fa17bd538e1dbf6881fdf873d3d18cad8bb9eba0d5dbd179fccd9
MD5 3e26f2d2191d4aad44cfe7e9c04cc003
BLAKE2b-256 d317b36c5332d3d006fc0e782ee034f690118b69a8dbdc0a05b53c892225202e

See more details on using hashes here.

Provenance

The following attestation bundles were made for google_cloud_datastore_odm-0.1.0.tar.gz:

Publisher: ci_cd.yml on trebbble/google-cloud-datastore-odm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file google_cloud_datastore_odm-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for google_cloud_datastore_odm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcb75c013f88941d1da6fd7cd86440f1fdefd09cc6da3281c4a8acf5a3d7d032
MD5 e2e1ea5c8e8d76a14a178c7a89037c41
BLAKE2b-256 1af6b5db8ca5b312cd524452ffa46a88a3fe77b8c3b9f9c0011b696b27679369

See more details on using hashes here.

Provenance

The following attestation bundles were made for google_cloud_datastore_odm-0.1.0-py3-none-any.whl:

Publisher: ci_cd.yml on trebbble/google-cloud-datastore-odm

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