8000 Add a script for extracting stats into JSON/PK3 by hanzi · Pull Request #667 · 40Cakes/pokebot-gen3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add a script for extracting stats into JSON/PK3 #667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2025

Conversation

hanzi
Copy link
Collaborator
@hanzi hanzi commented Mar 24, 2025

Description

This adds a command-line utility that allows exporting stats (filtered by some condition) to either JSON, JSON lines, or a ZIP file containing PK3 files.

$ python utility/extract_stats_encounters.py  --help
usage: extract_stats_encounters.py [-h] [--format {jsonlines,json,pk3}]
                                   [--from FROM_DATE] [--to TO_DATE] [--map MAP]
                                   [--bot-mode BOT_MODE]
                                   [--outcome {OpponentFled,RanAway,Lost,Won,Draw,PlayerTeleported,OpponentTeleported,Caught,NoSafariBallsLeft}]
                                   [--filter {of_interest,roamer,custom_catch_filter,all,shiny}]
                                   profile

PokéBot Gen3 20250318.0 Stats Exporter

positional arguments:
  profile               Name of the profile from which to extract the stats. This
                        profile must have had at least one encounter.

options:
  -h, --help            show this help message and exit
  --format {jsonlines,json,pk3}
                        Specify the export format.
  --from FROM_DATE      Only export encounters after this. Either an ISO 8601 date
                        string (e.g. `2025-03-01T12:34:56`) or an encounter ID.
  --to TO_DATE          Only export encounters before this. Either an ISO 8601 date
                        string (e.g. `2025-03-01T12:34:56`) or an encounter ID.
  --map MAP             Only export encounters from a particular map. This can be the
                        (internal) name of the map, or a `group:map` notation used by
                        the game. This can be used multiple times.
  --bot-mode BOT_MODE   Only export encounters generated by a particular bot mode. This
                        can be used multiple times.
  --outcome {OpponentFled,RanAway,Lost,Won,Draw,PlayerTeleported,OpponentTeleported,Caught,NoSafariBallsLeft}
                        Only export encounters with a particular outcome. This can be
                        used multiple times.
  --filter {of_interest,roamer,custom_catch_filter,all,shiny}
                        Only export encounters that match a particular type. The
                        default (`of_interest`) will filter all shinies, roamers, and
                        custom catch filter matches.

Fixes #666

Checklist

  • Black Linter has been ran, using --line-length 120 argument
  • Wiki has been updated (if relevant)

This adds a command-line utility that allows exporting stats (filtered by some condition) to either JSON, JSON lines, or a ZIP file containing PK3 files.
@hanzi hanzi merged commit 1e2e7f9 into 40Cakes:main Mar 25, 2025
1 check passed
@hanzi hanzi deleted the stats-export branch March 25, 2025 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exporter script to create .pk3 files from .db file
2 participants
0