Skip to content

Create Instagram posts from your plaintext poetry in seconds

Notifications You must be signed in to change notification settings

kjczarne/baudelaire

Repository files navigation

logo


Create Instagram posts from your plaintext poetry in seconds:


logo


Installation

pip install baudelaire

Usage

baudelaire "<plaintext-input>" -o "<output-directory>" -c "<config>"

For example:

baudelaire -o "outputs" "$(cat "poem.txt")"
# OR:
baudelaire -o "outputs" -f poem.txt

Note

The input is expected to be a plaintext poem, so you can write the contents directly in the command line or cat them from a plaintext file.

The text will be written to the specified output directory as poem_part-*.png files. There is a default configuration file which is distributed as a part of the package.

You can give it a try by using Dylan Thomas' Do not go gentle into that good night:

baudelaire -o "outputs" "$(cat "tests/rage.txt")"

File inputs

Plaintext

All plaintext files are read as-is using the basic f.read() facility in Python. This means that the entire contents of a .txt file will be parsed as a poem.

Markdown

Warning

Because I personally put my poems in Obsidian and my template involves placing the actual contents of the poem into a markdown codeblock (``` code fences), this tool will parse all code fences and join them using \n\n.

Configuration

The default config is available in the repository under config/default.yaml. Check out the comments to understand what each configuration option does.

Note

If you change the font you might need to tweak other parameters like the number of lines per board. It's recommended to create a separate config per template.

About

Create Instagram posts from your plaintext poetry in seconds

Resources

Stars

Watchers

Forks

Packages

No packages published