Skip to main content

Simple convenience function to extract docstring

Project description

https://img.shields.io/pypi/v/gleandoc.svg https://img.shields.io/travis/datagazing/gleandoc.svg Documentation Status

Simple convenience function to extract docstring

Examples

Print the first line of a docstring:

>>> import gleandoc
>>> docstring = gleandoc.docstring('re')
>>> docstring.splitlines()[0]
'Support for regular expressions (RE).'
>>>

Do the same thing from the command line:

$ gleandoc re | head -1
Support for regular expressions (RE).
$

Features

  • No dependencies

Limitations

  • Embedded backslash-n newlines are treated as actual newlines

  • Relies on various pseudo-internals: locals(), exec()

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

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

gleandoc-0.1.0.tar.gz (11.2 kB view hashes)

Uploaded Source

Built Distribution

gleandoc-0.1.0-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page