Count tokens in dir or git repos
Project description
countmytokens
Ever wondered how big in tokens are your codebase? No? Well, too bad, because countmytokens is here to count them anyway.
Features
- Token Counting: Counts tokens in all your files.
- Binary File Skipping: Skipps binary files because counting tokens in those would be just silly.
- CSV Reports: Generates CSV reports so you can pretend to analyze the data.
- Tree Reports: Creates tree reports to visualize the token hierarchy.
- Git Integration: If it detects a Git repository, it uses
ls-filesto respect.gitignoreand other exclude settings.
Installation
pip install countmytokens
For users who prefer to use pipx, you can install it globally:
pipx install countmytokens
If you are using uv, you can install it with:
uv tool install countmytokens
Usage
countmytokens /path/to/your/code/project
Options
- --exclude*: Paths to exclude. Because some files just don't deserve to be counted.
- --include-binary*: Include binary files in the token count. If you're into that sort of thing.
- --max-files*: Maximum concurrent file operations. Default is 100. Because why not?
- --report*:
Choose your report format:
linesortree - --output:
Output file for CSV report. Default is
token_report.csv. Creative, huh? - --verbose: Increase output verbosity
Example
countmytokens /path/to/your/code/project --exclude venv --report tree --verbose
Contributing
Feel free to contribute. Or don't. It's your life.
LICENSE MIT License. Because sharing is caring.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file countmytokens-0.1.1.tar.gz.
File metadata
- Download URL: countmytokens-0.1.1.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0907d6661710b17b096e961c3108aed81d29147b287e4d1ea8a02a0648eda66
|
|
| MD5 |
a27f8c696877686c8c0edc7a613cabf7
|
|
| BLAKE2b-256 |
c1964e0c6d2e24dead14f1282dd9187ec94e765d68f8e18f5bf7909ba2b72801
|
Provenance
The following attestation bundles were made for countmytokens-0.1.1.tar.gz:
Publisher:
publish.yml on autoscatto/countmytokens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
countmytokens-0.1.1.tar.gz -
Subject digest:
a0907d6661710b17b096e961c3108aed81d29147b287e4d1ea8a02a0648eda66 - Sigstore transparency entry: 165245743
- Sigstore integration time:
-
Permalink:
autoscatto/countmytokens@3f45803c3f2df29455b6d8a0ff9f1ceca0a42048 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/autoscatto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3f45803c3f2df29455b6d8a0ff9f1ceca0a42048 -
Trigger Event:
push
-
Statement type:
File details
Details for the file countmytokens-0.1.1-py3-none-any.whl.
File metadata
- Download URL: countmytokens-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78a1c2d37b204ba27d96e1e4d7e1261001ac3bda2a0d6bac3519a8de07d592c6
|
|
| MD5 |
96d7a6c82f20bc77abd81de249c90317
|
|
| BLAKE2b-256 |
140b7d3363f71dacc7f2d0c530322ebdf3cadd70c4e82b2954431a57a45e8583
|
Provenance
The following attestation bundles were made for countmytokens-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on autoscatto/countmytokens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
countmytokens-0.1.1-py3-none-any.whl -
Subject digest:
78a1c2d37b204ba27d96e1e4d7e1261001ac3bda2a0d6bac3519a8de07d592c6 - Sigstore transparency entry: 165245745
- Sigstore integration time:
-
Permalink:
autoscatto/countmytokens@3f45803c3f2df29455b6d8a0ff9f1ceca0a42048 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/autoscatto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3f45803c3f2df29455b6d8a0ff9f1ceca0a42048 -
Trigger Event:
push
-
Statement type: