<commit_before>pycodegolf
==========

A relaxed code golf evaluator for python code. Currently both whitespace and
whole comment lines are stripped from the count so you can be happy to keep
some degree of legibility.

Either put the pygolf.py file in your path or run from this location with
something like:

```sh
path/to/pygolf.py potentially/different/path/to/examplefile
```

e.g.

```sh
./pygolf.py pygolf.py
```

currently outputs

```
97
```<commit_msg>adding mentions of expected causes of miscounting<commit_after>pycodegolf
==========

A relaxed code golf evaluator for python code. Currently both whitespace and
whole comment lines are stripped from the count so you can be happy to keep
some degree of legibility.


Usage
-----

Either put the pygolf.py file in your path or run from this location with
something like:

```sh
path/to/pygolf.py potentially/different/path/to/examplefile
```

e.g.

```sh
./pygolf.py pygolf.py
```

currently outputs

```
97
```

Limitations
-----------

This should not be used to
* evaluate multi-file solutions.
* evaluate code written in a language where # is not used at the beginning of a line to indicate a whole line comment

Additionally:
* in-line comments are kept in the line count - # has to be the first character in a line to be ignored
* using python's triple quoted strings as a form of comment will also be included in the final total
* lines in a triple quoted string with # as the first character in a line will be excluded from the count
{'fraction_non_alphanumeric': 0.08388814913448735, 'fraction_numerical': 0.002663115845539281, 'mean_word_length': 3.9278688524590164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1103031', 'n_tokens_mistral': 441, 'n_tokens_neox': 412, 'n_words': 214}