WriteMe
WriteMe is a CLI tool for painless templating of README or other markdown files.
Ever been tired of copy-pasting snippets of code, command-outputs, and other dynamic-ish things for which your README itself is not the source of truth ? That's where writeme comes in. Create a WRITEME.md file, write your README template in there and let WriteMe autogenerate your README, so that your README is always in sync with your project.
Not yet-another-templating-language
One of the main pain point with standard templating solutions is that they have to define their own custom syntax, which then gets plugged into some arbitrary other format (HTML, Javascript, or even C, you call it) in ways that look extremly ugly most of the time. This leads to some tangled mess in the template files themselves (which become incomprehensible by linters/LSPs, thus harder to read and check for human developers), on top of having to learn of whole new syntax solely for the templating needs.
This is particularly bad for Markdown, which is format that has been designed to be fairly readable even before rendering, and also to be simple to use.
To tackle this problem, WriteMe is designed as follows:
- A
WriteMetemplate file is still 100% valid markdown, and your markdown LSP/linters will work properly on them. The macros used for markdown generation are always guarded in code fences, making them isolated and easy to read by design. - There's little to no custom syntax:
WriteMemacros are python code, which get replaced by their output after rendering.
Usage
Calling writeme from command-line
This project is self-hosted, meaning that this README is generated using WriteMe. The template file used to generate this README is located at the root of this repo, in WRITEME.md. You can render a WriteMe template using the writeme render command:
Welcome to WriteMe !
Usage: writeme render [OPTIONS] MARKDOWN_PATH
Renders a WriteMe template. Formats all found `writeme` code blocks in the
passed markdown file. Output is written the the file given by -o if passed,
and to stdout otherwise.
Options:
-o, --output TEXT Path to the file to render to. If omitted,
uses stdout
-mxl, --max-line-length INTEGER
Maximum line length to apply when formatting
Markdown
-norm, --normalize-whitespaces Normalizes whitespaces
--help Show this message and exit.
Actually writing the template file
WriteMe generation macros should be wrapped in code fences, using the writeme as the language. You can refer to WRITEME.md for examples.
The syntax within the code blocks is pure Python; the function called will be replaced by its output in the rendered file. Available functions are as follows:
@_MainNamespace.register
def show_source_code(import_path: str, declaration_only: bool=False, language: str='python') -> RenderingInfo:
"""
Displays the source code on the object at `import_path`
Parameters
----------
obj_import_path: str
Path to the object from which to display the source code,
as {import_path}:func_name.
decl_only: bool
Only shows the function (or class declaration), removes the body
(show ... (Ellipsis) instead)
"""
..
@_MainNamespace.register
def show_command_output(cmd: str) -> RenderingInfo:
"""
Runs the command and captures stdout
"""
..
@_MainNamespace.register
def show_help_menu(cmd: str) -> RenderingInfo:
"""
Small wrapper around show_command_output; queries the help menu
"""
..
Status
WriteMe is under construction and not production-ready yet.
Metadata
Release files for pywriteme 0.3.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 | |
|---|---|---|---|
| pywriteme-0.3.0.tar.gz | 5.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pywriteme-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.3 kB
Release files / pywriteme-0.3.0.tar.gz
| Download URL | pywriteme-0.3.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
297ebffaadd6eff78c8cae4a420233dc60d941e0241678c4523da7b8d453e483
|
|
BLAKE2b-256 checksum How to use checksums |
9a66559c3e3f8b245732ebd72f7492c42e4947ac9f61f339d0bf0b3909705d4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 29, 2026.
Transparency logRelease files / pywriteme-0.3.0-py3-none-any.whl
| Download URL | pywriteme-0.3.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82c62c2d4c779b3352f0ccd402f249701141e75fb2586e2a3fa94baed2a98d28
|
|
BLAKE2b-256 checksum How to use checksums |
17d37d244c107381ace23fa200ea0645313e06a200e515773f7f21db33c8b461
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 29, 2026.
Transparency log