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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymaml-0.3.3.tar.gz.
File metadata
- Download URL: pymaml-0.3.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f369423a8e57126c2d8bdd0b5c28a22d58cd831c14ab3502c44ba4bc85411de4
|
|
| MD5 |
0e63c906841695027add92026cb198a4
|
|
| BLAKE2b-256 |
f997168a778e9eb33f3252e84fa1a04663557f99fe9a4bb645f32f6ba32465b8
|
File details
Details for the file pymaml-0.3.3-py3-none-any.whl.
File metadata
- Download URL: pymaml-0.3.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fbffd413e950d792e714b7bb3895a1f1e76fc83967fa2615b1a435958606521
|
|
| MD5 |
48be072ec2adaa72dacb67a52d6357c8
|
|
| BLAKE2b-256 |
5c3ed4be9400d7e430596da7b723fb7d6a7643333d4f58149835aca29251c476
|