Skip to main content

PyDOGE API is an advanced, Python wrapper for interacting with the public-facing API of the Department of Government Efficiency (DOGE)

Project description

PyDOGE Logo

A Python library to interact with Department of Government Efficiency (DOGE) API.


🧾 Table of Contents
  1. About The Project
  2. Highlights
  3. Getting Started
  4. Usage
  5. Contributors
  6. Acknowledgements

🚀 About The Project

PyDOGE API is an advanced, Python wrapper for interacting with the public-facing API of the Department of Government Efficiency (DOGE) — a federal initiative aimed at increasing transparency and fiscal accountability by sharing detailed datasets on:

  • 💸 Cancelled grants
  • 📑 Contract terminations
  • 🏢 Lease reductions
  • 🧾 Payment transactions

Highlights

  • Retry-safe client with 429 handling
  • Auto-pagination (sync or async)
  • Pydantic models & dict output
  • Async page parallelization (optional)

This package enables data scientists and analysts to programmatically access and analyze the data with ease.

📌 Getting Started

Installation

Install:

pip install pydoge-api

Upgrade:

pip install --upgrade pydoge-api

Documentation

Full developer docs with API reference, usage, and model schema: 👉 Read the Docs (PyDOGE)

📚 Usage

Synchronous Fetching

from pydoge_api import DogeAPI

api = DogeAPI(
    fetch_all=True,             # get all pages
    output_pydantic=False,      # dict output
    handle_response=True,       # parse response
    run_async=False             # ← synchronous mode
)

# Grants sorted by savings
grants = api.savings.get_grants(sort_by="savings")

# Filter payments by agency
payments = api.payments.get_payments(filter="agency", filter_value="NASA")

Asynchronous Pagination

api = DogeAPI(
    fetch_all=True,
    output_pydantic=True,
    handle_response=True,
    run_async=True              # ← enable async parallel fetch
)

grants = api.savings.get_grants(sort_by="value")
print(grants.meta.total_results)

(back to top)

👪 Contributors

All contributions are welcome. If you have a suggestion that would make this better, please fork the repo and create a merge request. You can also simply open an issue with the label 'enhancement'.

Don't forget to give the project a star! Thanks again!

🔶 View all contributors

👏 Acknowledgments

Inspiration, code snippets, etc.

(back to top)

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

pydoge_api-0.1.0.tar.gz (497.9 kB view details)

Uploaded Source

Built Distribution

pydoge_api-0.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydoge_api-0.1.0.tar.gz
  • Upload date:
  • Size: 497.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for pydoge_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 908d6070b658dc953074405433eb57c54d228c693efde96496e047fe7bf6b02f
MD5 37450d5e1270e54fdf6892745c1e4953
BLAKE2b-256 7bd9db407e275ccaccc676f171d6c755ef6ff2edd2578567ea8a025c4572d9f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydoge_api-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for pydoge_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93d7f9a4ab2367cca35c6eef5e1e8ddb10a21fe935ce74e5eeb7eb241cba07c9
MD5 95d3e74b223cfddecdfa365a028ecb64
BLAKE2b-256 80e5b9b2d482c1c3d133b49514b081802f719bf363d2d569932a86ebf237146f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page