pyedhrec


Namepyedhrec JSON
Version 0.0.2 PyPI version JSON
download
home_page
SummaryA simple package to interact with the excellent EDHRec site for Magic the Gathering
upload_time2024-02-03 18:27:44
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords magic mtg edhrec magic the gathering edh
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyEDHRec

## Overview
This is a python wrapper around the excellent [EDHREC](https://edhrec.com/) 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
```bash
pip install pyedhrec
```

## Usage
Create an instance of the edhrec client
```python
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.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pyedhrec",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "magic,mtg,edhrec,magic the gathering,edh",
    "author": "",
    "author_email": "Stainedhat <stainedhat@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/c4/77/78aeece0f3251f2bfa72f75fa693f51c9d05c9067adcac559957d9f8b348/pyedhrec-0.0.2.tar.gz",
    "platform": null,
    "description": "# PyEDHRec\n\n## Overview\nThis is a python wrapper around the excellent [EDHREC](https://edhrec.com/) website. Currently, EDHREC does not provide an API \nso the intent of this library is to enable people to build automated tooling around the useful information EDHREC provides.\n\n## Installation\nThis package is available on PyPI and can be installed with pip\n```bash\npip install pyedhrec\n```\n\n## Usage\nCreate an instance of the edhrec client\n```python\nfrom pyedhrec import EDHRec\n\n\nedhrec = EDHRec()\n\n# Reference cards by the exact card name, the library will format as needed\nmiirym = \"Miirym, Sentinel Wyrm\"\n\n# Get basic card details\ndetails = edhrec.get_card_details(miirym)\n\n# Get details for a list of cards\ncard_list = edhrec.get_card_list([\"Pongify\", \"Farseek\"])\n\n# Get an edhrec.com link for a given card\nmiirym_link = edhrec.get_card_link(miirym)\n\n# Get combos for a card\nmiirym_combos = edhrec.get_card_combos(miirym)\n\n# Get commander data \nmiirym_commander_data = edhrec.get_commander_data(miirym)\n\n# Get cards commonly associated with a commander\nmiirym_cards = edhrec.get_commander_cards(miirym)\n\n# Get the average decklist for a commander\nmiirym_avg_deck = edhrec.get_commanders_average_deck(miirym)\n\n# Get known deck lists for a commander\nmiirym_decks = edhrec.get_commander_decks(miirym)\n\n# This library provides several methods to get specific types of recommended cards\nnew_cards = edhrec.get_new_cards(miirym)\nhigh_synergy_cards = edhrec.get_high_synergy_cards(miirym)\n\n# Get all top cards\ntop_cards = edhrec.get_top_cards(miirym)\n\n# Get specific top cards by type\ntop_creatures = edhrec.get_top_creatures(miirym)\ntop_instants = edhrec.get_top_instants(miirym)\ntop_sorceries = edhrec.get_top_sorceries(miirym)\ntop_enchantments = edhrec.get_top_enchantments(miirym)\ntop_artifacts = edhrec.get_top_artifacts(miirym)\ntop_mana_artifacts = edhrec.get_top_mana_artifacts(miirym)\ntop_battles = edhrec.get_top_battles(miirym)\ntop_planeswalkers = edhrec.get_top_planeswalkers(miirym)\ntop_utility_lands = edhrec.get_top_utility_lands(miirym)\ntop_lands = edhrec.get_top_lands(miirym)\n\n```\n\n## Caching\nTo avoid excessive requests to edhrec.com this library uses in-memory caching for card retrieval methods. Each time you run \na script using this library we'll cache the results for any given card. If you request the card again during the same execution we \nwill 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 \nbe updated once a day. Due to the nature of the game not changing often this should normally not cause issues and will help alleviate \nexcessive traffic to EDHREC servers.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A simple package to interact with the excellent EDHRec site for Magic the Gathering",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/stainedhat/pyedhrec",
        "Issues": "https://github.com/stainedhat/pyedhrec/issues"
    },
    "split_keywords": [
        "magic",
        "mtg",
        "edhrec",
        "magic the gathering",
        "edh"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5428d416004fd044e95eb4dadd3057106b238b3e31d8dc220aca7ca70a0bfac0",
                "md5": "fe180ef0683ebc14bc822c8affe613d4",
                "sha256": "5284ec3b8308294adf62771f5ec79ffde4b0de2c5fd5fea2e36219612859bbc4"
            },
            "downloads": -1,
            "filename": "pyedhrec-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fe180ef0683ebc14bc822c8affe613d4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 9825,
            "upload_time": "2024-02-03T18:27:43",
            "upload_time_iso_8601": "2024-02-03T18:27:43.292864Z",
            "url": "https://files.pythonhosted.org/packages/54/28/d416004fd044e95eb4dadd3057106b238b3e31d8dc220aca7ca70a0bfac0/pyedhrec-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c47778aeece0f3251f2bfa72f75fa693f51c9d05c9067adcac559957d9f8b348",
                "md5": "e9bf7a0c036e64161a14670f48f30143",
                "sha256": "5bc20eccbdc2182a779a03f7a904168fd406f746afc2e6814d6f489d0d5dfb1e"
            },
            "downloads": -1,
            "filename": "pyedhrec-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e9bf7a0c036e64161a14670f48f30143",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 10294,
            "upload_time": "2024-02-03T18:27:44",
            "upload_time_iso_8601": "2024-02-03T18:27:44.266940Z",
            "url": "https://files.pythonhosted.org/packages/c4/77/78aeece0f3251f2bfa72f75fa693f51c9d05c9067adcac559957d9f8b348/pyedhrec-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-03 18:27:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "stainedhat",
    "github_project": "pyedhrec",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyedhrec"
}
        
Elapsed time: 0.18889s