Skip to main content

Library to make hearthstone cards in python!

Project description

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...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hearthgen-0.0.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hearthgen-0.0.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file hearthgen-0.0.2.tar.gz.

File metadata

  • Download URL: hearthgen-0.0.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for hearthgen-0.0.2.tar.gz
Algorithm Hash digest
SHA256 746b2632d6c8e6ba867f7cd1e53f362d3fb42a3d9822d5638de895fcd60f6ac0
MD5 1ebb43c4e014d3b1e019cfbb9d95968c
BLAKE2b-256 cf22f15852bc8a5d17d2fc3d1088ed372d9d38bc232049da54e84c58316f5da7

See more details on using hashes here.

File details

Details for the file hearthgen-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: hearthgen-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for hearthgen-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3b9ca4b75eaf981c367c0eafb414d2ae59e50f063ad760d71fee3393bea7250a
MD5 49e5c20278c6b817e0bfdc83cf04b88f
BLAKE2b-256 639f321107c34d59bb56a300c4488af4afe0b1c03fa142dabd750ac38bc6a9f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page