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.6.tar.gz (4.4 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.6-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for azure_requests-23.6.tar.gz
Algorithm Hash digest
SHA256 287503b2cce3bd1e4a43e6b260961bcfe7dc72e68f7bfedb940f1c86761ae630
MD5 b86470e98669b41c5f4c8e51c006a0f9
BLAKE2b-256 deecce9b088ceca62c7e5628f2bbbbc390d3eed3e13ee7005bac116b25856e61

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for azure_requests-23.6-py3-none-any.whl
Algorithm Hash digest
SHA256 364f93df289e2fcc2343df2c6e0ebc456f575967eab3723783d9015c64dcbde2
MD5 c027121711d6f18293604fe70d367923
BLAKE2b-256 a4158f27a78c8226aad0474f40eb37046b1e7686d64ca448c3ae68f91374808a

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