Skip to main content

SoftwareOne Marketplace API Client for Python

Project description

mpt-api-python-client

A Python client for interacting with the MPT API.

Installation

Install as a uv dependency:

uv add mpt-api-client
cp .env.example .env

Usage

from mpt_api_client import MPTClient

#client = MPTClient(api_key=os.getenv("MPT_API_KEY"), base_url=os.getenv("MPT_API_URL"))
client = MPTClient() # Will get the api_key and base_url from the environment variables

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=os.getenv("MPT_API_KEY"), base_url=os.getenv("MPT_API_URL"))
    client = AsyncMPTClient() # Will get the api_key and base_url from the environment variables
    async for product in client.catalog.products.iterate():
        print(product.name)

asyncio.run(main())

Development

Clone the repository and install dependencies:

git clone https://github.com/albertsola/mpt-api-python-client.git
cd mpt-api-python-client
uv add -r requirements.txt

Testing

Run all validations with:

make test-all

Run pytest with:

make test-all

License

MIT

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.0.0.tar.gz (39.5 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.0.0-py3-none-any.whl (78.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mpt_api_client-5.0.0.tar.gz
Algorithm Hash digest
SHA256 36cef02d1ee097207ea281509571d3a51f9069d0ee6381483f482f92fd879757
MD5 9d9449f67dbeac43974d43a9811eb530
BLAKE2b-256 cac52a30be6b9f7adf3a72fa19cdc9f24f9011c6a0d2b5a5a243d8ea2e3f3ea0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpt_api_client-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c28f4bed98d63b5cef3bd4e8b6ba89fb2b5a731e7afde0af0be9a0cc6677597
MD5 554bb2a696e3e0c2453ffd13936cacfa
BLAKE2b-256 9bfaf696e4c244c8f97d0e8634de49a5d9f3a372e04430a24bc2a6051b709969

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