Skip to main content

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)

For a more detailed example see example.py.

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

azure_requests-23.4.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

azure_requests-23.4-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file azure_requests-23.4.tar.gz.

File metadata

  • Download URL: azure_requests-23.4.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for azure_requests-23.4.tar.gz
Algorithm Hash digest
SHA256 3b102e3c45e32fa6715ace927c756c72d9f3bcc7fe166137469d898308bc8d8b
MD5 9976fd84c78e47a54aceaeb431b393a1
BLAKE2b-256 7630fd03a31d5062d766ba752620fa702ee8b4770015fdf15cd76fecc1b46d43

See more details on using hashes here.

File details

Details for the file azure_requests-23.4-py3-none-any.whl.

File metadata

  • Download URL: azure_requests-23.4-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for azure_requests-23.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2dc59f5a23232f964170c516f3a12dd81ccd19266540886f6d2a2b6c20069b20
MD5 319368747157a1196a3206cea666404a
BLAKE2b-256 b089334c82a801130affef9686bddb7f855116cb5ba4f22f94b208da9da287b4

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