Metadata-Version: 2.1
Name: lorcania-cli
Version: 0.1.1
Summary: A CLI tool to access https://lorcania.com
Home-page: https://github.com/cschwartz/lorcania-cli
License: LGPL-3.0-only
Author: Christian Schwartz
Author-email: christian.schwartz@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: openpyxl (>=3.1.2,<4.0.0)
Requires-Dist: pandas (>=2.1.0,<3.0.0)
Requires-Dist: pandas-stubs (>=2.1.1.230928,<3.0.0.0)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: rich (>=13.5.3,<14.0.0)
Requires-Dist: typer[all] (>=0.9.0,<0.10.0)
Requires-Dist: types-requests (>=2.31.0.6,<3.0.0.0)
Project-URL: Repository, https://github.com/cschwartz/lorcania-cli
Description-Content-Type: text/markdown

lorcania-cli is an unofficial CLI to work with [Lorcania](https://lorcania.com/), a website to collect your [Lorcana](https://www.disneylorcana.com/) cards.
Lorcania provides a valuable service for the community and this utility is not ment to replace it, but rather to allow (currently: me) to obtain a local backup for my collection.

It currently only allows to:

- Get your collection of Lorcana cards.

# Installation

```
pip install lorcania-cli
```

# Usage

To get your collection at the command line

```bash
$ lorcania-cli collection show "<e-mail address used for Lorcania>"
Password: "<Lorcania password>"
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ collection                                                                                    ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ rarity_collection                                                           foil  op  regular │
│ card_set_id number name                        title                                          │
│ 1           1      Mickey Mouse                Brave Little Tailor                            │
...
└───────────────────────────────────────────────────────────────────────────────────────────────┘
```

You can also use environment variables or an .env file to store your credentials:

```bash
LORCANIA_EMAIL="<e-mail address used for Lorcania>"
LORCANIA_PASSWORD="<Lorcania password>"
```

Then, you can directly use

```
lorcania-cli
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ collection                                                                                    ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ rarity_collection                                                           foil  op  regular │
│ card_set_id number name                        title                                          │
│ 1           1      Mickey Mouse                Brave Little Tailor                            │
...
└───────────────────────────────────────────────────────────────────────────────────────────────┘
```

Please always remember, that your credentials are secrets and should not be stored in version control.

To get your collection as an excel file (here: `my-collection.xlsx`), use

```
$ lorcania-cli collection show --out-file my-collection.xlsx
```

# Test

To test lorcania-cli, use `pytest`.
In order to don't waste Lorcania resources, a vcr.py suite is included for an account with the following collection:

- _Mickey Mouse Detective_ (Promo): 1x
- _Ariel - On Human Legs_ (The First Chapter): 2x (regular)
- _Cinderella - Gentle and Kind_ (The First Chapter): 1x (regular), 2x (foil)

If you want to extend lorcania-cli and need to run tests against real Lorcania, I recommend to

- create a lorcania account for this purpose
- add the above cards
- add any other cards as required for your use case
- delete the vcr.py cassettes at `tests/cassettes`
- make the credentials to your lorcania test account available in `.env.tests` (which is ignored via .gitignore)
- rerun `pytest`

