The Cobblemon Spawn Data Extractor is a Python script designed to extract and analyze Pokémon spawn data from cobblemon JSON files. This project allows you to efficiently process, extract, and organize spawn information into a CSV format for easier analysis and reference.
- Extracts Pokémon spawn and species data from
.zipand.jararchives containing JSON files. - Outputs a detailed CSV file with information on Pokémon species, spawn conditions, egg groups, biomes, moon phases, and more.
- Supports a "Fun Mode" that adds colorful terminal outputs using
colorama. - Processes data in-memory to optimize for speed.
- Uses concurrency to improve extraction and processing efficiency.
- Python 3.7+
- Required Python packages:
aiofilescoloramaasyncio
To install the required packages, run:
pip install -r requirements.txtThe script uses a configuration file config.json to set key parameters such as:
ARCHIVES_DIR: Directory containing.zipor.jarfiles.output_filename: Filename for the generated CSV file.skipped_entries_filename: Filename for entries that do not have spawn data.MAX_WORKERS: Maximum concurrent threads used for extraction.LOG_FILENAME: Filename for log output.LOG_LEVEL: Logging level (e.g.,INFO,DEBUG).FUN_MODE: Enable or disable fun-colored terminal outputs (trueorfalse).
Example config.json:
{
"ARCHIVES_DIR": "./archives",
"output_filename": "SpawnData.csv",
"skipped_entries_filename": "SkippedEntries.csv",
"MAX_WORKERS": 8,
"LOG_FILENAME": "process_log.txt",
"LOG_LEVEL": "INFO",
"FUN_MODE": true
}To run the Cobblemon Spawn Data Extractor:
python cobblemon_spawndata_processor.pyThe script will process the archives, extract relevant JSON files, and generate a CSV file with the extracted data. If FUN_MODE is enabled, you will see colorful messages during the processing.
A Docker container can be used to make running this project easier and consistent across environments.
- Create a Dockerfile in the project root:
FROM python:3.10-slim WORKDIR /app COPY . /app RUN pip install -r requirements.txt CMD ["python", "cobblemon_spawndata_processor.py"]
- Build the Docker Image:
docker build -t cobblemon-extractor . - Run the Docker Container:
docker run --rm -v $(pwd):/app cobblemon-extractor
Fun Mode adds colorful messages to the output to make the process more engaging.
- To enable fun mode, set
"FUN_MODE": trueinconfig.json. - The script uses
coloramato color code messages, making it easier to track progress and spot errors.
Logs are generated to track the progress and status of processing. The logs are saved to process_log.txt by default (configurable via LOG_FILENAME).
Contributions are welcome! Feel free to fork the repository and submit a pull request.
This project is licensed under the Mozilla Public License, Version 2.0. See the LICENSE file for details.
The output CSV generated by this script can be viewed in a sample Google Sheet: Spawn Data Spreadsheet for BCG Plus (w Cobblemon)
Special thanks to the Cobblemon team and all contributors for making this project possible!