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_ID = 12345
work_item_fields = azure_requests.call(
# Copy-pasted from https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/update?view=azure-devops-rest-7.0&tabs=HTTP
"PATCH https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.0",
# custom URL parameters
params={
"id": WORK_ITEM_ID,
},
# JSON data
data=[
{
"op": "test",
"path": "/id",
"value": WORK_ITEM_ID,
}
],
# syntactic sugar for azure_requests.call(...)[result_key]
result_key="fields"
)
print(work_item_fields)
For a more detailed example see example.py.
Metadata
Release files for azure_requests 25.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| azure_requests-25.1.tar.gz | 5.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| azure_requests-25.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.2 kB
Release files / azure_requests-25.1.tar.gz
| Download URL | azure_requests-25.1.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01ecfc4e1e022bab65ad194ca67a49075516d27d8ef64b3d47d57a9d0f692843
|
|
BLAKE2b-256 checksum How to use checksums |
e9eed306316267fff04dfe77f5cf6b1f5c443b5f23fda4270e9878f9439cb6fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.13
|
Release files / azure_requests-25.1-py3-none-any.whl
| Download URL | azure_requests-25.1-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
655b9de839b29dbca6857c139db360ea8363f9a5e24af5be1a9bebbfc312845b
|
|
BLAKE2b-256 checksum How to use checksums |
b1efb74da07abdd8448d89a5d9406b1eb314839b1c91dd0cdddd3b4b53ff539d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.13
|
Security for azure_requests 25.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.