Install from PyPI:
pip install python-datastore-sqlalchemyInstall from a local checkout:
uv pip install -e .Runtime dependencies are declared in pyproject.toml. requirements.txt is not used by this project.
from sqlalchemy import create_engine, text
engine = create_engine(
"datastore://my-project/?database=my-db",
credentials="path/to/credentials.json",
)
with engine.connect() as conn:
result = conn.execute(text("SELECT * FROM test_table"))
print(result.fetchall())Warning
Please note: Not all GQL and SQL syntax has been fully tested. Should you encounter any bugs, please post the relevant query and open an issue on GitHub.
Feel free to open issues and pull requests on GitHub.
This project supports Python 3.10 and newer. It uses a uv-managed virtual environment by default. The lockfile is tracked so local development and CI use the same dependency resolution.
Install the development environment:
uv sync --lockedRun the test suite:
uv run pytestThe Datastore-backed tests require the Google Cloud SDK with the beta and cloud-datastore-emulator components installed. If gcloud is not on PATH, point the test fixture at it explicitly:
GCLOUD_PATH=/path/to/google-cloud-sdk/bin/gcloud uv run pytest