CardTrader-Wrapper-0.3.1
توضیحات
A Python wrapper for the CardTrader API.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX :: Linux |
| نام فایل | CardTrader-Wrapper-0.3.1 |
| نام | CardTrader-Wrapper |
| نسخه کتابخانه | 0.3.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | BuriedInCode <BuriedInCode@tuta.io> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/CardTrader-Wrapper/ |
| مجوز | - |
# CardTrader Wrapper
[](https://pypi.python.org/pypi/CardTrader-Wrapper/)
[](https://pypi.python.org/pypi/CardTrader-Wrapper/)
[](https://pypi.python.org/pypi/CardTrader-Wrapper/)
[](https://opensource.org/licenses/GPL-3.0)
[](https://github.com/pypa/hatch)
[](https://github.com/pre-commit/pre-commit)
[](https://github.com/psf/black)
[](https://pycqa.github.io/isort/)
[](https://github.com/PyCQA/flake8)
[](https://github.com/Buried-In-Code/CardTrader-Wrapper/graphs/contributors)
[](https://github.com/Buried-In-Code/CardTrader-Wrapper/actions/workflows/code-analysis.yaml)
[](https://github.com/Buried-In-Code/CardTrader-Wrapper/actions/workflows/testing.yaml)
[](https://cardtrader-wrapper.readthedocs.io/en/latest/?badge=latest)
A [Python](https://www.python.org/) wrapper for the [CardTrader](https://cardtrader.com) API.
## Installation
### PyPI
1. Make sure you have [Python](https://www.python.org/) installed: `python --version`
2. Install the project from PyPI: `pip install cardtrader-wrapper`
### Github
1. Make sure you have [Python](https://www.python.org/) installed: `python --version`
2. Clone the repo: `git clone https://github.com/Buried-In-Code/CardTrader-Wrapper`
3. Install the project: `pip install .`
## Example Usage
```python
from cardtrader.service import CardTrader
from cardtrader.sqlite_cache import SQLiteCache
session = CardTrader(access_token="Access Token", cache=SQLiteCache())
# List Games
results = session.games()
for game in results:
print(f"{game.id_} | {game.display_name}")
# List Magic: the Gathering Expansions
results = [x for x in session.expansions() if x.game_id == 1]
for expansion in results:
print(f"{expansion.id_} | {expansion.code} - {expansion.name}")
# List Magic: the Gathering - Game Night Cards for sale
blueprints = session.blueprints(expansion_id=1)
for card_blueprint in blueprints:
products = session.products_by_blueprint(blueprint_id=card_blueprint.id_)
for product in products:
print(f"{product.price.formatted} | {card_blueprint.name}")
```
## Socials
[](https://discord.gg/nqGMeGg)
نیازمندی
| مقدار | نام |
|---|---|
| - | pydantic>=1.10.2 |
| - | ratelimit>=2.2.1 |
| - | requests>=2.28.1 |
| xtr | pre-commit>=2.20.0; |
| xtr | mkdocs-include-markdown-plugin>=3.9.1; |
| xtr | mkdocs>=1.4.1; |
| xtr | mkdocstrings[python]>=0.19.0; |
| xtr | pytest-cov>=4.0.0; |
| xtr | pytest>=7.2.0; |
| xtr | tox-pyenv>=1.1.0; |
| xtr | tox>=3.27.0; |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl CardTrader-Wrapper-0.3.1:
pip install CardTrader-Wrapper-0.3.1.whl
نصب پکیج tar.gz CardTrader-Wrapper-0.3.1:
pip install CardTrader-Wrapper-0.3.1.tar.gz