Skip to main content

HearthGen - create your own hearthstone cards inside python

About

Hearthgen is a python library using selenium webdriver to access https://hearthcards.net/ and make hearthstone cards inside python.

Installing

You can install hearthgen from Github:

pip install https://github.com/h4x4d/hearthgen/blob/main/archive/hearthgen-0.0.1.tar.gz

Or from PyPi:

pip install hearthgen

Using hearthgen

You can create card with 2 different methods:

  • Using function create_card()
  • Using class CardCreator()

What is the difference between them?

CardCreator initializes webdriver on the and can be used many times, but create_card() initializes webdriver on start of function and stop it at the end. So if you make one card, it's pretty good to use function, but if you make more cards in one run it's more suitable to use class.

So, what about using?

And don't forget about chromedriver in script path to run it!

from hearthgen import create_card

create_card(
    card_type='minion',
    save_name='card.png',
    card_name='h4x4d',
    card_class='priest',
    rarity='leg',
    card_text='[b]Battlecry:[/b] create this test!',
    card_image=r'C:\Documents\favorite_image.png', # You need to pass full path to image
    mana_cost=3,
    attack=4,
    health=3,
    hd=True,
    addon='karazhan'
)

Not all of them a necessary and if you do spells, for example with class, you don't need to pass atack and health:

from hearthgen import CardCreator

card_maker = CardCreator()

card_maker.create_card(
    card_type='spell',
    save_name='card.png',
    card_name='h4x4d`s spell',
    card_class='priest',
    rarity='leg',
    card_text='Creates class and one more test, but with spell!',
    card_image=r'C:\Documents\favorite_image_2.png', # You need to pass full path to image
    mana_cost=3,
    hd=True,
    addon='karazhan'
)

Also, if you need som changes in chromedriver, it's possible to pass it to CardCreator():

from hearthgen import CardCreator
from selenium import webdriver

driver = webdriver.Chrome(r'C:\very_special_path\chromedriver.exe')

card_maker = CardCreator(driver=driver)

Full documentation is placed here: soon it will be here...

Release files for hearthgen 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hearthgen 0.0.2
File Size Uploaded
hearthgen-0.0.2.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hearthgen 0.0.2
File Interpreter ABI Platform
hearthgen-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.0 kB

Release files / hearthgen-0.0.2.tar.gz

Download URL hearthgen-0.0.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
746b2632d6c8e6ba867f7cd1e53f362d3fb42a3d9822d5638de895fcd60f6ac0
BLAKE2b-256 checksum
How to use checksums
cf22f15852bc8a5d17d2fc3d1088ed372d9d38bc232049da54e84c58316f5da7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9

Release files / hearthgen-0.0.2-py3-none-any.whl

Download URL hearthgen-0.0.2-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b9ca4b75eaf981c367c0eafb414d2ae59e50f063ad760d71fee3393bea7250a
BLAKE2b-256 checksum
How to use checksums
639f321107c34d59bb56a300c4488af4afe0b1c03fa142dabd750ac38bc6a9f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page