Skip to main content

Magento 2 API Package

Overview

This package provides an interface for interacting with the Magento 2 API, allowing you to perform various operations such as logging in, making API requests, and handling data. It is designed to simplify interactions with the Magento 2 API by managing authentication and making HTTP requests.

Features

  • User authentication with Magento 2 API
  • Making various types of API requests (GET, POST, PUT, DELETE)
  • Token-based session management
  • Handling API responses and errors

Installation

To use this package, you need to have Python installed on your system. Install the package using pip:

pip install magento-2

Alternatively, clone the repository and install it manually:

git clone https://github.com/Gunn1/Magento-2-API.git cd Magento-API pip install .

Usage

Authentication

The LoginController class handles user authentication and manages the login session. Here's how you can use it:

`from magento_2 import magento.LoginController, magento.Magento

Initialize the LoginController with your Magento credentials

login_controller = LoginController(username='your_username', password='your_password')

Log in to Magento

login_controller.login()

Check if the user is logged in

if login_controller.is_logged_in(): print("User is logged in.") else: print("User is not logged in.")`

Making API Requests

Once authenticated, you can make API requests using the Magento class. Here's an example:

`from magento_2 import magento.Magento

Initialize the Magento class with the LoginController

magento = Magento(login_controller=login_controller)

Make a GET request to the API

response = magento.make_api_request( endpoint='https://your-magento-store.com/rest/V1/orders', request_type='get' )

print(response)`

Contributing

Contributions are welcome! Please submit a pull request or open an issue to report bugs or request new features.

License

This package is licensed under the MIT License. See the LICENSE file for more details.

Contact

For questions or support, please contact tylerjgunn@gmail.com.

Metadata

Release files for magento-2 0.0.6

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

Source distribution (sdist)

Source distribution for magento-2 0.0.6
File Size Uploaded Provenance
magento_2-0.0.6.tar.gz 29.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for magento-2 0.0.6
File Interpreter ABI Platform
magento_2-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 57.5 kB

Release files / magento_2-0.0.6.tar.gz

Download URL magento_2-0.0.6.tar.gz
Size 29.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1125ec80f3fb9614f8f8ff8323f995bf49e3d94a316a6bfe9711dbc86e28c5b5
BLAKE2b-256 checksum
How to use checksums
141ee67ec66ca8b688ff229883a50f35e19f592aadfef17f43e863d472a84452
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / magento_2-0.0.6-py3-none-any.whl

Download URL magento_2-0.0.6-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
191ee8de9507c50a6c02cea9bc94b180fefd8e862935e41a3c8efa139ad8e708
BLAKE2b-256 checksum
How to use checksums
63d96149f78ce287765647ec695cd54783724254269da1361e97c12a600ff3fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Security for magento-2 0.0.6

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.

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