readme_patcher
Generate README files from templates. Allow input from functions calls and cli output.
cd your-project
vim README_template.rst
poetry add --group dev readme-patcher
poetry shell
readme-patcher # README.rst
Global objects
py_project
{{ py_project.repository }}
github
https://docs.github.com/en/rest/repos/repos#get-a-repository
https://api.github.com/repos/Josef-Friedrich/readme_patcher
{{ github.name }}
{{ github.full_name }}
{{ github.description }}
{{ github.owner.login }}
badge
{{ badge.pypi }}
{{ badge.github_workflow('tests' 'Tests') }}
{{ badge.readthedocs }}
Functions
cli (Command line interface): Combined output (stdout and stderr) of command line interfaces (scripts / binaries)
{{ cli('awk --help') }}
It is recommended to use the cli function together with the literal filter.
{{ cli('awk --help') | literal }}
func: return values of Python functions
{{ func('os.getcwd') }}
read: read text files
{{ read('code/example.py') | code('python') }}
Filters
code
{{ 'print("example")' | code('python') }}
.. code-block:: python
print("example")
literal
{{ func('os.getcwd') | literal }}
::
/home/repos/project
heading
{{ 'heading 1' | heading(1) }}
{{ 'heading 2' | heading(2) }}
{{ 'heading 3' | heading(3) }}
{{ 'heading 4' | heading(4) }}
heading 1 ========= heading 2 --------- heading 3 ^^^^^^^^^ heading 4 """""""""
Examples
{% for command in [
'dns-ipv6-prefix.py',
'extract-pdftext.py',
'find-dupes-by-size.py',
'list-files.py',
'mac-to-eui64.py',
'pdf-compress.py',
'image-into-pdf.py'
]
%}
``{{ command }}``
{{ cli('{} --help'.format(command)) | literal }}
{% endfor %}
Configuration
[[tool.readme_patcher.file]]
src = "README_template.rst"
dest = "README.rst"
variables = { cwd = "func:os.getcwd", fortune = "cli:fortune --help" }
Metadata
Release files for readme_patcher 0.7.2
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 |
|---|---|---|---|---|
| readme_patcher-0.7.2.tar.gz | 52.2 kB | Without provenance | Details for readme_patcher-0.7.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| readme_patcher-0.7.2-py3-none-any.whl | Python 3 | none | any | Details for readme_patcher-0.7.2-py3-none-any.whl |
Total release size: 62.4 kB
Release files / readme_patcher-0.7.2.tar.gz
| Download URL | readme_patcher-0.7.2.tar.gz |
|---|---|
| Size | 52.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ba3ab38806a7adaca7e6600c36913ac8ee55e7745e15ff94f21caa85a616405d
|
|
BLAKE2b-256 checksum How to use checksums |
c6dd13a4a5ac6b2cdaa2cfaf89b688e14ca1cd4adc344067bb4b4a231cf79dba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.7.8
|
Release files / readme_patcher-0.7.2-py3-none-any.whl
| Download URL | readme_patcher-0.7.2-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9121a9ee699cb349ad8f1d45680ccb0805e6c8b0b700fb99d2f2651b18cb3579
|
|
BLAKE2b-256 checksum How to use checksums |
4c00a195f1b2f24b4dfc6fbcfe04afeb1fc130445fd71fb3fbffd79752fea5bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.7.8
|
Security for readme_patcher 0.7.2
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.