Skip to main content

pyArtifact

Pythonic wrapper around Valve's Artifact API, with object mapping, filtering and hopefully more

Current phase: alpha -> feedback needed

MIT License pypi version Documentation Status Build Status

Here's what we can do so far

>>> from pyartifact import Cards
>>> cards = Cards()
>>> cards.load_all_sets()
>>> repr(cards.get('Storm Spirit').includes[0])
<Artifact card: {'id': 10538, 'base_id': 10538, 'name': 'Ball Lightning', 'type': 'Spell', 'text': "Move an <span style='font-weight:bold;color:#736e80;'>allied black hero</span> to an empty combat position in any lane.", 'mini_image': 'https://steamcdn-a.akamaihd.net/apps/583950/icons/set01/10538.aeb7a6a47e1d8b1a26307ae25e329df3e3bb0843.png', 'large_image': 'https://steamcdn-a.akamaihd.net/apps/583950/icons/set01/10538_large_english.9b39d2d2bb4769b68fa3ac42abee35b1685a57de.png', 'ingame_image': None, '_CardBase__references': [], 'color': 'black', 'rarity': None, 'item_def': None, 'mana_cost': 3, 'illustrator': 'JiHun Lee'}>

>>> filtered = cards.filter.type('Spell').mana_cost(gt=4).color('black').rarity('Rare')
>>> len(filtered)
1
>>> for card in filtered:
...     print(card)
...
The Cover of Night

# Deck encoding (wrapper not done)
>>> from pyartifact import decode_deck_string
>>> deck_contents = decode_deck_string('ADCJQUQI30zuwEYg2ABeF1Bu94BmWIBTEkLtAKlAZakAYmHh0JsdWUvUmVkIEV4YW1wbGU_')
>>> print(deck_contents['name'])
Blue/Red Example
>>> print(deck_contents['heroes'])
[{'id': 4003, 'turn': 1}, {'id': 10006, 'turn': 1}, {'id': 10030, 'turn': 1}, {'id': 10033, 'turn': 3}, {'id': 10065, 'turn': 2}]
>>> from pyartifact import encode_deck
>>> print(encode_deck(deck_contents))
ADCJQUQI30zuwEYg2ABeF1Bu94BmWIBTEkLtAKlAZakAYmHh0JsdWUvUmVkIEV4YW1wbGU_

Plans

  • Provide text sanitizers (text atm. has html) - to markdown, strip, etc., use for deck encoding/decoding
  • Add more filtering options
  • Cleanup code structure (possible performance improvements)

Metadata

Release files for pyartifact 0.3.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 pyartifact 0.3.2
File Size Uploaded
pyArtifact-0.3.2.tar.gz 17.4 kB Details

Built distribution (wheel)

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

Total release size: 88.9 kB

Release files / pyArtifact-0.3.2.tar.gz

Download URL pyArtifact-0.3.2.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d123ca6a0462a240c51d707a96cf04d93b6a4e0ad836690f7a1db77a2538fa5c
BLAKE2b-256 checksum
How to use checksums
32a4cdf96b58105a7e1ca1976afc11ca6e54faa3115ef98ed90976df27366776
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.8 CPython/3.6.6 Darwin/18.0.0

Release files / pyArtifact-0.3.2-py3-none-any.whl

Download URL pyArtifact-0.3.2-py3-none-any.whl
Size 71.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20575e8aaa6437c3955548bc612faf948eba63d4ce6fa66763e16df4927f65dc
BLAKE2b-256 checksum
How to use checksums
cf102d93bbca042811d505af6a4519fd409c2b9c6405629f414f2433d29bb35a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.8 CPython/3.6.6 Darwin/18.0.0

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

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