Library and command-line tool to gather stats on typeshed packages
Project description
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?
- Run
pip install typeshed-stats[rich]
to install the package - 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?
- Clone the repo and
cd
into it - Create and activate a virtual environment
- Run
pip install -e .[dev]
- Either run the linters/tests individually (see the
.github/workflows
directory for details about what's run in CI) or use thescripts/runtests.py
convenience script to run them all in succession.
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
File details
Details for the file typeshed_stats-24.11.24.tar.gz
.
File metadata
- Download URL: typeshed_stats-24.11.24.tar.gz
- Upload date:
- Size: 14.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bab83d4c48be37b29f545a846cf72214fe00a4848e5a6bb8a544bb34c9b8bb95 |
|
MD5 | 4f675cab9961b27cf5d34a2fa95849f2 |
|
BLAKE2b-256 | a75f6ab9aeda5550d45df1535217b4df86debcf79c51a1fe323ef488becafc5f |
File details
Details for the file typeshed_stats-24.11.24-py3-none-any.whl
.
File metadata
- Download URL: typeshed_stats-24.11.24-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.5.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa50165a2c040dcbf2279ce1b7a5e559bf0078ee167b234bd16a69c4abda808b |
|
MD5 | 0114fed06d48ef3a87cb7b9043d9d1e5 |
|
BLAKE2b-256 | 7fe134e6a0b08b57eba7a5714cac893b5021105a368c747cb827071c9a582534 |