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.5.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: azure_requests-23.5.tar.gz
  • Upload date:
  • Size: 4.3 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.5.tar.gz
Algorithm Hash digest
SHA256 8232d8c0ce231fbafb4f49a7f6726fffe4f16ba3e6f7a389df58fb83e899ba42
MD5 52f16551513623148216d0374200d7e5
BLAKE2b-256 65ee08c21c2f7cb3ddc3b3ffa222a6dd97ea321b482d0b37409bf7adb0576dfb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for azure_requests-23.5-py3-none-any.whl
Algorithm Hash digest
SHA256 72492d25db6613fdecdc6eec78ae31e214f8e5a163d34cf1488c8545163a0130
MD5 e5743611a3cd30038cb32dc2b069d42b
BLAKE2b-256 394da6eb998ac42f961cebe5fdd940fca6697a4a55a78cee134370dd924f83ca

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page