Skip to main content

Typed, Pydantic-backed wrappers and Pythonic convenience methods for the Azure DevOps REST API

Project description

pyado — Python bindings for the Azure DevOps REST API

PyPI Status Python Version License Read the Docs Tests Coverage Ruff uv

Typed, Pydantic-backed wrappers and Pythonic convenience methods for the Azure DevOps REST API — no raw dicts, no string parsing, full IDE completion.


pyado exists to make working with Azure DevOps from Python straightforward and pleasant. Every endpoint is available as a thin, typed wrapper, and on top of that a higher-level layer handles the workflows most applications require: iterating paginated results, constructing multi-part requests, diffing branches, linking work items, and more. Authentication, retries, and content-type negotiation are handled transparently — the focus stays on what your code needs to accomplish.

Typing SVG


Quick look

import pyado

api = pyado.ApiCall(
    access_token="<your-pat>",
    url="https://dev.azure.com/<organisation>/<project>/_apis/",
)

# Query work items with WIQL
refs = pyado.post_wiql(api, "SELECT [System.Id] FROM WorkItems WHERE [System.State] = 'Active'")
for item in pyado.iter_work_item_details(api, [ref.id for ref in refs]):
    print(f"#{item.id}  {item.fields['System.Title']}")

# Push a file change programmatically
repo_api = pyado.get_repository_api_call(api, repo_id)
result = pyado.push_commits(
    repo_api,
    ref_updates=[pyado.create_ref_update(repo_api, "main")],
    commits=[pyado.make_commit("chore: update config", [
        pyado.edit_file("/config/settings.json", '{"key": "value"}'),
    ])],
)
print(f"Pushed commit {result.commits[0].commit_id}")

# Create a PR and link a work item
pr = pyado.create_pr(
    repo_api,
    title="Update config",
    source_branch="feature/update-config",
    target_branch="main",
    work_item_ids=[item.id],
)
print(f"PR #{pr.pull_request_id} created")

What you get

  • Full type safety — every function accepts and returns Pydantic models. Bad inputs are caught at construction, not buried in an HTTP 400 response.
  • No boilerplate — authentication, session management, retries, and content type negotiation are handled for you.
  • Automatic pagination — functions that return lists are generators that page through results transparently. skip and top are handled internally.
  • Pythonic convenience methods — common workflows are first-class citizens. Iterate all commits on a branch with a for loop. Create a PR and attach work items in one call. Push file changes without touching git internals. The underlying REST mechanics are abstracted away.
  • Everything covered — work items, pull requests, repositories, git push, builds, pipeline runs, pipeline task callbacks, variable groups, approvals, projects, and user profiles.

Installation

$ pip install pyado

or with uv:

$ uv add pyado

Requires Python 3.11 and an Azure DevOps personal access token (PAT).


Is pyado right for you?

Microsoft also publishes an official azure-devops Python package. See the alternatives comparison for a side-by-side overview to help you decide which package fits your use case.


Further reading


Contributing

Contributions are very welcome. See the Contributor Guide for details.

License

Distributed under the terms of the MIT license. pyado is free and open source software.

Issues

Please file an issue with a detailed description of the problem.

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

pyado-0.3.2.tar.gz (48.6 kB view details)

Uploaded Source

Built Distribution

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

pyado-0.3.2-py3-none-any.whl (59.2 kB view details)

Uploaded Python 3

File details

Details for the file pyado-0.3.2.tar.gz.

File metadata

  • Download URL: pyado-0.3.2.tar.gz
  • Upload date:
  • Size: 48.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pyado-0.3.2.tar.gz
Algorithm Hash digest
SHA256 8da1105ae30051b3a61837e1d369a91aeb2910fa1bbf7fff264f38a84b55bd10
MD5 22af66ed147bd98ee395e6b899278182
BLAKE2b-256 e8a2f2da93e6f359ac9afa2f7894ff6d637539acc7343e7e48f5a5522195c414

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyado-0.3.2.tar.gz:

Publisher: release.yml on FredStober/pyado

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

File details

Details for the file pyado-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: pyado-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 59.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pyado-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4fa90d89a922dddcc002a5d45769cc6b6f15fc5d4bf940fcccb5e36a970e4b3d
MD5 c5ff9d35b73f3a9575a7a232865b023b
BLAKE2b-256 38d40b8c52e4ff95e246ccab610c2baf8996d34e261be823fe74f8a472b9c81e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyado-0.3.2-py3-none-any.whl:

Publisher: release.yml on FredStober/pyado

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