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.0.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.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: httpx_sap_launchpad-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 9b2df71b00e3f8ca9f6f4a8a1813a175b4a458d64cebdb2aee23273e6fcb96e6
MD5 be21c27c4057b64e8a326370fa9e8cba
BLAKE2b-256 998384264913e332a4ef26ccb423a34820bf031a442115fc35afc0ba075f896e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for httpx_sap_launchpad-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b0c3105fc3f8de1779f53f32dd540b8b158732c3a74d7965317e884d45dc5a6
MD5 e223f32d45ae84a1480d39cf722d5741
BLAKE2b-256 0ab4f5ef3e0a483373810dfdf1949a641b32672bbece75544f07c39bb60bf8be

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