Skip to main content

A command line interface for the thronesdb.com card database.

Project description

Thrones CLI

A command line interface for browsing cards from A Game of Thrones LCG 2nd Ed.

Why?

Thronesdb.com is a great web site, but sometimes it's just nice to do things from the command line.

Thrones CLI also has the ability produce card count breakdowns based on a selected field, with the --count option.

Install

Thrones CLI can be installed from PyPI using pip:

sudo pip install thronescli

Options

Thrones CLI has the following options as given by the --help option:

$ thronescli --help
Usage: thronescli [OPTIONS] [TEXT]...

Options:
  --update       Update card database
  -v, --verbose  Show more data.
  --brief        Show one line of data, regardless the level of verbose.
  --long         Show multiple lines of data, regardless the level of verbose.
  --show FIELD   Show given field only. Can be repeated to show multiple
                 fields in given order.
  --case         Use case sensitive filtering.
  --exact        Use exact match filtering.
  --regex        Use regular rexpressions when filtering.
  --or FIELD     Treat multiple tests for given field with logical
                 disjunction, i.e. OR-logic instead of AND-logic.
  --inclusive    Treat multiple tests for different fields with logical
                 disjunction, i.e. OR-logic instead of AND-logic.
  --sort FIELD   Sort results by given field.
  --desc         Sort results in descending order.
  --group FIELD  Group results by given field.
  --count FIELD  Print a breakdown of all values for given field.
  --version      Show the version and exit.
  --help         Show this message and exit.

Field filters:
  -n, --name TEXT         Filter on matching name.
  --trait TEXT            Filter on matching traits.
  -x, --text TEXT         Filter on matching text.
  --keyword TEXT          Filter on matching keywords.
  --unique                Filter on unique.
  --non-unique            Filter on non-unique.
  --loyal                 Filter on loyal.
  --non-loyal             Filter on non-loyal.
  -f, --faction FACTION   Filter on matching faction.
  --faction-isnt FACTION  Filter on non-matching faction.
  -t, --type TYPE         Filter on matching type.
  --type-isnt TYPE        Filter on non-matching type.
  --cost NUMBER           Filter on matching cost (number comparison).
  --ambush-cost NUMBER    Filter on matching ambush cost (number comparison).
  --bestow-limit NUMBER   Filter on matching bestow limit (number comparison).
  --shadow-cost NUMBER    Filter on matching shadow cost (number comparison).
  --str NUMBER            Filter on matching str (number comparison).
  --icon ICON             Filter on having given icon.
  --icon-isnt ICON        Filter on not having given icon.
  --claim NUMBER          Filter on matching claim (number comparison).
  --income NUMBER         Filter on matching income (number comparison).
  --initiative NUMBER     Filter on matching initiative (number comparison).
  --reserve NUMBER        Filter on matching reserve (number comparison).
  --illustrator TEXT      Filter on matching illustrator.
  --set TEXT              Filter on matching set.

Where:
  FACTION  One of: baratheon, gj, greyjoy, lannister, martell, neutral,
           night's watch, nw, stark, targaryen, the night's watch, tyrell.
  FIELD    One of: ambush cost, bestow limit, claim, cost, faction, icons,
           illustrator, income, initiative, keywords, loyal, name, reserve,
           set, shadow cost, str, text, traits, type, unique.
  ICON     One of: military, intrigue, power. A combination of the letters
           'MIP' can be used to define multiple respective icons.
  NUMBER   A number optionally prefixed by one of the supported comparison
           operators: ==, =, !=, !, <=, <, >=, >. Or a range of two numbers
           separated with the .. operator. With == being the default operator
           if none is given.
  TEXT     A text partially matching the field value. The --case, --regex and
           --exact options can be applied. If prefixed with ! the match is
           negated.
  TYPE     One of: agenda, attachment, character, event, location, plot,
           title.

Examples

Find a card by its name:

$ thronescli Asha
Asha Greyjoy: Unique. House Greyjoy. Character. 5 Cost. 4 STR. M P.
Asha Greyjoy: Unique. Loyal. House Greyjoy. Character. 7 Cost. 5 STR. M I P.
Asha Greyjoy: Unique. House Greyjoy. Character. 6 Cost. 5 STR. M P.

Total count: 3

Print more of the cards' information:

$ thronescli Asha -v
Asha Greyjoy
Ironborn. Lady.
Stealth.
Reaction: After you win an unopposed challenge in which Asha Greyjoy is participating, stand her.
Unique: Yes
Loyal: No
Faction: House Greyjoy
Type: Character
Cost: 5
STR: 4
Icons: M P

Asha Greyjoy
Captain. Ironborn. Lady.
Pillage. Stealth.
Reaction: After Asha Greyjoy discards a card using pillage, search the top X cards of your deck for a card and add it to your hand. Shuffle your deck. X is the number of cards in the losing opponent's
discard pile.
Unique: Yes
Loyal: Yes
Faction: House Greyjoy
Type: Character
Cost: 7
STR: 5
Icons: M I P

Asha Greyjoy
Captain. Ironborn. Lady.
Pillage. Stealth.
Each other unique Ironborn character you control gains stealth.
Unique: Yes
Loyal: No
Faction: House Greyjoy
Type: Character
Cost: 6
STR: 5
Icons: M P

Total count: 3

Find all Greyjoy characters with an intrigue icon, grouped by STR:

$ thronescli -f gj --icon i --group str
[ 1 STR ]

Lordsport Shipwright: House Greyjoy. Character. 2 Cost. 1 STR. I.
The Reader's Septon: House Greyjoy. Character. 2 Cost. 1 STR. I P.
Harlaw Scout: House Greyjoy. Character. 2 Cost. 1 STR. M I.

[ 2 STR ]

Alannys Greyjoy: Unique. House Greyjoy. Character. 3 Cost. 2 STR. I P.
Priest of the Drowned God: House Greyjoy. Character. 3 Cost. 2 STR. I P.
Esgred: Unique. House Greyjoy. Character. 5 Cost. 2 STR. M I P.
Wex Pyke: Unique. House Greyjoy. Character. 2 Cost. 2 STR. M I.
Drowned God Fanatic: Loyal. House Greyjoy. Character. 3 Cost. 2 STR. M I.
Maester Murenmure: Unique. House Greyjoy. Character. 3 Cost. 2 STR. I P.
Old Grey Gull: Unique. Loyal. House Greyjoy. Character. 3 Cost. 2 STR. I P.
Drowned God Fanatic: Loyal. House Greyjoy. Character. 3 Cost. 2 STR. M I.
Cragorn: Unique. House Greyjoy. Character. 2 Cost. 2 STR. I.

[ 3 STR ]

Drowned God's Apostle: House Greyjoy. Character. 4 Cost. 3 STR. I P.
Aeron Damphair: Unique. Loyal. House Greyjoy. Character. 5 Cost. 3 STR. I P.
Hotho Humpback: Unique. House Greyjoy. Character. 4 Cost. 3 STR. I P.
Left-Hand Lucas Codd: Unique. House Greyjoy. Character. 4 Cost. 3 STR. M I.
Ralf Kenning: Unique. Loyal. House Greyjoy. Character. 4 Cost. 3 STR. M I.
Moqorro: Unique. House Greyjoy. Character. 3 Cost. 3 STR. I.

[ 4 STR ]

The Reader: Unique. Loyal. House Greyjoy. Character. 5 Cost. 4 STR. I P.
Aeron Damphair: Unique. House Greyjoy. Character. 6 Cost. 4 STR. I P.
Tarle the Thrice-Drowned: Unique. Loyal. House Greyjoy. Character. 5 Cost. 4 STR. I P.
Euron Crow's Eye: Unique. Loyal. House Greyjoy. Character. 6 Cost. 4 STR. M I P.
Alannys Greyjoy: Unique. Loyal. House Greyjoy. Character. 5 Cost. 4 STR. I P.
King's Landing Proselyte: House Greyjoy. Character. 4 Cost. 4 STR. I P.
Euron Crow's Eye: Unique. Loyal. House Greyjoy. Character. 6 Cost. 4 STR. M I P.
Dagmer Cleftjaw: Unique. House Greyjoy. Character. 5 Cost. 4 STR. M I.

[ 5 STR ]

Asha Greyjoy: Unique. Loyal. House Greyjoy. Character. 7 Cost. 5 STR. M I P.
Tarle the Thrice-Drowned: Unique. Loyal. House Greyjoy. Character. 6 Cost. 5 STR. I P.

[ 6 STR ]

Euron Crow's Eye: Unique. Loyal. House Greyjoy. Character. 7 Cost. 6 STR. M I P.

Total count: 29

Find all non-limited income providing cards:

$ thronescli --text "\\+\\d+ Income" --text "!Limited" --regex
Littlefinger: Unique. Neutral. Character. 5 Cost. 4 STR. I P.
Tywin Lannister: Unique. Loyal. House Lannister. Character. 7 Cost. 6 STR. M I P.
Paxter Redwyne: Unique. Loyal. House Tyrell. Character. 4 Cost. 3 STR. I.
Master of Coin: Neutral. Title.
The God's Eye: Unique. Neutral. Location. 3 Cost.
Shield of Lannisport: Unique. Loyal. House Lannister. Attachment. 3 Cost.
Mace Tyrell: Unique. Loyal. House Tyrell. Character. 6 Cost. 4 STR. I P.
Northern Armory: Loyal. House Stark. Location. 2 Cost.
Stormlands Fiefdom: Loyal. House Baratheon. Location. 2 Cost.
Tycho Nestoris: Unique. Neutral. Character. 6 Cost. 3 STR. P.
Miner's Pick: Loyal. The Night's Watch. Attachment. 1 Cost.
Gold Mine: Loyal. House Lannister. Location. 2 Cost.
Summer Sea Port: Loyal. House Martell. Location. 2 Cost.
Tithe Collector: House Lannister. Character. 3 Cost. 3 STR. I.
Meereenese Market: Loyal. House Targaryen. Location. 2 Cost.
Refurbished Hulk: Loyal. House Greyjoy. Location. 2 Cost.
Arbor Marketplace: Loyal. House Tyrell. Location. 2 Cost.
Knights of the Hollow Hill: Neutral. Agenda.
The Red Keep: Unique. House Lannister. Location. 4 Cost.
The Red Keep: Unique. House Lannister. Location. 4 Cost.
Ser Harys Swyft: Unique. House Lannister. Character. 4 Cost. 4 STR. P.
Fair Isle: Unique. Loyal. House Lannister. Location. 3 Cost.
The Green Fork: Unique. Neutral. Location. 2 Cost.
Garth Greenhand: Unique. Loyal. House Tyrell. Attachment. 3 Cost.
Lannisport: Unique. Loyal. House Lannister. Location. 3 Cost.
Gyles Rosby: Unique. House Lannister. Character. 3 Cost. 3 STR. P.
Redwyne Merchanter: House Tyrell. Location. 2 Cost.

Total count: 27

Find the best faction for using Street of Silk:

$ thronescli --trait ally --trait companion --or trait --count faction
[ Faction counts ]

House Targaryen:   31
Neutral:           29
House Lannister:   24
The Night's Watch: 17
House Martell:     16
House Baratheon:   15
House Stark:       14
House Greyjoy:     13
House Tyrell:      13

Total count: 172

Find all 1 cost characters and get a breakdown of their trait and icon spread.

$ thronescli --cost 1 -t char --count icon --count trait
[ Icons counts ]

Power:       13
Intrigue:    8
Military:    4

[ Traits counts ]

Ally:        13
Steward:     4
Merchant:    3
Raven:       2
Lord:        2
Mercenary:   2
Companion:   2
Builder:     1
Maester:     1
Fool:        1
House Frey:  1
House Arryn: 1
Recruit:     1
Spy:         1
Wildling:    1

Total count: 26

Find all non-unique Ranger characters that can take attachments.

$ thronescli --trait ranger --non-unique --keyword "!No attachments"
Vindictive Ranger
Ranger.
Reaction: After you lose a challenge as the defending player, Vindictive Ranger gains stealth and a challenge icon of your choice until the end of the phase.
Unique: No
Loyal: No
Faction: The Night's Watch
Type: Character
Cost: 3
STR: 3
Icons: M

Total count: 1

Credits

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

thronescli-3.4.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

thronescli-3.4.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file thronescli-3.4.2.tar.gz.

File metadata

  • Download URL: thronescli-3.4.2.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for thronescli-3.4.2.tar.gz
Algorithm Hash digest
SHA256 89d6eb059f602c77103ff208ec3c6984b19c0b782fdbb2d9a4e1eefd1ea6e0ba
MD5 c1a5359479720601f8a559b70e5e86e1
BLAKE2b-256 ba7a48c0e3024966b1ce5fc8e2d72f72fbf2f3289e14813ac086c1aa2e5a5370

See more details on using hashes here.

File details

Details for the file thronescli-3.4.2-py3-none-any.whl.

File metadata

  • Download URL: thronescli-3.4.2-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for thronescli-3.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 686ae94c36980423d39f5980cd117919123874780a16d3d91202d60d64027708
MD5 d50b2e148ffc3f1704b70d7e8696d9e0
BLAKE2b-256 0b57b321182bd6cfbf928bbfa2041cc4535d8fc195ea41c0731f0399efd092f8

See more details on using hashes here.

Supported by

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