Skip to main content

Python reader, writer and validator for Meta yAML (MAML).

Project description

pymaml

Official python package for reading, writing, and parsing the Meta yAML format.

(see also https://github.com/asgr/MAML)

MAML is a YAML based metadata format for tabular data. This package is a simple python interface to help read, validate and write MAML files.

Why use MAML?

Why MAML? We have VOTable and FITS header already?! Well, for various projects we were keen on a rich metadata format that was easy for humans and computers to both read and write. VOTable headers are very hard for humans to read and write, and FITS is very restrictive with its formatting and only useful for FITS files directly. In comes YAML, a very human and machine readable and writable format. By restricting ourselves to a narrow subset of the language we can easily describe fairly complex table metadata (including all IVOA information). So this brings us to MAML: Metadata yAML.

MAML format files should be saves as example.maml etc. And the idea is the yaml string can be inserted directly into a number of different file formats that accept key-value metadata (like Apache Arrow Parquet files). In the case of Parquet files they should be written to a 'maml' extension in the metadata section of the file.

Installation

pymaml can be installed easily with pip

pip install pymaml

Creating a new .maml file.

Reading in a .maml file.

Reading a maml file is easily done using the MAML object in pymaml. Reading it in this way will include validation "for free".

from pymaml import MAML
new_maml = MAML.from_file("example.maml")

This MAML object will only be created if all the the required fields are present in the maml file.

Validating a .maml file.

The pymaml package has a validate function that will audit a .maml file and return weather or not that file is valid as well as describe why it isnt valid and any warnigns that the users might wish to consider.

from pymaml import validate
validate("example.maml")

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

pymaml-0.3.4.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymaml-0.3.4-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file pymaml-0.3.4.tar.gz.

File metadata

  • Download URL: pymaml-0.3.4.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pymaml-0.3.4.tar.gz
Algorithm Hash digest
SHA256 cdc2628b61bf6070da278769b9b39e02246a05c0d38ec1210a12319b81ed1dc8
MD5 7f41b56656d4eb623dee6d2d0d32ffff
BLAKE2b-256 612756770f5d955da0169676acedf5213c1c8b61094ee2b6af2b1e8853692950

See more details on using hashes here.

File details

Details for the file pymaml-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: pymaml-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pymaml-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 455addebf38921d1ec114ff10164de619796e5f6fc22d7193b63cb088643aa82
MD5 a1eb4bee69e80371b1a82f8c0a796f38
BLAKE2b-256 248710c9a0ca30695df4f322df63753b0b8f71254574f6852aa09846cb90c882

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page