tcgplayer-python is a Python wrapper to interact with the TCGPlayer APIs in a straight-forward way.
NOTE: The Store API is not implemented.
- Fork the repo, and clone your fork
- Find an issue to work on or create an issue to propose changes
- Make changes to fork
- Tag @rsfxiii in the PR to have it reviewed
tcgplayer-python requires at least Python 3.7
- Install the package:
pip install tcgplayer-python - Edit the
.envfile and add your TCGPlayer API credentials:
# .env
PUB_KEY=my-tcg-pubkey
PRIV_key=my-tcg-privkey
At this point, you should be ready to use the Client to make calls to whatever TCG Player API endpoints you want.
# Import the resource endpoint you want to use
from tcgplayer.api.endpoints import Category
# Refresh your access token for the session
access_token = Client.refresh_access_token()
# Make an API call to TCGPlayer
all_categories = Client.handle_request('GET', Category.list(), {}, access_token)
# Make a call with path params
specific_category = Client.handle_request('get', Category.get_details(1), {}, access_token)
# Make a call with both path and query params
category_groups = Client.handle_request('get', Category.get_groups(1), {'limit': 10}, access_token)
NOTE: Endpoint methods, like
Category.get_detailswill accept path params, whileClient.handle_requestwill accept query params.
-
Write a maintainable, clean, and tested Python library:
- Adhere to PEP8 Style Guide for Python
- Pair features with reasonable, effective unit tests
- Lint, document, and distribute the package
-
Retrieve data from the TCGPlayer API:
- Implement Class-based representation of the TCG Player API structure
- Top-Level Endpoints: App, Catalog, Inventory, Prices
- Implement Class-based representation of the TCG Player API structure