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
  • Open the upstream repository URLs for requests, Flask-SocketIO and CPython in your default web browser: typeshed-stats --typeshed-dir <PATH_TO_TYPESHED_CLONE> --upstream-repo requests Flask-SocketIO stdlib

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


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

typeshed_stats-26.4.19.tar.gz (996.0 kB view details)

Uploaded Source

Built Distribution

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

typeshed_stats-26.4.19-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: typeshed_stats-26.4.19.tar.gz
  • Upload date:
  • Size: 996.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for typeshed_stats-26.4.19.tar.gz
Algorithm Hash digest
SHA256 afd99432f17e898825f835ae71087ee7db92d2898f3264d47e25f1d6c9758e6a
MD5 b5ab1a309fcc824db1c0fb5a5538090c
BLAKE2b-256 7113263f0ef527cce1c2a3f3618ec07a7a880557c8c59179a2c8102775735e1f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: typeshed_stats-26.4.19-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for typeshed_stats-26.4.19-py3-none-any.whl
Algorithm Hash digest
SHA256 1299b37c57b82f887c6b26b38b5e425b510d676c7f038179b8f1a1fc3a1cedcd
MD5 5707b24ce5d588426e9dac1d10a97b9f
BLAKE2b-256 da0d9e97846a09d0528eb427ffba326dd92a8b8f6d99c852d50ce019e47ef53d

See more details on using hashes here.

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