Skip to main content

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.

Metadata

Release files for typeshed_stats 26.10.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for typeshed_stats 26.10.11
File Size Uploaded
typeshed_stats-26.10.11.tar.gz 998.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for typeshed_stats 26.10.11
File Interpreter ABI Platform
typeshed_stats-26.10.11-py3-none-any.whl Python 3 none any Details

Total release size: 1.0 MB

Release files / typeshed_stats-26.10.11.tar.gz

Download URL typeshed_stats-26.10.11.tar.gz
Size 998.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9e653f1aa79eb92a86698901723de4f8c4fea82db91a362af13cbfe3601a5169
BLAKE2b-256 checksum
How to use checksums
774cab092cbd53b153c385e0f8d4e7375aa0b2b21b7ccd89f1689a2c2d4fc73f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","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}

Release files / typeshed_stats-26.10.11-py3-none-any.whl

Download URL typeshed_stats-26.10.11-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13389c7b1262db725904718653d4f31fb39b15981c8a3902190dff85fa8a1f87
BLAKE2b-256 checksum
How to use checksums
3b3de05c22fd1e97a73cf4b1cca997e7a54196e60e0e24b5572ea570f5a4bb10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","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}

Release history Release notifications | RSS feed

This release

26.10.11 This release

2 release files

23.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page