Skip to main content

Is it YAML?

About

"Is it YAML?" is a Django application (with tags) for checking whether text is YAML - "a human friendly data serialization standard for all programming languages" - or not.

Users type or paste text, then click the "Submit" button. If valid YAML has been entered, the input is shown in canonical form; otherwise, the application presents an error message.

Installation and Dependencies

"Is it YAML?" depends on Django (≥ 5.2) and PyYAML (≥ 6.0). Installation is as simple as:

pip install isityaml

Setting up

Once installed, add "isityaml" to your INSTALLED_APPS list in settings.py, and include the app URLs under any path prefix you like:

# project urls.py
from django.urls import include, path

urlpatterns = [
    # ... existing routes ...
    path("this_is_the_path_to_isityaml/", include("isityaml.urls")),
]

Creating your own YAML checker page

A YAML checker can be as simple as this Django template file:

{% extends "base.html" %}
{% load isityaml_tags %}
{% block main %}
{% isityaml_checker %}
{% endblock %}

Then you can visit the URL where you mounted the app, such as /this_is_the_path_to_isityaml/. Paste or type YAML into the text area and click Submit. Valid input is shown in canonical form; invalid input shows the parser error and the original text.

Embedding in another template

Alternately, you can add this to any page with CSRF support:

{% load isityaml_tags %}
{% isityaml_checker %}

By default, the form’s action is {% url "isityaml:index" %}, which resolves to the "this_is_the_path_to_isityaml/" which you included with isityaml.urls. After submission, the user lands on a checker page with the results. To post somewhere else, you can pass an override:

{% isityaml_checker action_url="/tools/yaml-check/" %}

Text customisation

There are a lot of user interface strings, such as headings, labels and button text, which live in isityaml.copy.DEFAULT_COPY. You can change them in your settings:

# settings.py
ISITYAML_COPY = {
    "textarea_default": "Xin chào thế giới!", # Hello world! in Vietnamese
    # ...
}

Or you can provide them as arguments on the tag:

{% isityaml_checker textarea_default="Xin chào thế giới!" %}

Calling the app from Python

You can even call the application using isityaml.yaml_check:

from isityaml.yaml_check import check_yaml, STATE_POST_YES, STATE_POST_NO

result = check_yaml("foo: bar")
if result.yamlstate == STATE_POST_YES:
    print(result.yamlcanon)   # canonical YAML
elif result.yamlstate == STATE_POST_NO:
    print(result.yamlerror)
    print(result.yamloriginal)

Testing

From the package root (with the package importable, e.g. after pip install -e .):

PYTHONPATH=. python -m unittest discover -s tests -v

History

  • 0.1 (August 30th 2011) - Create setup script for files.
  • 0.2 (April 25th 2013) - Try to make a half-decent PyPI package.
  • 0.3 (January 30th 2014) - Updated to be compatible with Django 1.6 and Mezzanine 3.0.
  • 0.4 (February 15th 2014) - Added more error handling and styling to be compatible with Bootstrap.
  • 0.5 (August 13th 2014) - Cleaned up error handling and installation issues.
  • 0.6 (February 28th 2017) - Updated to be compatible with Django 1.10.
  • 0.7 (December 6th 2020) - Run through 2to3 for Python 3 changes.
  • 0.8 (September 11th 2026) - Modularise the code; clean up the changes.

The isityaml app is copyright (c) 2009-2026 Peter Murphy peterkmurphy@gmail.com.

Metadata

Release files for isityaml 0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for isityaml 0.8
File Size Uploaded Provenance Actions
isityaml-0.8.tar.gz 17.2 kB Without provenance Details for isityaml-0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for isityaml 0.8
File Interpreter ABI Platform Actions
isityaml-0.8-py3-none-any.whl Python 3 none any Details for isityaml-0.8-py3-none-any.whl

Total release size: 33.2 kB

Release files / isityaml-0.8.tar.gz

Download URL isityaml-0.8.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
092b64dfad51fa405230e580fa9dfbc94bf88e5ca8e3a92ed647ac6faf313bd3
BLAKE2b-256 checksum
How to use checksums
603b305216fc1408d860a83ecfca56cc517bc449ac88f5f3eba60f14a7f7590a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / isityaml-0.8-py3-none-any.whl

Download URL isityaml-0.8-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8427a5d9b65645265559398b76322a897c9bf880fd62d99c2ef66c1e71b330cd
BLAKE2b-256 checksum
How to use checksums
54aca34e51ef834bbcbd50fd450b1ccaaa697043e2ea53733b6ff7d8ff03b9bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for isityaml 0.8

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page