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.1.tar.gz (5.0 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.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymaml-0.3.1.tar.gz
  • Upload date:
  • Size: 5.0 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.1.tar.gz
Algorithm Hash digest
SHA256 cf197830adb7bde562af7d06f300d84bf2f9f7d2a12d112fb73754d2590722f5
MD5 77768ee134f1de4705c8d41ba873957b
BLAKE2b-256 f434f6a2eef531fc9226a15961e810f4c84b121d1adc6d08046b68a6ea998e51

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymaml-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 6.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 beb4600145d0a7bebf0338d61d767ba4cd9dc026554b7197e93ce33b1ebae903
MD5 58196ba2468a23776fad681064af69cd
BLAKE2b-256 73eb2cd6f1ddc8406ac0be34683186619e683a927b04afe82f1503ed975f3648

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