Skip to main content

Python wrap for api solana NFT marketplace MagicEden

Project description

Python wrap for api solana NFT marketplace MagicEden

pip install magic-eden-py

Api classes have methods corresponded to endpoints from official docs

How to use?

  1. Import api class
  2. Create class instance
  3. Use methods of class

Important

Method ended with _dirty its clear answer from marketplace
Other methods, contain processed data and correspond to type annotations

Constructor of api class parameters

environment:

  • description: Define environment for api (api-devnet.magiceden.dev, api-mainnet.magiceden.dev)
  • values: 'MAINNET' | 'DEVNET'
  • default: 'MAINNET'

request_kwargs:

  • description: For make requests used python requests package, its parameter for add additional kwargs to requests
  • values: dict
  • default: {'headers': {'ME-Pub-API-Metadata': '{"paging":true}'}}
>>> wallet_api = MagicEdenWalletsApi(
        environment = 'DEVNENT'
        requests_kwargs: dict = None
      )

Also api class instance have request attribute with last request instance

Example

>>> from magic_eden.api import MagicEdenCollectionsApi

>>> magic_eden_api = MagicEdenCollectionsApi()

>>> collections = magic_eden_api.collections()

>>> magic_eden_api.request   
<Response [200]>

You can also import types for annotation

>>> from magic_eden.api.utils.types import MECollectionInfo
>>> from typings import List

>>> collections: List[MECollectionInfo] = []

Official MagicEden api python wrapper classes

>>> from magic_eden.api import (
  MagicEdenTokensApi, 
  MagicEdenWalletsApi, 
  MagicEdenCollectionsApi, 
  MagicEdenLaunchpadApi
)  

python setup.py sdist twine upload dist/*

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

magic-eden-py-0.0.9.tar.gz (8.5 kB view details)

Uploaded Source

File details

Details for the file magic-eden-py-0.0.9.tar.gz.

File metadata

  • Download URL: magic-eden-py-0.0.9.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for magic-eden-py-0.0.9.tar.gz
Algorithm Hash digest
SHA256 8c180447e9c9d9c742d89cab697112e05d4c53b3be732b99aed047d4429bc9d3
MD5 89c960d4573f493977d9b37aab469b85
BLAKE2b-256 648f885b0f6a128a492318ff014283af8e7bb891f9bdf06f71c9641001912891

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