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-1.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-1.0.0-py3-none-any.whl (78.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mpt_api_client-1.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-1.0.0.tar.gz
Algorithm Hash digest
SHA256 88959ca2e872e805713d301721b09238cfc37d21ea9e38e9f85dcba60c964e57
MD5 7a866eb1eed42c79c0c63d5f062b31ee
BLAKE2b-256 70777e0f6f25fc0b758c7b509750a6cfdb0d67ca23d3dfc93840ac65998ed793

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpt_api_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f2c32fb4b507541a21a7edeac4b4cce66014cb155baa1de0db0235659490339
MD5 efc24e19b043ab4d691e4bc33377a44f
BLAKE2b-256 62326b7685963b0e594b9cd94154b7e2622a5c0cf8869038a0ed922bae24a07c

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