Skip to main content

Generate Python stub files from docstrings

Project description

docstub

[!NOTE] In early development! Docstub is not feature-complete or thoroughly tested yet. Its behavior, configuration or command line interface may change significantly between releases.

docstub is a command-line tool to generate Python stub files. It extracts necessary type information from NumPyDoc style docstrings.

Many packages in the scientific Python ecosystem already describe expected parameter and return types in their docstrings. Docstub aims to take advantage of these and help with the adoption of type annotations. It does so by supporting widely used readable conventions such as array of dtype or iterable of int(s) which are translated into valid type annotations.

Installation & getting started

Please refer to the installation guide and introduction in our official documentation or in docs/ to get started.

Contributing

The best way you can help and contribute right now is by trying docstub out! Feedback to what features might still be missing or where it breaks for you would be greatly appreciated. As well as pointers to where the documentation is confusing and unclear. Feel welcome to open an issue! 🚀

Since docstub is still in early development there isn't an official contribution guide yet. Features and API are still being heavily extended and the internal structure is still somewhat in flux. The development is, in part, motivated by an effort to add type annotations to the scikit-image project. This may inform some short-term priorities and the roadmap.

That said, docstub is a project for the community and welcomes contributions in any form! Please do check in with an issue if you are interested in working on something.

Our project follows the Scientific Python's Code of Conduct.

Acknowledgements

Thanks to docs2stubs by which this project was heavily inspired and influenced.

And thanks to CZI for supporting this work with an EOSS grant.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docstub-0.6.0.tar.gz (94.3 kB view details)

Uploaded Source

Built Distribution

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

docstub-0.6.0-py3-none-any.whl (67.3 kB view details)

Uploaded Python 3

File details

Details for the file docstub-0.6.0.tar.gz.

File metadata

  • Download URL: docstub-0.6.0.tar.gz
  • Upload date:
  • Size: 94.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for docstub-0.6.0.tar.gz
Algorithm Hash digest
SHA256 6130d44dc932bb9b1833b565c1074def41572104bce05aa32b381f804788fdec
MD5 abf9fae140ff5edc2cf1cb80297ee45e
BLAKE2b-256 6a6788138b42bd7cbc4685ec65964ffab418ef4327e137842058a5f02e30bdb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for docstub-0.6.0.tar.gz:

Publisher: cd.yml on scientific-python/docstub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file docstub-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: docstub-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 67.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for docstub-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 142e69ca8fc4d8c5b9f8cc488e363735200bfdf32678eb6b7c10ab8410590cf4
MD5 9cd2c9b404a48a9a70f65c1c78738d54
BLAKE2b-256 ee2b49af1a353fd24f3f941667bb05e7865ee3569856491d838e589eb3adeebc

See more details on using hashes here.

Provenance

The following attestation bundles were made for docstub-0.6.0-py3-none-any.whl:

Publisher: cd.yml on scientific-python/docstub

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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