Library and command-line tool to gather stats on typeshed packages
MIT License
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:
.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).typeshed-stats --typeshed-dir <PATH_TO_TYPESHED_CLONE> --to-json emoji redis
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)
pip install typeshed-stats[rich]
to install the packagetypeshed-stats --help
for information about various optionsI'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.)
cd
into itpip install -e .[dev]
.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.