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']}")

# Create a PR and link a work item
repo_api = pyado.get_repository_api_call(api, repo_id)
pr = pyado.create_pr(
    repo_api,
    title="Add telemetry",
    source_branch="feature/telemetry",
    target_branch="main",
    work_item_ids=[item.id],
)
print(f"PR #{pr.pull_request_id} created")

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

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.2.2.tar.gz (37.8 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.2.2-py3-none-any.whl (48.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyado-0.2.2.tar.gz
  • Upload date:
  • Size: 37.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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.2.2.tar.gz
Algorithm Hash digest
SHA256 92bcc0af22693f2f8784cde101cc0347ead4a7796fcbb507e6af39ce0be22ebb
MD5 50a7a0a1401bf1b3a7302766e54906b1
BLAKE2b-256 d27c730ba26855496af512496c64e359e42f95c1f658a5ec017e1df8f6c4243d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyado-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 48.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","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.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9182462d1c930c3d86c4567925e004e7121b1cdc3a77a0a3dc7d8949123bddbc
MD5 6e841bdae36c7072e2c5bd86415ff62b
BLAKE2b-256 f93055ec88c8fb71add26e439c48f7367ab61c2c85fb4e74ff4c8990914b4b6c

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