Skip to main content

Library and command-line tool to gather stats on typeshed packages

Project description

typeshed-stats

A Python in a field of wheat with a shed behind it, golden-red sunset in the background

A CLI tool and library to gather stats on typeshed


websitebuild status
Checked with mypyCode style: Ruffpre-commit
PyPIPyPI - Wheellicense



What's this project for?

This project is for easy gathering of statistics relating to typeshed's stubs. As well as being a CLI tool and library, it also powers a website where stats about typeshed's stubs are uploaded twice a day.

This project was created by Alex Waygood. It is not necessarily endorsed by any of the other typeshed maintainers.

Some examples of things you can do from the command line:

  • Create a .csv file with stats on all typeshed stubs: typeshed-stats --typeshed-dir <PATH_TO_TYPESHED_CLONE> --to-file stats.csv (the .csv file extension will be automatically detected by the script to identify the format required).
  • Pretty-print stats on typeshed stubs for emoji and redis to the terminal, in JSON format: typeshed-stats --typeshed-dir <PATH_TO_TYPESHED_CLONE> --to-json emoji redis
  • Generate a MarkDown file detailing stats on typeshed's stubs for protobuf and the stdlib: typeshed-stats --typeshed-dir <PATH_TO_TYPESHED_CLONE> --to-file stats.md stdlib protobuf

Example usage of the Python-level API:

from typeshed_stats.gather import tmpdir_typeshed, gather_stats

with tmpdir_typeshed() as typeshed:
    stats_on_all_packages = gather_stats_on_multiple_packages(typeshed_dir=typeshed)

How can I use this?

  1. Run pip install typeshed-stats[rich] to install the package
  2. Run typeshed-stats --help for information about various options

Are there any examples of things this script can produce, other than the website?

I'm glad you asked! They're in the examples/ folder in this repo. (These examples are generated using the regenerate.py script in the scripts/ directory.)

How do I run tests/linters?

  1. Clone the repo and cd into it
  2. Create and activate a virtual environment
  3. Run pip install -e .[dev]
  4. Either run the linters/tests individually (see the .github/workflows directory for details about what's run in CI) or use the scripts/runtests.py convenience script to run them all in succession.

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

typeshed_stats-24.11.17.tar.gz (14.9 MB view details)

Uploaded Source

Built Distribution

typeshed_stats-24.11.17-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file typeshed_stats-24.11.17.tar.gz.

File metadata

  • Download URL: typeshed_stats-24.11.17.tar.gz
  • Upload date:
  • Size: 14.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.5.2

File hashes

Hashes for typeshed_stats-24.11.17.tar.gz
Algorithm Hash digest
SHA256 24b35b98ebbdab5fac20757563854c17114f66831e3832412448eb53b6645d74
MD5 4b554b3236926ba00f8c161a3959e7bb
BLAKE2b-256 f738b47570f04b725172dd426e53ec4661e58554c7d5f990b14418788d224eb2

See more details on using hashes here.

File details

Details for the file typeshed_stats-24.11.17-py3-none-any.whl.

File metadata

File hashes

Hashes for typeshed_stats-24.11.17-py3-none-any.whl
Algorithm Hash digest
SHA256 e11b905173b2ebff1d013766f596f488ba442a9935bcd1a7a73add8697966d6d
MD5 30c5c86fbe3af4b5ddba439af3dcbe92
BLAKE2b-256 d7a680c322eb4cb34e7de5410f56cc6e633e489b97722f18b98808989bcb117a

See more details on using hashes here.

Supported by

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