When documenting a library or software product written in Python, often
a README is not enough, but full-blown Sphinx is too much work or too
rigid.
Inspect is a command-line tool that will automatically document Python
code, but it returns the output as machine-readable JSON or
human-readable Markdown, so you retain full control of how to render the
documentation.
Usage: inspect [] [options]
Options: -m --markdown At what level to start headers. --include ...
--exclude ...
If you only need a single object documented (whether a function, a class
or something else), you can use the
.. raw:: html
<object>
argument:
::
# will only include documentation on `A`
inspect fixtures/example.py A
Filtering the output with ``--include`` and ``--exclude`` ensures that
your code description only contains exactly what you want it to. Some
examples:
::
# only include class methods if they've been documented
inspect fixtures/example.py --include members.documented
# only include classes
inspect fixtures/example.py --include type:class
# only document function `factorize` and class `Bean`
inspect fixtures/example.py --include name:fun,name:B
# only include documented methods on Bean
# (these two are identical)
inspect fixtures/example.py Bean --include documented
inspect fixtures/example.py --include name:Bean,members.documented
As you can see, ``.`` traverses the hierarchy and ``:`` is the value to
test against. (If you don't specify a value, we will test on presence.)
``,`` separates multiple criteria that are OR'ed together.
Todo:
- improve documentation
- unit test the filtering mechanism
- fill out missing information in the description JSON (if any)
- an ``intercalate`` utility that runs shell commands inside of ``%%``
tags in a file and replaces the tags with the standard output from
those commands
Metadata
Release files for inspected 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| inspected-0.2.0.tar.gz | 5.0 kB | Without provenance | Details for inspected-0.2.0.tar.gz |
Release files / inspected-0.2.0.tar.gz
| Download URL | inspected-0.2.0.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
19c5b4a5af1774b2466e8e5dbbb5c81911dcd897d40ec96570b840ab8f92dadf
|
|
BLAKE2b-256 checksum How to use checksums |
85d3418a8e3bb9bfd87504500d4bc43ab58650e905722644eb66c9d7f6255597
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for inspected 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.