Skip to main content

AzApi

AzApi is a complementary Python library designed to simplify and unify access to various Azure DevOps services via the REST API.

Status: Early development stage, not all features are implemented yet. The library is under active development and new features are being added regularly.

Current progress and expected features are described in CHANGELOG.md on the repository. All progress can be tracked on the GitHub repository.

Features

AzApi provides a modular, object-oriented interface to the most commonly used Azure DevOps services with logger support:

  • Boards – work items, queries, iterations, and more
  • Repos – repositories, branches, pull requests
  • Agents – agent pools and agents management

Requirements

  • Tested on Python 3.11 and above, lower versions may work but are not guaranteed
  • A Personal Access Token (PAT) with appropriate Azure DevOps permissions

Installation

Clone the repository:

git clone https://github.com/MRosinskiGit/AzureDevopsApi.git

and install dependencies from pyproject.toml or from requirements.txt:

or install directly from PyPi:

pip install azapidevops

Authentication

Authentication is handled via a Personal Access Token (PAT). You will need to provide the token when initializing the main API class and pass it to AzApi class as token attribute.

Usage

See the examples.py file on the repository for practical usage of each module. Short example:

from azapidevops.AzApi import AzApi
from azapidevops.utils.AzApi_boards import WorkItemsDef, WorkItemsStatesDef

api = AzApi(organization="ORGANIZATION_NAME", project="PROJECT_NAME", token="PAT")
api.repository_name = 'REPO_NAME'
api.agent_pool_name = 'POOL_NAME'

task_id = api.Boards.create_new_item(
    WorkItemsDef.Task, item_name="Review Task", description="Review Task for Documentation"
)
api.Boards.change_work_item_state(task_id, WorkItemsStatesDef.Task.Done)
all_branches_list = api.Repos.get_all_branches()
prs = api.Repos.get_active_pull_requests()
pr_id = api.Repos.create_pr("Test PullRequest", "TestBranch", "main", "Testing API Request.")
api.Repos.add_pr_reviewer(pr_id, "user1@gmail.com")

Logging

AzApi supports logging via the standard Python logging module. You can configure the logger to output to a file or console as needed. The library provides detailed logs for API requests and responses, which can be useful for debugging.

Testing

The repository includes both unit and integration tests, located in the ut_AzApi folder and system tests in st_AzApi directory. System tests require systemtest.env with environment variables for Azure DevOps connection (example with required parameters in systemtest.env.template)

For testing install production dependencies:

pip install -r requirements.txt

To run all tests set working directory to main project dir and run:

pytest 

or open terminal in tools as cwd directory and run ./run_test.bat for full unit and system test report with coverage logs.

License

This project is licensed under the Apache License 2.0.

Metadata

Release files for azapidevops 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for azapidevops 0.0.3
File Size Uploaded Provenance
azapidevops-0.0.3.tar.gz 19.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for azapidevops 0.0.3
File Interpreter ABI Platform
azapidevops-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 39.8 kB

Release files / azapidevops-0.0.3.tar.gz

Download URL azapidevops-0.0.3.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cd8ecc3a3139240cae8986e8c7891c499bbd3e9c8f9ac66da7f8d15434227e2f
BLAKE2b-256 checksum
How to use checksums
1c06d5feeacd09a4c85f91aced2cb1b216aa7127e63a856d21812cd2a32403d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / azapidevops-0.0.3-py3-none-any.whl

Download URL azapidevops-0.0.3-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f857ab04433312281c1a57600caf156ba3d8c29db2cb19bdd330305addd05d3b
BLAKE2b-256 checksum
How to use checksums
db3d0fb39f3c6b0ed0ea7203daf7b7ee178de0be57ae9e53a93431edae70b339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for azapidevops 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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