Requests wrapper for Azure DevOps
Project description
Azure requests
Just a wrapper around Python requests module for communicating with Azure DevOps.
DRY (don't repeat yourself) features
- Authentication
- Replace organization, project, and team in URL, so URLs can be copy-pasted from the documentation
- Handle rate limit
- Handle ADO temporary server errors
- Set appropriate Content-Type headers
- Parse JSON automatically
- Raise exception for wrong HTTPS statuses
Rationale
Azure DevOps has an excellent HTTPS API with an excellent documentation. It is easy to understand and easy to use. For smaller scripts and projects it is easier to use them as is. Every existing API implementations have many documentation issues.
Example
from azure_requests import AzureRequests
azure_requests = AzureRequests(
pat="<YOUR PAT>",
organization="<YOUR ORGANIZATION>",
)
work_item = azure_requests.api(
# Copy-pasted from https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/get-work-item?view=azure-devops-rest-7.0&tabs=HTTP
"GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.0",
# custom URL parameters
id=12345,
).request()
print(work_item)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
azure_requests-23.3.tar.gz
(4.1 kB
view details)
Built Distribution
File details
Details for the file azure_requests-23.3.tar.gz
.
File metadata
- Download URL: azure_requests-23.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f00d40d47810a03b97a183284fdac5cab127a7503b345a98f9e36b314c90b496 |
|
MD5 | 96424e7446cce0a6b989bf228f0829bd |
|
BLAKE2b-256 | 02cda17f414074188892b5fcb12acc27889bd0355c683d8b36457b78e079c3c1 |
File details
Details for the file azure_requests-23.3-py3-none-any.whl
.
File metadata
- Download URL: azure_requests-23.3-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae37024c3a48b9a5cafacf716065a0cb6bb36f8ebb233260b1b4450749308dbf |
|
MD5 | c2a71bd666edfe8522eaabc53648f336 |
|
BLAKE2b-256 | 2be8d8d99a0b89d3309d4155b87ab050b83e5b900ec4e1fd9968b95e3415f80d |