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-2025 Bixoto. See the LICENSE.

Other projects

Metadata

Release files for pymagento 2.14.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.14.0
File Size Uploaded
pymagento-2.14.0.tar.gz 26.3 kB Details

Built distribution (wheel)

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

Total release size: 55.2 kB

Release files / pymagento-2.14.0.tar.gz

Download URL pymagento-2.14.0.tar.gz
Size 26.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3ff7cb7ffa0ff4fe532f8c20074970bb57b88a254de7cd2f6923dcace99a75ad
BLAKE2b-256 checksum
How to use checksums
3c53a2b732e40f45babc867e542d5cd90f775472c95f78e35d7f57a5c3dde58e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","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.14.0-py3-none-any.whl

Download URL pymagento-2.14.0-py3-none-any.whl
Size 28.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
296c4df3e66f2a02607373b887a3ef9a29de619bc183bcb01705b27f16d46e9f
BLAKE2b-256 checksum
How to use checksums
27f58cf258e3cd8a67e557984c8b26077c4d4947aa7ee83a1d19454b1d3a3fff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","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 history Release notifications | RSS feed

This release

2.14.0 This release

2 release files

2.13.0

2 release files

2.9.0

2 release files

2.8.1

2 release files

2.8.0

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.11.6

2 release files

1.11.5

2 release files

1.11.4

2 release files

1.11.3

2 release files

1.11.0

2 release files

1.10.3

2 release files

1.10.2

2 release files

1.10.0

2 release files

1.9.3

2 release files

1.9.2

2 release files

1.9.1

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.4

2 release files

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

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