Skip to main content

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-files to respect .gitignore and other exclude settings.

Installation

`code pis 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

`code 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: lines or tree
  • --output: Output file for CSV report. Default is token_report.csv. Creative, huh?
  • --verbose: Increase output verbosity

Example

code 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

countmytokens-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

countmytokens-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file countmytokens-0.1.0.tar.gz.

File metadata

  • Download URL: countmytokens-0.1.0.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

Hashes for countmytokens-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3695089eb69d136fdd181a2c189844b32a826eb12fec014d32436003b157284a
MD5 75ee54dd2dec99d4febfcfeabec48824
BLAKE2b-256 a22e070909891b3f92a60a4cdfca08ff60c39dba9e6e05d34a7b2e750cbb239b

See more details on using hashes here.

Provenance

The following attestation bundles were made for countmytokens-0.1.0.tar.gz:

Publisher: publish.yml on autoscatto/countmytokens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file countmytokens-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: countmytokens-0.1.0-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

Hashes for countmytokens-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ca2e312df7343d06b85156bfec3c6cb8b998e798a2d334796f0713e7f175857
MD5 47a40b331d76de676f30dd5cd0184793
BLAKE2b-256 0ada7bbeac7801f20bd065b6884d1ada9634a4c1445a49030a6941601e6866ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for countmytokens-0.1.0-py3-none-any.whl:

Publisher: publish.yml on autoscatto/countmytokens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page