Metadata-Version: 2.3
Name: typeshed_stats
Version: 24.5.22
Summary: Library and command-line tool to gather stats on typeshed packages
Project-URL: Homepage, https://github.com/AlexWaygood/typeshed-stats
Project-URL: Bug Tracker, https://github.com/AlexWaygood/typeshed-stats/issues
Author-email: Alex Waygood <alex.waygood@gmail.com>
License: MIT
License-File: LICENSE
Keywords: stubs,typeshed,typing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: aiohttp>=3.9.0; python_version >= '3.13'
Requires-Dist: aiohttp[speedups]>=3.9.0; python_version < '3.13'
Requires-Dist: attrs>=22.2.0
Requires-Dist: cattrs
Requires-Dist: jinja2>=3
Requires-Dist: packaging
Requires-Dist: pathspec>=0.10.3
Requires-Dist: tomli; python_version < '3.11'
Provides-Extra: dev
Requires-Dist: beautifulsoup4<5,>=4; extra == 'dev'
Requires-Dist: covdefaults==2.3.0; extra == 'dev'
Requires-Dist: coverage==7.4.4; extra == 'dev'
Requires-Dist: markdown<4,>=3; extra == 'dev'
Requires-Dist: markdown==3.5.2; extra == 'dev'
Requires-Dist: mkdocs-macros-plugin==1.0.5; extra == 'dev'
Requires-Dist: mkdocs-material==9.5.16; extra == 'dev'
Requires-Dist: mkdocs==1.5.3; extra == 'dev'
Requires-Dist: mkdocstrings-python==1.9.0; extra == 'dev'
Requires-Dist: mkdocstrings==0.24.1; extra == 'dev'
Requires-Dist: mypy==1.9.0; extra == 'dev'
Requires-Dist: pytest-antilru==1.1.1; extra == 'dev'
Requires-Dist: pytest-asyncio==0.23.6; extra == 'dev'
Requires-Dist: pytest-dependency==0.6.0; extra == 'dev'
Requires-Dist: pytest-mock==3.14.0; extra == 'dev'
Requires-Dist: pytest-subtests==0.12.1; extra == 'dev'
Requires-Dist: pytest==8.1.1; extra == 'dev'
Requires-Dist: rich; extra == 'dev'
Requires-Dist: rich-argparse>=1; extra == 'dev'
Requires-Dist: ruff==0.3.5; extra == 'dev'
Requires-Dist: types-beautifulsoup4==4.12.0.20240229; extra == 'dev'
Requires-Dist: types-markdown==3.6.0.20240316; extra == 'dev'
Provides-Extra: docs
Requires-Dist: markdown==3.5.2; extra == 'docs'
Requires-Dist: mkdocs-macros-plugin==1.0.5; extra == 'docs'
Requires-Dist: mkdocs-material==9.5.16; extra == 'docs'
Requires-Dist: mkdocs==1.5.3; extra == 'docs'
Requires-Dist: mkdocstrings-python==1.9.0; extra == 'docs'
Requires-Dist: mkdocstrings==0.24.1; extra == 'docs'
Requires-Dist: rich; extra == 'docs'
Requires-Dist: rich-argparse>=1; extra == 'docs'
Provides-Extra: misc-lint
Requires-Dist: ruff==0.3.5; extra == 'misc-lint'
Provides-Extra: pytest
Requires-Dist: beautifulsoup4<5,>=4; extra == 'pytest'
Requires-Dist: covdefaults==2.3.0; extra == 'pytest'
Requires-Dist: coverage==7.4.4; extra == 'pytest'
Requires-Dist: markdown<4,>=3; extra == 'pytest'
Requires-Dist: pytest-antilru==1.1.1; extra == 'pytest'
Requires-Dist: pytest-asyncio==0.23.6; extra == 'pytest'
Requires-Dist: pytest-dependency==0.6.0; extra == 'pytest'
Requires-Dist: pytest-mock==3.14.0; extra == 'pytest'
Requires-Dist: pytest-subtests==0.12.1; extra == 'pytest'
Requires-Dist: pytest==8.1.1; extra == 'pytest'
Requires-Dist: rich; extra == 'pytest'
Requires-Dist: rich-argparse>=1; extra == 'pytest'
Provides-Extra: rich
Requires-Dist: rich; extra == 'rich'
Requires-Dist: rich-argparse>=1; extra == 'rich'
Provides-Extra: typecheck
Requires-Dist: beautifulsoup4<5,>=4; extra == 'typecheck'
Requires-Dist: covdefaults==2.3.0; extra == 'typecheck'
Requires-Dist: coverage==7.4.4; extra == 'typecheck'
Requires-Dist: markdown<4,>=3; extra == 'typecheck'
Requires-Dist: markdown==3.5.2; extra == 'typecheck'
Requires-Dist: mkdocs-macros-plugin==1.0.5; extra == 'typecheck'
Requires-Dist: mkdocs-material==9.5.16; extra == 'typecheck'
Requires-Dist: mkdocs==1.5.3; extra == 'typecheck'
Requires-Dist: mkdocstrings-python==1.9.0; extra == 'typecheck'
Requires-Dist: mkdocstrings==0.24.1; extra == 'typecheck'
Requires-Dist: mypy==1.9.0; extra == 'typecheck'
Requires-Dist: pytest-antilru==1.1.1; extra == 'typecheck'
Requires-Dist: pytest-asyncio==0.23.6; extra == 'typecheck'
Requires-Dist: pytest-dependency==0.6.0; extra == 'typecheck'
Requires-Dist: pytest-mock==3.14.0; extra == 'typecheck'
Requires-Dist: pytest-subtests==0.12.1; extra == 'typecheck'
Requires-Dist: pytest==8.1.1; extra == 'typecheck'
Requires-Dist: rich; extra == 'typecheck'
Requires-Dist: rich-argparse>=1; extra == 'typecheck'
Requires-Dist: types-beautifulsoup4==4.12.0.20240229; extra == 'typecheck'
Requires-Dist: types-markdown==3.6.0.20240316; extra == 'typecheck'
Description-Content-Type: text/markdown

<div align=center>

# typeshed-stats

<img src="https://raw.githubusercontent.com/AlexWaygood/typeshed-stats/main/stats_website/big_logo.png" width="500" alt="A Python in a field of wheat with a shed behind it, golden-red sunset in the background">

<br>

---

## A CLI tool and library to gather stats on [typeshed](https://github.com/python/typeshed)

<br>

[![website](https://img.shields.io/website?down_color=red&down_message=Offline&style=for-the-badge&up_color=green&up_message=Running&url=https%3A%2F%2Falexwaygood.github.io%2Ftypeshed-stats%2F)](https://alexwaygood.github.io/typeshed-stats/)[![build status](https://img.shields.io/github/actions/workflow/status/AlexWaygood/typeshed-stats/test.yml?branch=main&label=Tests&style=for-the-badge)](https://github.com/AlexWaygood/typeshed-stats/actions/workflows/test.yml)
<br>
[![Checked with mypy](https://img.shields.io/badge/mypy-checked-blue?style=for-the-badge)](http://mypy-lang.org/)[![Code style: Ruff](https://img.shields.io/badge/Code_style-Ruff-D7FF64?style=for-the-badge&logo=ruff)](https://github.com/astral-sh/ruff)[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=for-the-badge)](https://pre-commit.ci)
<br>
[![PyPI](https://img.shields.io/pypi/v/typeshed-stats?style=for-the-badge)](https://pypi.org/project/typeshed-stats/)![PyPI - Wheel](https://img.shields.io/pypi/wheel/typeshed-stats?style=for-the-badge)[![license](https://img.shields.io/github/license/AlexWaygood/typeshed-stats?style=for-the-badge)](https://opensource.org/licenses/MIT)

---

<br>
</div>

## What's this project for?

This project is for easy gathering of statistics relating to [typeshed](https://github.com/python/typeshed)'s stubs. As well as being a CLI tool and library, it also powers [a website](https://alexwaygood.github.io/typeshed-stats/) 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:

```python
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
1. Run `typeshed-stats --help` for information about various options

## Are there any examples of things this script can produce, other than [the website](https://alexwaygood.github.io/typeshed-stats/)?

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
1. Create and activate a virtual environment
1. Run `pip install -e .[dev]`
1. 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.
