Skip to main content

SoftwareOne Marketplace API Client for Python

Project description

mpt-api-python-client

mpt-api-python-client is a Python client for interacting with the MPT API

Installation

Install with pip or your favorite PyPI package manager:

pip install mpt-api-client
uv add mpt-api-client

Prerequisites

  • Python 3.12+ in your environment

Usage

from mpt_api_client import MPTClient

# client = MPTClient(api_key=<your_api_key>, base_url=<mpt_api_url>)
client = MPTClient() # Reads MPT_API_TOKEN and MPT_API_BASE_URL from the environment

for product in client.catalog.products.iterate():
    print(product.name)

Async Usage

import asyncio
from mpt_api_client import AsyncMPTClient

async def main():
    # client = AsyncMPTClient(api_key=<your_api_key>, base_url=<mpt_api_url>)
    client = AsyncMPTClient() # Reads MPT_API_TOKEN and MPT_API_BASE_URL from the environment
    async for product in client.catalog.products.iterate():
        print(product.name)

asyncio.run(main())

Development

For development purposes, please, check the Readme in the GitHub repository.

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

mpt_api_client-5.2.0.tar.gz (41.3 kB view details)

Uploaded Source

Built Distribution

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

mpt_api_client-5.2.0-py3-none-any.whl (92.1 kB view details)

Uploaded Python 3

File details

Details for the file mpt_api_client-5.2.0.tar.gz.

File metadata

  • Download URL: mpt_api_client-5.2.0.tar.gz
  • Upload date:
  • Size: 41.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.22

File hashes

Hashes for mpt_api_client-5.2.0.tar.gz
Algorithm Hash digest
SHA256 c145d391b1339861d64b2235668c520ed070a26f86f91405c8299939b751c9e7
MD5 05dc2191e850d012637dc887852be7bb
BLAKE2b-256 700786a4d59c4e44f49299449012da69bbeb4d2d6736db838ee9da4f34a6c4fe

See more details on using hashes here.

File details

Details for the file mpt_api_client-5.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mpt_api_client-5.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b0348d8f06481b21ce0385473ddf43d864afdef08ec98b0be407bfbb7e78acc
MD5 d602ec71b4eff9f4b460360dda194280
BLAKE2b-256 346d27136754f367ba0044c994adb093781d28f587d04898a6db7154ca42f77a

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