PyEDHRec
Overview
This is a python wrapper around the excellent EDHREC website. Currently, EDHREC does not provide an API so the intent of this library is to enable people to build automated tooling around the useful information EDHREC provides.
Installation
This package is available on PyPI and can be installed with pip
pip install pyedhrec
Usage
Create an instance of the edhrec client
from pyedhrec import EDHRec
edhrec = EDHRec()
# Reference cards by the exact card name, the library will format as needed
miirym = "Miirym, Sentinel Wyrm"
# Get basic card details
details = edhrec.get_card_details(miirym)
# Get details for a list of cards
card_list = edhrec.get_card_list(["Pongify", "Farseek"])
# Get an edhrec.com link for a given card
miirym_link = edhrec.get_card_link(miirym)
# Get combos for a card
miirym_combos = edhrec.get_card_combos(miirym)
# Get commander data
miirym_commander_data = edhrec.get_commander_data(miirym)
# Get cards commonly associated with a commander
miirym_cards = edhrec.get_commander_cards(miirym)
# Get the average decklist for a commander
miirym_avg_deck = edhrec.get_commanders_average_deck(miirym)
# Get known deck lists for a commander
miirym_decks = edhrec.get_commander_decks(miirym)
# This library provides several methods to get specific types of recommended cards
new_cards = edhrec.get_new_cards(miirym)
high_synergy_cards = edhrec.get_high_synergy_cards(miirym)
# Get all top cards
top_cards = edhrec.get_top_cards(miirym)
# Get specific top cards by type
top_creatures = edhrec.get_top_creatures(miirym)
top_instants = edhrec.get_top_instants(miirym)
top_sorceries = edhrec.get_top_sorceries(miirym)
top_enchantments = edhrec.get_top_enchantments(miirym)
top_artifacts = edhrec.get_top_artifacts(miirym)
top_mana_artifacts = edhrec.get_top_mana_artifacts(miirym)
top_battles = edhrec.get_top_battles(miirym)
top_planeswalkers = edhrec.get_top_planeswalkers(miirym)
top_utility_lands = edhrec.get_top_utility_lands(miirym)
top_lands = edhrec.get_top_lands(miirym)
Caching
To avoid excessive requests to edhrec.com this library uses in-memory caching for card retrieval methods. Each time you run a script using this library we'll cache the results for any given card. If you request the card again during the same execution we will use the cached value until the cache expires (defaults to 24 hours). If you use a long running script know that card data will only be updated once a day. Due to the nature of the game not changing often this should normally not cause issues and will help alleviate excessive traffic to EDHREC servers.
Metadata
Release files for pyedhrec 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyedhrec-0.0.2.tar.gz | 10.3 kB | Without provenance | Details for pyedhrec-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyedhrec-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for pyedhrec-0.0.2-py3-none-any.whl |
Total release size: 20.1 kB
Release files / pyedhrec-0.0.2.tar.gz
| Download URL | pyedhrec-0.0.2.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5bc20eccbdc2182a779a03f7a904168fd406f746afc2e6814d6f489d0d5dfb1e
|
|
BLAKE2b-256 checksum How to use checksums |
c47778aeece0f3251f2bfa72f75fa693f51c9d05c9067adcac559957d9f8b348
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / pyedhrec-0.0.2-py3-none-any.whl
| Download URL | pyedhrec-0.0.2-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5284ec3b8308294adf62771f5ec79ffde4b0de2c5fd5fea2e36219612859bbc4
|
|
BLAKE2b-256 checksum How to use checksums |
5428d416004fd044e95eb4dadd3057106b238b3e31d8dc220aca7ca70a0bfac0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Security for pyedhrec 0.0.2
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.