scramble-history


Namescramble-history JSON
Version 0.1.15 PyPI version JSON
download
home_pagehttps://github.com/seanbreckenridge/scramble-history
Summaryparses scramble history from cstimer.net and other sources
upload_time2023-09-11 05:14:11
maintainer
docs_urlNone
authorSean Breckenridge
requires_python>=3.8
licenseMIT
keywords cubing data
VCS
bugtrack_url
requirements click requests logzero IPython platformdirs pytimeparse autotui more_itertools pyyaml tabulate simplejson
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # scramble-history

Parses your rubiks cube solve history from [cstimer.net](https://cstimer.net/), [cubers.io](https://www.cubers.io/), [twistytimer](https://play.google.com/store/apps/details?id=com.aricneto.twistytimer&hl=en_US&gl=US)

.. and combines/merges solves from those sources into a single format, allowing you to do statistics/giving you uniform averages/a full history

## Installation

Requires `python3.8+`

To install with pip, run:

    pip install scramble_history

To install JSON/graph support: `pip install scramble_history[optional]`

## Input Formats

If theres some other format you'd like to use, feel free to [open an issue](https://github.com/seanbreckenridge/scramble-history/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) (ideally with a data export so I can try to parse it)

### cstimer

To use, export cstimer.net solves to a file, which `scramble_history parse cstimer` accepts as input:

```
$ scramble_history parse cstimer ~/Downloads/cstimer_20221014_231808.txt

Use sess to review session data

In [1]: sess[0].raw_scramble_type
Out[1]: '333'

In [2]: sess[0].solves[-1]
Out[2]: Solve(scramble="D U2 F2 U' F2 R2 D B2 U' L2 F2 U2 B R U F' L U2 L2 F U'", comment='', solve_time=Decimal('25.248'), penalty=Decimal('0'), dnf=False, when=datetime.datetime(2022, 10, 15, 6, 8, 8, tzinfo=datetime.timezone.utc))
```

Or to dump to JSON:

```
$ scramble_history parse cstimer -j ~/data/cubing/cstimer/1665942943939.json | jq '.[].solves | .[0]'
{
  "scramble": "F U' F2 U R2 D L2 F2 U B2 D' L2 D2 R F' U R2 D L2 F' L",
  "comment": "",
  "solve_time": "25.969",
  "penalty": "0",
  "dnf": false,
  "when": "2022-10-11T03:24:27+00:00"
}
```

To backup my <http://cstimer.net> data automatically, I use [cstimer-save-server](https://github.com/seanbreckenridge/cstimer-save-server)

### twistytimer | cubers.io

Parses the export for the [TwistyTimer](https://play.google.com/store/apps/details?id=com.aricneto.twistytimer&hl=en_US&gl=US) android app, which [cubers.io](https://www.cubers.io/) also exports to:

```
$ scramble_history parse twistytimer --json Backup_2022-10-17_20-19.txt | jq '.[0]'
{
  "puzzle": "333",
  "category": "Normal",
  "scramble": "F L2 B' F' D2 R2 D2 F2 L2 U2 F2 R' F' U2 L2 B D L' B U B2",
  "time": "19.86",
  "penalty": "0",
  "dnf": false,
  "when": "2022-10-18T02:00:42.099000+00:00",
  "comment": ""
}
```

Note: for `cubers.io`, the 'when' (datetime when you did the solve) is the same for every solve in a competition (in other words, when the competition began)

## merge

```
Usage: scramble_history merge [OPTIONS] [DATAFILES]

  merge solves from different data sources together

  To provide input, either define a config file, or pass paths like:

  --cstimer ~/Downloads/cstimer.json
  --twistytimer ~/Downloads/*twistytimer*.txt

Options:
  -s, --sourcemap-file FILE       Data file which saves choices on how to map solves from different sources
                                  [default: /home/sean/.config/scramble_history/sourcemap.json]
  -a, --action [json|repl|stats]  what to do with merged solves  [default: repl]
  -C, --check                     Dont print/interact, just check that all solves are transformed properly
  -g, --group-by [puzzle|event_code|event_description]
                                  Group parsed results by key
  -G, --graph                     graph grouped results
  -O, --graph-opt [show|save|date-axis|kitty-print|annotate|annotate-average]
                                  graph options
  -q, --query TEXT                Solves to filter to, or actions to run
  -s, --sort-by [when]            Sort the resulting solves
  -r, --reverse / --no-reverse    Reverse the sort for --sort-by. Default is --no-reverse, stats uses
                                  --reverse
  --help                          Show this message and exit.
```

The merge command lets you combine solves from different sources into a normalized schema. It does this by prompting you to define attributes from each solve to look for, and then converts any solve it finds with those values to the same description. For example:

```json
{
  "source_class_name": "scramble_history.cstimer.Solve",
  "source_fields_match": {
    "name": "3x3",
    "raw_scramble_type": "333"
  },
  "transformed_puzzle": "333",
  "transformed_event_code": "WCA",
  "transformed_event_description": "3x3 CFOP"
}
```

Whenever it finds the same `class`, `name` and `raw_scramble_type` (fields from `cstimer.Solve`), it tags them with the `puzzle`, `event_code` and `event_description`. Those are entered by you (once per new type of solve), and then saved to `~/.config/scramble_history/sourcemap.json`. As an example of the generated file, you can see mine [here](https://sean.fish/d/scramble_history/sourcemap.json?redirect)

The merge command accepts options which describe the filetype, and then multiple files, removing any duplicate solves it finds. E.g.:

```bash
scramble_history merge --action json \
    --cstimer ~/data/cubing/cstimer/*.json \
    --twistytimer ~/data/cubing/phone_twistytimer/* ~/data/cubing/cubers_io/* ~/data/cubing/manual.csv
```

You can also create a config file at `~/.config/scramble_history/files.yaml` (config directory location can be changed with the `SCRAMBLE_HISTORY_CONFIG_DIR` environment variable) which contains similar info, so you don't have to type it out every time:

```yaml
cstimer:
  - ~/data/cubing/cstimer/*.json
twistytimer:
  - ~/data/cubing/manual.csv
  - ~/data/cubing/phone_twistytimer/*.txt
  - ~/data/cubing/cubers_io/*.txt
```

Examples:

```bash
$ scramble_history merge -g event_description -a json
 | jq 'to_entries[] | "\(.value | length) \(.key)"' -r | sort -nr

834 3x3 CFOP
295 2x2
112 3x3 CFOP OH
99 3x3 2-GEN <RU>
95 3x3 LSE
65 4x4
37 3x3 Roux
35 Skewb
25 Pyraminx
20 3x3 F2L
5 3x3 Roux OH
```

It can also calculate running averages across your merged data:

```
[ ~/Repos/scramble-history | master ] $ python3 -m scramble_history merge -a stats
Passed 'stats' with no '--group_by', grouping by 'event_description'
===================
3x3 CFOP
===================
Best => 11.880
Worst => 48.049
Most recent Ao5 => 17.436 = 16.551 17.682 (24.941) (16.531) 18.076
Global Mean (841/847) => 19.681
Solve Count => 847

3x3 CFOP    Current      Best
----------  ---------  ------
Ao5         17.436     14.647
Ao12        18.605     16.898
Ao50        18.725     18.092
Ao100       DNF        18.444
===================
2x2
===================
Best => 3.121
Worst => 50.170
Most recent Ao5 => 6.403 = (7.240) 6.480 6.250 (6.150) 6.480
Global Mean (317/318) => 8.820
Solve Count => 318

2x2      Current    Best
-----  ---------  ------
Ao5        6.403   5.58
Ao12       7.494   6.252
Ao50       7.574   7.214
Ao100      7.553   7.427
===================
4x4
===================
Best => 1:15.592
Worst => 5:39.830
Most recent Ao5 => 1:33.173 = (1:27.770) (1:41.280) 1:38.735 1:28.795 1:31.988
Global Mean (129/129) => 2:25.470
Solve Count => 129

4x4    Current    Best
-----  ---------  --------
Ao5    1:33.173   1:33.173
Ao12   1:36.256   1:36.256
Ao50   1:51.013   1:51.013
Ao100  2:09.471   2:09.471
===================
3x3 CFOP OH
===================
Best => 19.890
Worst => 1:32.280
Most recent Ao5 => 30.640 = 29.760 (26.800) 31.410 (32.450) 30.750
Global Mean (117/117) => 36.919
Solve Count => 117

3x3 CFOP OH      Current    Best
-------------  ---------  ------
Ao5               30.64   26.61
Ao12              29.123  29.123
Ao50              32.776  32.285
Ao100             32.923  32.923
```

Or provide other commands to run instead of `--action stats`:

```
scramble_history merge -q 'event_description==3x3 CFOP' -q Mo3 -q Ao5 -q Ao12
Mo3: 21.413 = 25.969 22.220 16.050
Ao5: 22.037 = (25.969) 22.220 (16.050) 22.697 21.193
Ao12: 19.297 = (25.969) 22.220 (16.050) 22.697 21.193 16.210 16.338 17.824 19.697 21.107 16.538 19.144
```

### graphs

Note: this requires `seaborn`, install with `pip install 'scramble-history[optional]'`

For each group selected by `--group-by`, this creates a graph. By default, this pauses at each group and shows the graph so you can move around/zoom in

To save to a png, use `--graph-opt save`. If you use [kitty](https://sw.kovidgoyal.net/kitty/), can also print these directly in the terminal:

<img src="https://github.com/seanbreckenridge/scramble-history/blob/master/.github/kitty.png?raw=true" height=500>

Can also be used in combination with `--query drop:` and `--query limit:` to only graph a portion of your history. For example to graph a rolling `ao12` from some time ago:

`scramble_history merge -q 'event_description==3x3 CFOP' -q drop:750 -q limit:12 --no-reverse -g event_description -G --graph-opt kitty-print`

<img src="https://github.com/seanbreckenridge/scramble-history/blob/master/.github/ao12.png?raw=true" height=300>

Can provide the `annotate` options if you want to add some of the text onto the graph:

`scramble_history merge -q 'event_description==4x4' -q 'last:5' -G --graph-opt annotate --graph-opt annotate-average`

<img src="https://github.com/seanbreckenridge/scramble-history/blob/master/.github/annotated.png?raw=true" height=300>

### merge query commands:

#### filter

`'attribute_name==attribute_value'` - lets you filter based on any of the string values, e.g.:

```
comment
event_code
event_description
puzzle
scramble
```

Examples:

- `'event_description==3x3 CFOP'`
- `'puzzle==skewb'`
- `'puzzle==222'`

What the description/puzzle names are depend on what you set them as while merging

#### filterin

If you want to match one of many items, e.g. filter just down to `3x3` and `2x2` solves, use `?=`:

```
scramble_history merge -q 'event_description?=["3x3 CFOP", "2x2"]' -a stats
```

Note: The right side of `?=` is JSON

To quickly review my own stats, I have a shell function like:

```bash
cube-stats() {
	scramble_history merge -q 'event_description?=["3x3 CFOP", "3x3 CFOP OH", "2x2", "4x4"]' -a stats -g event_description "$@"
}
```

#### drop/limit

`drop:n` or `limit:n` where `n` is a number. This can be used in between commands to update the current solve list.

Drop removes `n` items at the beginning of the list, limit keeps the first `n` items. For example:

```
scramble_history merge -q 'puzzle==222' -q Ao5 -q 'drop:3' -q Mo2
Ao5: 6.437 = 5.680 7.220 (DNF) 6.410 (5.480)
Mo2: 5.945 = 6.410 5.480
```

```
$ scramble_history merge -q 'event_description==3x3 CFOP' -q 'limit:5' -q dump
19.520
16.040
18.240
21.780
23.980
```

#### dump

Prints the time/description (if DNF) for each solve:

```
$ scramble_history merge -q 'puzzle==222' -q 'limit:5' -q dump
5.680
7.220
DNF
6.410
5.480
```

### best

Prints the best solve from a list of solves:

```
$ scramble_history merge -q 'puzzle==222' -q best
3.121
```

### first/head tail/last

These let you take the first or last `n` items, like `limit`. To get your most recent `Ao5`:

```bash
$ scramble_history merge --no-reverse -q 'event_description==4x4' -q 'last:5' -q ao5
Ao5: 1:44.160 = 1:49.547 1:45.144 1:37.790 (1:52.195) (1:32.934)
```

#### compute averages

`Aon` or `Mon`, where 'n' is a number. Examples: `Ao5`, `Ao500`, `Mo10`

## wca results downloader/extractor

This is a WIP -- it does allow you to download the export and extract your times, but not relate those directly to the scrambles from each group

Downloads the TSV export from <https://www.worldcubeassociation.org/results/misc/export.html> and lets you extract records/scrambles from those rounds from the giant TSV files for your WCA user ID

Also extracts competition/location data for any competitions you've attended

```
$ scramble_history export wca update
[I 221017 23:02:52 wca_export:80] Downloading TSV export...
[I 221017 23:02:58 wca_export:96] Saved TSV export to /home/sean/.cache/wca_export/tsv
$ scramble_history export wca extract -u 2017BREC02
...

$ scramble_history export wca extract -u 2017BREC02 --json | jq '.results_w_scrambles | .[] | .[0] | "\(.competitionId) \(.eventId) \(.value1) \(.value2) \(.value3) \(.value4) \(.value5)"' -r
BerkeleySummer2017 skewb 2009 2326 0 0 0
BerkeleySummer2017 333fm -1 0 0 0 0
BerkeleySummer2017 333 3983 2737 2531 2379 2562
BerkeleySummer2017 222 750 1017 994 791 946
FrozenFingersGhaziabad2018 333oh 3309 3275 3334 3044 3421
BayAreaSpeedcubin132019 444 -1 13954 0 0 0
BayAreaSpeedcubin132019 222 800 599 611 575 784
BayAreaSpeedcubin132019 skewb 1702 2182 794 1404 1495
BayAreaSpeedcubin132019 333 1757 3154 2065 2063 1998
BayAreaSpeedcubin132019 333oh 3988 3233 3416 4600 3839
BayAreaSpeedcubin212019 333 1674 1603 1322 1732 1854
BayAreaSpeedcubin212019 333 2114 1765 1913 1691 2096
BayAreaSpeedcubin212019 444 11331 10607 0 0 0
BayAreaSpeedcubin212019 pyram 1592 1934 -1 2088 1521
BayAreaSpeedcubin212019 skewb 1272 1999 1924 1222 2143
```

## Tests

```bash
git clone 'https://github.com/seanbreckenridge/scramble-history'
cd ./scramble-history
pip install '.[testing]'
pytest
flake8 ./scramble_history
mypy ./scramble_history
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/seanbreckenridge/scramble-history",
    "name": "scramble-history",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "cubing data",
    "author": "Sean Breckenridge",
    "author_email": "seanbrecke@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/49/43/49f98f6f4b855ff7d1f8012fc2e28ea4ca2842cc35fad5c1087ec77b869a/scramble_history-0.1.15.tar.gz",
    "platform": null,
    "description": "# scramble-history\n\nParses your rubiks cube solve history from [cstimer.net](https://cstimer.net/), [cubers.io](https://www.cubers.io/), [twistytimer](https://play.google.com/store/apps/details?id=com.aricneto.twistytimer&hl=en_US&gl=US)\n\n.. and combines/merges solves from those sources into a single format, allowing you to do statistics/giving you uniform averages/a full history\n\n## Installation\n\nRequires `python3.8+`\n\nTo install with pip, run:\n\n    pip install scramble_history\n\nTo install JSON/graph support: `pip install scramble_history[optional]`\n\n## Input Formats\n\nIf theres some other format you'd like to use, feel free to [open an issue](https://github.com/seanbreckenridge/scramble-history/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) (ideally with a data export so I can try to parse it)\n\n### cstimer\n\nTo use, export cstimer.net solves to a file, which `scramble_history parse cstimer` accepts as input:\n\n```\n$ scramble_history parse cstimer ~/Downloads/cstimer_20221014_231808.txt\n\nUse sess to review session data\n\nIn [1]: sess[0].raw_scramble_type\nOut[1]: '333'\n\nIn [2]: sess[0].solves[-1]\nOut[2]: Solve(scramble=\"D U2 F2 U' F2 R2 D B2 U' L2 F2 U2 B R U F' L U2 L2 F U'\", comment='', solve_time=Decimal('25.248'), penalty=Decimal('0'), dnf=False, when=datetime.datetime(2022, 10, 15, 6, 8, 8, tzinfo=datetime.timezone.utc))\n```\n\nOr to dump to JSON:\n\n```\n$ scramble_history parse cstimer -j ~/data/cubing/cstimer/1665942943939.json | jq '.[].solves | .[0]'\n{\n  \"scramble\": \"F U' F2 U R2 D L2 F2 U B2 D' L2 D2 R F' U R2 D L2 F' L\",\n  \"comment\": \"\",\n  \"solve_time\": \"25.969\",\n  \"penalty\": \"0\",\n  \"dnf\": false,\n  \"when\": \"2022-10-11T03:24:27+00:00\"\n}\n```\n\nTo backup my <http://cstimer.net> data automatically, I use [cstimer-save-server](https://github.com/seanbreckenridge/cstimer-save-server)\n\n### twistytimer | cubers.io\n\nParses the export for the [TwistyTimer](https://play.google.com/store/apps/details?id=com.aricneto.twistytimer&hl=en_US&gl=US) android app, which [cubers.io](https://www.cubers.io/) also exports to:\n\n```\n$ scramble_history parse twistytimer --json Backup_2022-10-17_20-19.txt | jq '.[0]'\n{\n  \"puzzle\": \"333\",\n  \"category\": \"Normal\",\n  \"scramble\": \"F L2 B' F' D2 R2 D2 F2 L2 U2 F2 R' F' U2 L2 B D L' B U B2\",\n  \"time\": \"19.86\",\n  \"penalty\": \"0\",\n  \"dnf\": false,\n  \"when\": \"2022-10-18T02:00:42.099000+00:00\",\n  \"comment\": \"\"\n}\n```\n\nNote: for `cubers.io`, the 'when' (datetime when you did the solve) is the same for every solve in a competition (in other words, when the competition began)\n\n## merge\n\n```\nUsage: scramble_history merge [OPTIONS] [DATAFILES]\n\n  merge solves from different data sources together\n\n  To provide input, either define a config file, or pass paths like:\n\n  --cstimer ~/Downloads/cstimer.json\n  --twistytimer ~/Downloads/*twistytimer*.txt\n\nOptions:\n  -s, --sourcemap-file FILE       Data file which saves choices on how to map solves from different sources\n                                  [default: /home/sean/.config/scramble_history/sourcemap.json]\n  -a, --action [json|repl|stats]  what to do with merged solves  [default: repl]\n  -C, --check                     Dont print/interact, just check that all solves are transformed properly\n  -g, --group-by [puzzle|event_code|event_description]\n                                  Group parsed results by key\n  -G, --graph                     graph grouped results\n  -O, --graph-opt [show|save|date-axis|kitty-print|annotate|annotate-average]\n                                  graph options\n  -q, --query TEXT                Solves to filter to, or actions to run\n  -s, --sort-by [when]            Sort the resulting solves\n  -r, --reverse / --no-reverse    Reverse the sort for --sort-by. Default is --no-reverse, stats uses\n                                  --reverse\n  --help                          Show this message and exit.\n```\n\nThe merge command lets you combine solves from different sources into a normalized schema. It does this by prompting you to define attributes from each solve to look for, and then converts any solve it finds with those values to the same description. For example:\n\n```json\n{\n  \"source_class_name\": \"scramble_history.cstimer.Solve\",\n  \"source_fields_match\": {\n    \"name\": \"3x3\",\n    \"raw_scramble_type\": \"333\"\n  },\n  \"transformed_puzzle\": \"333\",\n  \"transformed_event_code\": \"WCA\",\n  \"transformed_event_description\": \"3x3 CFOP\"\n}\n```\n\nWhenever it finds the same `class`, `name` and `raw_scramble_type` (fields from `cstimer.Solve`), it tags them with the `puzzle`, `event_code` and `event_description`. Those are entered by you (once per new type of solve), and then saved to `~/.config/scramble_history/sourcemap.json`. As an example of the generated file, you can see mine [here](https://sean.fish/d/scramble_history/sourcemap.json?redirect)\n\nThe merge command accepts options which describe the filetype, and then multiple files, removing any duplicate solves it finds. E.g.:\n\n```bash\nscramble_history merge --action json \\\n    --cstimer ~/data/cubing/cstimer/*.json \\\n    --twistytimer ~/data/cubing/phone_twistytimer/* ~/data/cubing/cubers_io/* ~/data/cubing/manual.csv\n```\n\nYou can also create a config file at `~/.config/scramble_history/files.yaml` (config directory location can be changed with the `SCRAMBLE_HISTORY_CONFIG_DIR` environment variable) which contains similar info, so you don't have to type it out every time:\n\n```yaml\ncstimer:\n  - ~/data/cubing/cstimer/*.json\ntwistytimer:\n  - ~/data/cubing/manual.csv\n  - ~/data/cubing/phone_twistytimer/*.txt\n  - ~/data/cubing/cubers_io/*.txt\n```\n\nExamples:\n\n```bash\n$ scramble_history merge -g event_description -a json\n | jq 'to_entries[] | \"\\(.value | length) \\(.key)\"' -r | sort -nr\n\n834 3x3 CFOP\n295 2x2\n112 3x3 CFOP OH\n99 3x3 2-GEN <RU>\n95 3x3 LSE\n65 4x4\n37 3x3 Roux\n35 Skewb\n25 Pyraminx\n20 3x3 F2L\n5 3x3 Roux OH\n```\n\nIt can also calculate running averages across your merged data:\n\n```\n[ ~/Repos/scramble-history | master ] $ python3 -m scramble_history merge -a stats\nPassed 'stats' with no '--group_by', grouping by 'event_description'\n===================\n3x3 CFOP\n===================\nBest => 11.880\nWorst => 48.049\nMost recent Ao5 => 17.436 = 16.551 17.682 (24.941) (16.531) 18.076\nGlobal Mean (841/847) => 19.681\nSolve Count => 847\n\n3x3 CFOP    Current      Best\n----------  ---------  ------\nAo5         17.436     14.647\nAo12        18.605     16.898\nAo50        18.725     18.092\nAo100       DNF        18.444\n===================\n2x2\n===================\nBest => 3.121\nWorst => 50.170\nMost recent Ao5 => 6.403 = (7.240) 6.480 6.250 (6.150) 6.480\nGlobal Mean (317/318) => 8.820\nSolve Count => 318\n\n2x2      Current    Best\n-----  ---------  ------\nAo5        6.403   5.58\nAo12       7.494   6.252\nAo50       7.574   7.214\nAo100      7.553   7.427\n===================\n4x4\n===================\nBest => 1:15.592\nWorst => 5:39.830\nMost recent Ao5 => 1:33.173 = (1:27.770) (1:41.280) 1:38.735 1:28.795 1:31.988\nGlobal Mean (129/129) => 2:25.470\nSolve Count => 129\n\n4x4    Current    Best\n-----  ---------  --------\nAo5    1:33.173   1:33.173\nAo12   1:36.256   1:36.256\nAo50   1:51.013   1:51.013\nAo100  2:09.471   2:09.471\n===================\n3x3 CFOP OH\n===================\nBest => 19.890\nWorst => 1:32.280\nMost recent Ao5 => 30.640 = 29.760 (26.800) 31.410 (32.450) 30.750\nGlobal Mean (117/117) => 36.919\nSolve Count => 117\n\n3x3 CFOP OH      Current    Best\n-------------  ---------  ------\nAo5               30.64   26.61\nAo12              29.123  29.123\nAo50              32.776  32.285\nAo100             32.923  32.923\n```\n\nOr provide other commands to run instead of `--action stats`:\n\n```\nscramble_history merge -q 'event_description==3x3 CFOP' -q Mo3 -q Ao5 -q Ao12\nMo3: 21.413 = 25.969 22.220 16.050\nAo5: 22.037 = (25.969) 22.220 (16.050) 22.697 21.193\nAo12: 19.297 = (25.969) 22.220 (16.050) 22.697 21.193 16.210 16.338 17.824 19.697 21.107 16.538 19.144\n```\n\n### graphs\n\nNote: this requires `seaborn`, install with `pip install 'scramble-history[optional]'`\n\nFor each group selected by `--group-by`, this creates a graph. By default, this pauses at each group and shows the graph so you can move around/zoom in\n\nTo save to a png, use `--graph-opt save`. If you use [kitty](https://sw.kovidgoyal.net/kitty/), can also print these directly in the terminal:\n\n<img src=\"https://github.com/seanbreckenridge/scramble-history/blob/master/.github/kitty.png?raw=true\" height=500>\n\nCan also be used in combination with `--query drop:` and `--query limit:` to only graph a portion of your history. For example to graph a rolling `ao12` from some time ago:\n\n`scramble_history merge -q 'event_description==3x3 CFOP' -q drop:750 -q limit:12 --no-reverse -g event_description -G --graph-opt kitty-print`\n\n<img src=\"https://github.com/seanbreckenridge/scramble-history/blob/master/.github/ao12.png?raw=true\" height=300>\n\nCan provide the `annotate` options if you want to add some of the text onto the graph:\n\n`scramble_history merge -q 'event_description==4x4' -q 'last:5' -G --graph-opt annotate --graph-opt annotate-average`\n\n<img src=\"https://github.com/seanbreckenridge/scramble-history/blob/master/.github/annotated.png?raw=true\" height=300>\n\n### merge query commands:\n\n#### filter\n\n`'attribute_name==attribute_value'` - lets you filter based on any of the string values, e.g.:\n\n```\ncomment\nevent_code\nevent_description\npuzzle\nscramble\n```\n\nExamples:\n\n- `'event_description==3x3 CFOP'`\n- `'puzzle==skewb'`\n- `'puzzle==222'`\n\nWhat the description/puzzle names are depend on what you set them as while merging\n\n#### filterin\n\nIf you want to match one of many items, e.g. filter just down to `3x3` and `2x2` solves, use `?=`:\n\n```\nscramble_history merge -q 'event_description?=[\"3x3 CFOP\", \"2x2\"]' -a stats\n```\n\nNote: The right side of `?=` is JSON\n\nTo quickly review my own stats, I have a shell function like:\n\n```bash\ncube-stats() {\n\tscramble_history merge -q 'event_description?=[\"3x3 CFOP\", \"3x3 CFOP OH\", \"2x2\", \"4x4\"]' -a stats -g event_description \"$@\"\n}\n```\n\n#### drop/limit\n\n`drop:n` or `limit:n` where `n` is a number. This can be used in between commands to update the current solve list.\n\nDrop removes `n` items at the beginning of the list, limit keeps the first `n` items. For example:\n\n```\nscramble_history merge -q 'puzzle==222' -q Ao5 -q 'drop:3' -q Mo2\nAo5: 6.437 = 5.680 7.220 (DNF) 6.410 (5.480)\nMo2: 5.945 = 6.410 5.480\n```\n\n```\n$ scramble_history merge -q 'event_description==3x3 CFOP' -q 'limit:5' -q dump\n19.520\n16.040\n18.240\n21.780\n23.980\n```\n\n#### dump\n\nPrints the time/description (if DNF) for each solve:\n\n```\n$ scramble_history merge -q 'puzzle==222' -q 'limit:5' -q dump\n5.680\n7.220\nDNF\n6.410\n5.480\n```\n\n### best\n\nPrints the best solve from a list of solves:\n\n```\n$ scramble_history merge -q 'puzzle==222' -q best\n3.121\n```\n\n### first/head tail/last\n\nThese let you take the first or last `n` items, like `limit`. To get your most recent `Ao5`:\n\n```bash\n$ scramble_history merge --no-reverse -q 'event_description==4x4' -q 'last:5' -q ao5\nAo5: 1:44.160 = 1:49.547 1:45.144 1:37.790 (1:52.195) (1:32.934)\n```\n\n#### compute averages\n\n`Aon` or `Mon`, where 'n' is a number. Examples: `Ao5`, `Ao500`, `Mo10`\n\n## wca results downloader/extractor\n\nThis is a WIP -- it does allow you to download the export and extract your times, but not relate those directly to the scrambles from each group\n\nDownloads the TSV export from <https://www.worldcubeassociation.org/results/misc/export.html> and lets you extract records/scrambles from those rounds from the giant TSV files for your WCA user ID\n\nAlso extracts competition/location data for any competitions you've attended\n\n```\n$ scramble_history export wca update\n[I 221017 23:02:52 wca_export:80] Downloading TSV export...\n[I 221017 23:02:58 wca_export:96] Saved TSV export to /home/sean/.cache/wca_export/tsv\n$ scramble_history export wca extract -u 2017BREC02\n...\n\n$ scramble_history export wca extract -u 2017BREC02 --json | jq '.results_w_scrambles | .[] | .[0] | \"\\(.competitionId) \\(.eventId) \\(.value1) \\(.value2) \\(.value3) \\(.value4) \\(.value5)\"' -r\nBerkeleySummer2017 skewb 2009 2326 0 0 0\nBerkeleySummer2017 333fm -1 0 0 0 0\nBerkeleySummer2017 333 3983 2737 2531 2379 2562\nBerkeleySummer2017 222 750 1017 994 791 946\nFrozenFingersGhaziabad2018 333oh 3309 3275 3334 3044 3421\nBayAreaSpeedcubin132019 444 -1 13954 0 0 0\nBayAreaSpeedcubin132019 222 800 599 611 575 784\nBayAreaSpeedcubin132019 skewb 1702 2182 794 1404 1495\nBayAreaSpeedcubin132019 333 1757 3154 2065 2063 1998\nBayAreaSpeedcubin132019 333oh 3988 3233 3416 4600 3839\nBayAreaSpeedcubin212019 333 1674 1603 1322 1732 1854\nBayAreaSpeedcubin212019 333 2114 1765 1913 1691 2096\nBayAreaSpeedcubin212019 444 11331 10607 0 0 0\nBayAreaSpeedcubin212019 pyram 1592 1934 -1 2088 1521\nBayAreaSpeedcubin212019 skewb 1272 1999 1924 1222 2143\n```\n\n## Tests\n\n```bash\ngit clone 'https://github.com/seanbreckenridge/scramble-history'\ncd ./scramble-history\npip install '.[testing]'\npytest\nflake8 ./scramble_history\nmypy ./scramble_history\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "parses scramble history from cstimer.net and other sources",
    "version": "0.1.15",
    "project_urls": {
        "Homepage": "https://github.com/seanbreckenridge/scramble-history"
    },
    "split_keywords": [
        "cubing",
        "data"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be9b108909f5b21eed0b0bd48518d789aac0cf0ab88a2609edcb4c54e5004b49",
                "md5": "af8ea5e4b39a8f7f579ae0e6febf2291",
                "sha256": "bd64e84bc268a4e09346567dd10894c37d0d71988e906e897600ccf32f5c5568"
            },
            "downloads": -1,
            "filename": "scramble_history-0.1.15-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "af8ea5e4b39a8f7f579ae0e6febf2291",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 31831,
            "upload_time": "2023-09-11T05:14:09",
            "upload_time_iso_8601": "2023-09-11T05:14:09.195762Z",
            "url": "https://files.pythonhosted.org/packages/be/9b/108909f5b21eed0b0bd48518d789aac0cf0ab88a2609edcb4c54e5004b49/scramble_history-0.1.15-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "494349f98f6f4b855ff7d1f8012fc2e28ea4ca2842cc35fad5c1087ec77b869a",
                "md5": "66c27b03fc2b67a6d4e4e61bd066597e",
                "sha256": "5d3e3e7503d45baae51c4b9948656a8879f6dd6756e6bfcff26525d4f84ff8bc"
            },
            "downloads": -1,
            "filename": "scramble_history-0.1.15.tar.gz",
            "has_sig": false,
            "md5_digest": "66c27b03fc2b67a6d4e4e61bd066597e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 35360,
            "upload_time": "2023-09-11T05:14:11",
            "upload_time_iso_8601": "2023-09-11T05:14:11.055939Z",
            "url": "https://files.pythonhosted.org/packages/49/43/49f98f6f4b855ff7d1f8012fc2e28ea4ca2842cc35fad5c1087ec77b869a/scramble_history-0.1.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-11 05:14:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "seanbreckenridge",
    "github_project": "scramble-history",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "click",
            "specs": [
                [
                    ">=",
                    "8.0"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "logzero",
            "specs": []
        },
        {
            "name": "IPython",
            "specs": []
        },
        {
            "name": "platformdirs",
            "specs": []
        },
        {
            "name": "pytimeparse",
            "specs": []
        },
        {
            "name": "autotui",
            "specs": [
                [
                    ">=",
                    "0.4.3"
                ]
            ]
        },
        {
            "name": "more_itertools",
            "specs": []
        },
        {
            "name": "pyyaml",
            "specs": []
        },
        {
            "name": "tabulate",
            "specs": []
        },
        {
            "name": "simplejson",
            "specs": []
        }
    ],
    "lcname": "scramble-history"
}
        
Elapsed time: 0.11623s