Skip to main content

Include Python source code in Markdown files

Latest version Documentation MIT license

The includepy package provides a Markdown preprocessor that allows you to include the source code for a specific Python object (e.g., a function or class) when rendering Markdown content.

For example, to include the source code for the factorial function in example.py, add the following lines in a code block:

-->includepy<-- example.py
-->pyobject<-- factorial

The includepy preprocessor will turn this into the following:

def factorial(n: int) -> int:
    value = n  # (1)
    while n > 1:
        n -= 1
        value *= n
    return value

See the documentation for further details.

Metadata

Release files for includepy 0.3

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

Built distribution (wheel)

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

Release files / includepy-0.3-py3-none-any.whl

Download URL includepy-0.3-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b9c34d0b97146627caaf7f8e49016595e6e12ffd6712d84a619d5a68fb766da
BLAKE2b-256 checksum
How to use checksums
5d23cf79a8360a9fc770b714158949615cc926ff63301c2e729960f3a088cb0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for includepy 0.3

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.

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file No provenance

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