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.1.1.tar.gz (41.2 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.1.1-py3-none-any.whl (92.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mpt_api_client-5.1.1.tar.gz
Algorithm Hash digest
SHA256 3d9b685bb078a87676b31494a01a1e2893c8a6325150d9305ebcffdb2c142a2d
MD5 50f1ed5965f0d7be9b97b2f051c7b493
BLAKE2b-256 01df107bcb9f83189ef854fe7d41b153ab208947dde98de0e0d92b4213677cd6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpt_api_client-5.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a6816d8f146a197463924f8d932d8a7e095dc3a33baee2cd46abbb5824207294
MD5 157ac92e8eed6bb4acef83e513b27dc5
BLAKE2b-256 9a0e030346a539ed8ca486d4e313f6592c83ac66d3a7a3ff6e085c75ee3d5fb5

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