Skip to main content

🐦 drongo

Mock Google Cloud Platform services in your tests - the moto for GCP.

CI License: Apache 2.0 Python 3.10+ Typed

Documentation


drongo lets you test code that talks to Google Cloud without touching the network, running an emulator, or paying for real resources. It stands up an in-memory, in-process fake of GCP service APIs and transparently intercepts the requests your google-cloud client libraries make.

If you've used moto for AWS, drongo will feel immediately familiar - that's on purpose.

Installation

pip install drongo

drongo does not depend on the google-cloud client libraries - you bring your own (google-cloud-storage, google-cloud-secret-manager, …). It mocks whatever you already use.

Quickstart

from drongo import mock_gcp


@mock_gcp
def test_upload_download():
    from google.cloud import storage

    client = storage.Client(project="my-project")
    bucket = client.create_bucket("my-bucket")

    bucket.blob("hello.txt").upload_from_string("hello drongo")

    assert bucket.blob("hello.txt").download_as_text() == "hello drongo"
    assert [b.name for b in client.list_blobs("my-bucket")] == ["hello.txt"]

No credentials, no network, no emulator. storage.Client() works with or without arguments - drongo supplies anonymous credentials and a default project while a mock scope is active. It also works as a called decorator, a context manager, a class decorator, or a unittest.TestCase mixin, and ships an auto-registered drongo pytest fixture - see the Quickstart guide.

Features

  • 🎯 One decorator - @mock_gcp patches every supported service, just like @mock_aws.
  • 🔌 Flexible - decorator, context manager, class decorator, or unittest.TestCase mixin.
  • 🧠 In-memory & fast - no Docker, no emulators, no sockets; tests run in milliseconds.
  • 🧬 Default clients, unchanged - drongo handles gRPC-first services behind the scenes.
  • 🏃 Runs your code - opt-in executable handlers actually run your Python when a job runs, a task dispatches, or a message publishes.
  • 🌐 Standalone server - drongo server speaks real HTTP so SDKs in any language can point at it.
  • 🧪 pytest-native - a drongo fixture is auto-registered on install.
  • 🧩 Extensible - adding a service is models.py + responses.py + urls.py, the same shape as moto.
  • Typed - ships py.typed, checked with mypy.

Supported services

Service Transport Docs
Cloud Storage JSON API (default) guide
Secret Manager gRPC (default, forced to REST) guide
Pub/Sub gRPC (default, via emulator) guide
BigQuery REST/JSON (default) guide
Cloud Tasks gRPC (default, forced to REST) guide
Cloud Run Jobs gRPC (default, forced to REST) guide
Resource Manager gRPC (default, forced to REST) guide
Firestore gRPC (default, via emulator) guide
Datastore gRPC (default, via emulator) guide
Bigtable gRPC (default, via emulator) guide
IAM & Service Accounts gRPC only (via injected transport) guide
Cloud Logging gRPC only (via injected transport) guide
Cloud KMS gRPC (default, forced to REST) guide
Cloud Scheduler gRPC (default, forced to REST) guide
Cloud Functions gRPC (default, forced to REST) guide
Memorystore (Redis) gRPC (default, forced to REST) guide

Full capability matrix: Supported services. You can also fill the mocks with realistic Faker data, or run drongo as a standalone HTTP server for non-Python SDKs.

How it works

drongo mirrors moto's architecture, adapted from AWS/botocore to GCP's REST+JSON APIs: HTTP services ship a models.py / responses.py / urls.py trio behind the responses interception layer, gRPC-first services run against an in-process emulator or a forced-REST transport, and state is sharded through a BackendDict keyed by project. See the Architecture tour for the full picture.

Roadmap

Available (8 services): Cloud Storage, Secret Manager, Pub/Sub, BigQuery, Cloud Tasks, Cloud Run Jobs, Resource Manager, Firestore - plus executable handlers, Faker seeding, and a standalone server.

Next up: Cloud Logging, Cloud KMS, IAM / Service Accounts, Cloud Scheduler, Cloud Functions, Datastore mode. See the full, tiered roadmap (services + capabilities, and how drongo compares to moto).

Want one sooner? Open an issue or contribute it.

Contributing

Contributions are very welcome! Adding a service is a great first PR. Start with CONTRIBUTING.md and the contributing-a-service guide.

git clone https://github.com/proxyroot/drongo
cd drongo
make install   # editable install + dev tools
make check     # ruff + mypy + pytest

License

Apache License 2.0 - the same license as moto.

Acknowledgements

drongo is heavily inspired by moto and owes its design to that project. It is not affiliated with or endorsed by Google or the moto maintainers.

Download files

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

Source Distribution

drongo-0.7.0.tar.gz (100.8 kB view details)

Uploaded Source

Built Distribution

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

drongo-0.7.0-py3-none-any.whl (125.3 kB view details)

Uploaded Python 3

File details

Details for the file drongo-0.7.0.tar.gz.

File metadata

  • Download URL: drongo-0.7.0.tar.gz
  • Upload date:
  • Size: 100.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for drongo-0.7.0.tar.gz
Algorithm Hash digest
SHA256 61745d272e52339a7136d3a507bdbcbdef783695885b0a10a53357071fc04ff3
MD5 4d5f64bea98302a5ff10142ce08c7934
BLAKE2b-256 9848bbeae6b8516d3de448117bd8d466a82c0a7eda46ed26b2b81fa4c6d601fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for drongo-0.7.0.tar.gz:

Publisher: release.yml on proxyroot/drongo

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

File details

Details for the file drongo-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: drongo-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 125.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for drongo-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2233a340487bf00c0a4bd738c05541b60ce9bf4689eb7367c2c315da62bcf37d
MD5 8e9c6be7b385db41e29546ae4c8b57ab
BLAKE2b-256 3641a77d50bede677da0220422a110a713611e2ceec19ee7c921d8d7e57fa94f

See more details on using hashes here.

Provenance

The following attestation bundles were made for drongo-0.7.0-py3-none-any.whl:

Publisher: release.yml on proxyroot/drongo

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

Release history Release notifications | RSS feed

0.8.0

2 files

This release

0.7.0 This release

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page