MyMagento πŸ›’οƒ

MyMagento: Magento 2 REST API wrapper

MyMagento

A Python package that wraps and extends the Magento 2 REST API

Explore the docs Β»

PyPI Version GitHub Repository https://static.pepy.tech/personalized-badge/my-magento?period=total&units=none&left_color=grey&right_color=blue&left_text=Downloads Documentation Status


About MyMagento

What’s MyMagento?

MyMagento is a highly interconnected package that wraps and extends the Magento 2 REST API, providing a more intuitive and user-friendly interface to access and update your store.

MyMagento simplifies interaction with the Magento 2 REST API

If you’ve worked with the Magento 2 API, you’ll know that not all endpoints are created equally.

MyMagento aims to streamline your workflow, offering a number of methods for common API operations.

Main Components

The Client

  • Handles all API interactions

  • Supports multiple store views

  • Provides access to all other package components

The Model Subclasses

  • Wrap all API responses in the package

  • Provide additional endpoint-specific methods to retrieve and update data

…

Installation

Installing MyMagento

To install using pip:

pip install my-magento

Please note that MyMagento requires Python >= 3.10

…

QuickStart: Login with MyMagento

Use the credentials of your Magento 2 admin account to initialize and authenticate() a Client

from magento import Client

>>> api = Client('website.com','username', 'password', login=False)
>>> api.authenticate()

|[ MyMagento | website_username ]|:  Authenticating username on website.com...
|[ MyMagento | website_username ]|:  Logged in to username

Once you initialize a Client, you have a few ways to start interacting with the api

…