Skip to main content

httpx Authentication for the SAP Launchpad API

Project description

httpx-sap-launchpad

This library provides httpx Authentication for the SAP Launchpad API, primarily focusing on downloading software and files from the SAP Software Download Center and Maintenance Planner.

This library is not affiliated with SAP in any way.

⚠️ Warning: This library is not verified to work as I don't have access to an SAP account anymore. If problems are to be discovered I'd be happy to provide guidance and fixes, but that also means I'd need credentials to replicate the issue.

Install

Install with your package manager of choice:

pip install httpx-sap-launchpad

Usage

SAPLaunchpadAuth extends the httpx.Auth class, so the usage is simple:

import httpx
from httpx_sap_launchpad import URL_LAUNCHPAD, SAPLaunchpadAuth


def main() -> None:
    auth = SAPLaunchpadAuth(
        user_id='S1234567890',
        password='password',
    )
    httpx.get(f'{URL_LAUNCHPAD}/applications/softwarecenter/version.json', auth=auth)


if __name__ == '__main__':
    main()

SAPLaunchpadAuth can be used in conjunction with a Client in order to make use of connection pooling:

import httpx
from httpx_sap_launchpad import URL_LAUNCHPAD, SAPLaunchpadAuth


def main() -> None:
    auth = SAPLaunchpadAuth(
        user_id='S1234567890',
        password='password',
    )
    with httpx.Client(auth=auth) as client:
        client.get(f'{URL_LAUNCHPAD}/applications/softwarecenter/version.json')


if __name__ == '__main__':
    main()

...or the AsyncClient:

import asyncio

import httpx
from httpx_sap_launchpad import URL_LAUNCHPAD, SAPLaunchpadAuth


async def main() -> None:
    auth = SAPLaunchpadAuth(
        user_id='S1234567890',
        password='password',
    )
    async with httpx.AsyncClient(auth=auth) as client:
        await client.get(f'{URL_LAUNCHPAD}/applications/softwarecenter/version.json')


if __name__ == '__main__':
    asyncio.run(main())

Credit

The authorization flow is based on the community.sap_launchpad Ansible collection.

License

MIT - wh!le (whilenot-dev), see LICENSE

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

httpx_sap_launchpad-0.1.1.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

httpx_sap_launchpad-0.1.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file httpx_sap_launchpad-0.1.1.tar.gz.

File metadata

  • Download URL: httpx_sap_launchpad-0.1.1.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for httpx_sap_launchpad-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1bbd93a6acf7bbcae940e6cc783e120cc38d86e801932f240bd384bff1f5d0ab
MD5 e5ad11ed40cbeebb246bfdd120484d45
BLAKE2b-256 cef304ee20d2bd90191ba6f2e214db8bc3523a99077678dbd0d2ba89971a0eff

See more details on using hashes here.

File details

Details for the file httpx_sap_launchpad-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for httpx_sap_launchpad-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81582f1359f019bd9ede213bcd784cc720e9dacfe9cc6b43c4861d26c1ba26c5
MD5 7a8fcde263388014d388351f1d0844a2
BLAKE2b-256 9c84914e9394e5fb5d73dd641d2b8067c1c7002ca4dd0fb8133db9cfdf685c7e

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