Skip to main content

VCS-friendly documents in YAML

Project description

yamlwrap is a Python module for keeping content ready for the web while under effective version control.

PyPI version

Audience

Do you use YAML just for configuration files? Then you don’t need yamlwrap.

Do you maintain a statically built web site? Do you want to keep even long documents with complex internal markup in plain-text files, but always ready for the ORM? Do you want automatic rewrapping (reflowing) of text for short lines and neat Git diffs? Do you want to use YAML everywhere, for quick, unambiguous, syntax-checked conversion to JSON or SQL for publication? Then yamlwrap is for you.

Stop using plutonian web-based administrative interfaces. Use yamlwrap and your favourite text editor.

Usage

This project is primarily a function library. Its highest-level interface is yamlwrap.transform, which takes and returns serialized YAML, along with keyword parameters for how to change that YAML. yamlwrap.unwrap, which takes a block of text as one string, is a suitable preprocessor for line-break-sensitive markup resolution.

The package also comes with a CLI that works on a file level and can produce diffs or new files from simple transformations.

Examples

Using the CLI as shown in the makefile, yamlwrap took this hand-made original and made this unwrapped version as well as this rewrapped version for VCS.

Development

This project is managed using PyInvoke. Run inv -l for a list of common tasks.

History

yamlwrap was originally part of django-yamldoc, when that project was called vedm. It became its own module (v1.0.0) in 2021. Later that year, internal logic based on Python regexes was stripped out in favour of punwrap, resulting in a more narrow focus (Markdown instead of arbitrary markup) and substantial behavioural changes (v2.0.0).

Later changes are described in the change log.

Legal

Copyright 2016–2023 Viktor Eikman

yamlwrap is licensed as detailed in the accompanying file LICENSE.

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

yamlwrap-2.1.1.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

yamlwrap-2.1.1-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file yamlwrap-2.1.1.tar.gz.

File metadata

  • Download URL: yamlwrap-2.1.1.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for yamlwrap-2.1.1.tar.gz
Algorithm Hash digest
SHA256 74852a726e38216c3c55d24b7a85ce5c16c58d052cd90ac338fe6bf4679f14d6
MD5 041933384764b75365affe56ca6090ec
BLAKE2b-256 818835d3197d6ec46aab3cbe3d86354e1c2db6353b14d00a7f6c6a26d2ec8430

See more details on using hashes here.

File details

Details for the file yamlwrap-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: yamlwrap-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for yamlwrap-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b637775653e3e6b4310aca5d64b8352f45be99ccb18c7847a1963f9a5c069a5
MD5 41c5e7ceb4b485dc3f2cc5f3147e2bc5
BLAKE2b-256 9f2eb677a7253e386d13b0a062ba46596bde4ab52c67917fcb78a471166d0be1

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