Metadata-Version: 2.4
Name: riftbound-scraper
Version: 1.0.0
Summary: CLI Python pour synchroniser les cartes Riftbound depuis la galerie officielle.
Author: ANDRIANAIVO Patrick
License: MIT
Keywords: cli,riftbound,scraper,tcg
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: baobab-database<2,>=1.0
Requires-Dist: beautifulsoup4<5,>=4.12
Requires-Dist: requests<3,>=2.31
Requires-Dist: sqlalchemy<3,>=2.0
Requires-Dist: typer<1,>=0.12
Provides-Extra: dev
Requires-Dist: bandit<2,>=1.7; extra == 'dev'
Requires-Dist: black<26,>=24; extra == 'dev'
Requires-Dist: coverage[toml]<8,>=7; extra == 'dev'
Requires-Dist: flake8-pyproject<2,>=1.2; extra == 'dev'
Requires-Dist: flake8<8,>=7; extra == 'dev'
Requires-Dist: mypy<2,>=1.10; extra == 'dev'
Requires-Dist: pylint<5,>=3; extra == 'dev'
Requires-Dist: pytest-asyncio<1,>=0.23; extra == 'dev'
Requires-Dist: pytest<9,>=7; extra == 'dev'
Requires-Dist: types-beautifulsoup4<5,>=4.12; extra == 'dev'
Requires-Dist: types-requests<3,>=2.31; extra == 'dev'
Description-Content-Type: text/markdown

# Riftbound Scraper

CLI Python pour synchroniser localement les cartes **Riftbound** depuis la
galerie officielle : extraction source, normalisation métier, persistence SQLite
et téléchargement d'assets.

## Prérequis

- Python **3.11** ou **3.12**
- Accès réseau pour `sets` et `sync` (la suite de tests fonctionne sans site live)

## Installation

```bash
git clone https://github.com/baobabgit/python-baobab-riftbound-scraper.git
cd python-baobab-riftbound-scraper
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
```

Vérifier l'installation :

```bash
riftbound-scraper --version
riftbound-scraper --help
```

## Usage rapide

```bash
# Lister les sets détectés dans la source
riftbound-scraper sets

# Synchroniser un set (ex. UNL)
riftbound-scraper sync --set UNL

# Synchroniser tous les sets
riftbound-scraper sync --all

# Vérifier la cohérence locale (DB + fichiers assets)
riftbound-scraper verify

# Afficher les compteurs locaux
riftbound-scraper stats
```

Les données sont stockées sous :

```text
data/database/riftbound.db    # SQLite
data/assets/                  # Images et icônes
```

Voir `docs/007_cli_commands.md` pour le détail des commandes et codes de sortie.

## Validation locale

```bash
pytest
coverage run -m pytest && coverage report
black --check src tests
flake8 src tests
pylint src tests
mypy src tests
python -m bandit -r src
```

Guide complet : `docs/008_validation_commands.md`.

## Documentation technique

| Document | Contenu |
|----------|---------|
| `docs/002_project_structure.md` | Arborescence et couches |
| `docs/003_source_gallery_extraction.md` | Client source et `__NEXT_DATA__` |
| `docs/004_card_normalization.md` | Normalisation métier |
| `docs/005_sqlite_persistence.md` | Persistence SQLite |
| `docs/006_assets_download.md` | Téléchargement et déduplication assets |
| `docs/007_cli_commands.md` | Commandes CLI |
| `docs/008_validation_commands.md` | Suite qualité et tests |
| `docs/009_project_operations.md` | Exploitation, CI et workflow Cursor |

## Développement avec Cursor AI

1. Choisir un backlog dans `docs/product/003_backlogs_cursor_ai.md`
2. Créer la branche associée (`prompts/...`)
3. Ouvrir le prompt dans `docs/prompts/backlogs/`
4. Suivre le workflow décrit dans `docs/009_project_operations.md`

## CI

- **CI** (`.github/workflows/ci.yml`) : qualité, tests et build sur chaque PR /
  push vers `main`
- **Release** (`.github/workflows/release.yml`) : publication sur tag `v*.*.*`

## Licence

MIT
