Skip to main content

Generate README files from templates. Allow input from functions calls and cli output.

Project description

This package on the Python Package Index Tests

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

{{ github.name }}
{{ github.full_name }}
{{ github.description }}

badge

{{ badge.pypi }}
{{ badge.github_workflow('tests' 'Tests') }}
{{ badge.readthedocs }}

Functions

cli: Combined output (stdout and stderr) of command line interfaces (scripts / binaries)

{{ cli('awk --help') }}

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

Configuration

[[tool.readme_patcher.file]]
src = "README_template.rst"
dest = "README.rst"
variables = { cwd = "func:os.getcwd", fortune = "cli:fortune --help" }

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

readme_patcher-0.5.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

readme_patcher-0.5.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file readme_patcher-0.5.0.tar.gz.

File metadata

  • Download URL: readme_patcher-0.5.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b2 CPython/3.10.4 Linux/5.15.0-41-generic

File hashes

Hashes for readme_patcher-0.5.0.tar.gz
Algorithm Hash digest
SHA256 94c80e1043afeb5189a4d3c5d43a39187529a04ed03141ad95da2490aa846780
MD5 ea3ad2517a888387ce889f0fab68fab0
BLAKE2b-256 c3a884e59594f91dab6f6b40021dfbb7f87b454cafa556456f923fa413d9ce9d

See more details on using hashes here.

File details

Details for the file readme_patcher-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: readme_patcher-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.0b2 CPython/3.10.4 Linux/5.15.0-41-generic

File hashes

Hashes for readme_patcher-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 764d3ddbe4ab97bcd220de64a2b928e8eaddd1f1149ffde6fb39e38781c893e4
MD5 12470b40c882b326a1cf5a07d48abffb
BLAKE2b-256 e5ca72857557bd012c31bce640216e06cf0519559768bfa15524911c8aec544d

See more details on using hashes here.

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