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 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.0.tar.gz (46.7 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.0-py3-none-any.whl (58.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyado-0.3.0.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyado-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0d21272a98401d3064032b9211005bf7a43b6f9bc6df2025a9c3bc7867490e9f
MD5 19fb20e25fa04a26267b71fba603e195
BLAKE2b-256 cd3afa9468f54edee32654e7bcf1ef80c0346b9860b6d565300a1e5531772965

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyado-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 58.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyado-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c22912495cfdf1b5266ecb6e338ab300a27effb49ab9994431349f2e517663e
MD5 998165523e8a3fab268a5ef67abc577f
BLAKE2b-256 c2ee8cd2d16afa23c8d6ad47a8da8171b11401c60b3c2375bb59da9d09325c5d

See more details on using hashes here.

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