cookie-clicker-parser 1.1.0
Parser for Cookie Clicker save codes
License: MIT
Keywords: parser, cookie clicker

# Parse Cookie Clicker save codes

This is a package for parsing Cookie Clicker save codes. These save codes are generated by exporting your save through the options panel.

## Installation

`pip install cookie-clicker-parser`

### Testing

To test the package in development you have to install the requirements `pip install -r requirements.txt` and install the package itself `pip install .`.Then you can run `pytest`.

## Provided functions

Cookie Clicker save parser provides two functions at the moment:

- `parse` - get all the data from a Cookie Clicker save code
- `get_seed` - get the seed of the Cookie Clicker save

## Supported Cookie Clicker versions

The only offically supported and tested version is v2.052 of Cookie Clicker. Codes of older versions might work but this has not been tested.

## Examples

Both `parse` and `get_seed` take one string argument being the Cookie Clicker save code.

```python
from cookie_clicker_parser import parse, get_seed

parse("Mi4wNTJ8fDE3MDg2...wMDAwfHw%3D%21END%21")
get_seed("Mi4wNTJ8fDE3MDg2...wMDAwfHw%3D%21END%21")
```

## Data format

The `parse` function returns a dictionary which the layout is roughly described here. Of course to gain a better understanding of the data structure you should play around and see what you can find inside the data.

In the following subcategories we assume that we have a parsed Cookie Clicker save named `game`.

### Cookie Clicker version

`game["version"]` stores the version of Cookie Clicker that save was played on.

### Sections

Except the game version there are 9 categories of data describing the save in the root of `game`.

#### run_details

This section contains information about when the run started, when the legacy started, when the game was last opened, the bakerys name, the game seed, and data from the you customizer.

```python
details = game["run_details"]
details.keys()
=> dict_keys(["start_date", "legacy_start_date", "last_opened_game_date", "bakery_name", "seed", "you_customizer"])
```

#### preferences

This section contains the users preferences as booleans.

```python
preferences = game["preferences"]
preferences.keys()
=> dict_keys(["particles", "numbers", "autosave", "autoupdate", "milk", "fancy", "warn", "cursors", "focus", "format", "notifs", "wobbly", "monospace", "filters", "cookiesound", "crates", "showBackupWarning", "extraButtons", "askLumps", "customGrandmas", "timeout", "cloudSave", "bgMusic", "notScary", "fullscreen", "screenreader", "discordPresence"])
```

#### misc_game_data

```python
dict_keys(["cookies", "total_cookies_earned", "cookie_clicks", "golden_cookie_clicks", "cookies_made_by_clicking", "golden_cookies_missed", "background_type", "milk_type", "cookies_from_past_runs", "elder_wrath", "pledges", "pledge_time_left", "currently_researching", "research_time_left", "ascensions", "golden_cookie_clicks_this_run", "cookies_sucked_by_wrinklers", "wrinklers_popped", "santa_level", "reindeer_clicked", "season_time_left", "season_switcher_uses", "current_season", "amount_cookies_in_wrinklers", "number_of_wrinklers", "prestige_level", "heavenly_chips", "heavenly_chips_spent", "heavenly_cookies", "ascension_mode", "dragon_level", "chime_type", "volume", "number_of_shiny_wrinklers", "amount_of_cookies_contained_in_shiny_wrinklers", "current_amount_of_sugar_lumps", "total_amount_of_sugar_lumps", "time_when_current_lump_started", "time_when_last_refilled_minigame_with_lump", "sugar_lump_type", "vault", "heralds", "golden_cookie_fortune", "cps_fortune", "highest_raw_cps", "music_volume", "cookies_sent", "permanent_upgrades", "dragon_auras"])
```

#### buildings

Contains data about the buildings owned. From what I can gather there is no was to know the buildings name from the export code and it seems to identify buildings by their index.

`game["buildings"]` is an array containing a dictionary for each building type.

```python
buildings = game["buildings"]
buildings[0].keys()
=> dict_keys(["amount_owned", "amount_bought", "total_cookies", "level", "minigame_save", "muted", "highest_amount_owned"])
```

#### upgrades

Contains data about unlocked and owned upgrades. Stored as array.

```python
upgrades = game["upgrades"]
upgrades[0].keys()
=> dict_keys(["unlocked", "bought"])
```

#### achievements

Is an array containing a boolean indicating if the achievement at that index is unlocked.

#### buffs

Contains data about the currently active buffs.

#### mod_data

Contains data about loaded mods and data from those mods.