Skip to main content

PyMagento

PyPI version PyPI downloads

PyMagento is a Python client for the Magento 2 API. Its goal is to provide an easy-to-use Pythonic interface to the Magento 2 API, while being lightweight and extendable.

Features:

  • Lightweight: entities are returned as plain dictionaries; there is no custom Order or Product class
  • Easy to extend: subclass magento.Magento and add your own methods
  • Transparent pagination: functions that make paginated queries return lazy iterables (generators)
  • Fully typed: all functions have type hints
  • Production-ready: at Bixoto, we use PyMagento in production since 2020
  • Python 3.10+ support
  • MIT license

Note: PyMagento is not affiliated to nor endorsed by Adobe or the Magento team.

Install

Pip

python -m pip install pymagento

uv

uv add pymagento

Poetry

poetry add pymagento

Usage

import magento

# To get a token, create an integration and copy the "Access Token"
client = magento.Magento(base_url="...", token="...", scope="all")

product = client.get_product("SKU123")
print(magento.get_custom_attribute(product, "description"))

# Get orders by status
for order in client.get_orders(status="processing"):
    print(order["increment_id"], order["grand_total"])

# Make more complex queries
query = magento.make_search_query([
    [("customer_email", "billgates@example.com", "eq")],
    [("status", "complete", "eq")],
])

for order in client.get_orders(query=query, limit=10):
    print(order["increment_id"], len(order["items"]))

For more information, read the docs.

Note: not all endpoints are implemented with dedicated methods. You can call them with client.get_json_api("/V1/...") for GET endpoints and client.post_json_api("/V1/...", json=...).

License

Copyright 2020-2026 Bixoto. See the LICENSE.

Other projects

Metadata

Release files for pymagento 2.16.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymagento 2.16.0
File Size Uploaded Provenance Actions
pymagento-2.16.0.tar.gz 28.4 kB Without provenance Details for pymagento-2.16.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pymagento 2.16.0
File Interpreter ABI Platform Actions
pymagento-2.16.0-py3-none-any.whl Python 3 none any Details for pymagento-2.16.0-py3-none-any.whl

Total release size: 58.8 kB

Release files / pymagento-2.16.0.tar.gz

Download URL pymagento-2.16.0.tar.gz
Size 28.4 kB
Tags Source
SHA-256 checksum
How to use checksums
aab1cd100f88073fb31792b109bbd72aa2c88fbded4a3d74180f7d9c06d4cd7c
BLAKE2b-256 checksum
How to use checksums
4f7ea5df0b5965d2fa3e1e6fc583ded50bb22a557060799b8f354a76cf39bfa5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pymagento-2.16.0-py3-none-any.whl

Download URL pymagento-2.16.0-py3-none-any.whl
Size 30.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88f9a6cbb0168b4eecc4466262d59cac8063d681dc79fac81e04dff41a6b4b5d
BLAKE2b-256 checksum
How to use checksums
ebe6b1686a2cf83bddb6454eacb616926846e6acffba92c38c9c03893aeb3504
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pymagento 2.16.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.16.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page