Skip to main content

Python lib to deal with EML (Ecological Metadata Language)

Project description

pyemllib

Release Build status codecov Commit activity Docs Code style with black Imports with isort License

This package is a python lib to help dealing with EML - Ecological Metadata Language.

It's built uppon dataclasses generated with xsdata from EML xsd hence heavily relies on xsdata capabilities

For history reasons, i also provide the former pyxb and generateDS (built with py38) that i used to use on my projects but that i now find more cumbersome to use than the dataclass implementation. They might be useful anyway !!

NB: This lib is currently developped under a local gitlab forge and will be release on github on important releases

Main features

  • Deserializes EML files to python objects
  • Serializes pure python objects to EML as XML string / files
  • Checks validity of EML generated against xsd
  • Generates a markdown/html DataPaper from suitable EML files

Very simple usage

from emllib import EMLizer

# instantiate EML object document
my_eml = EMLizer(package_id="ID", title="Mon titre", lang="fr", creator="Mon Createur", abstract="Mon abstract")

# print EML xml formatted string
print(my_eml.to_string())

# dump EML xml formatted to file
my_eml.to_file('path/to/file/eml.xml')

# Inspect validity
if my_eml.validate().bool:
    print("This EML file seems valid")
else:
    print("This EML file does not seem valid!")
    my_eml.validate().reason

Recommended usage

The EMLizer helper class is just a wrapper to help quickly basic EML files. Nevertheless in more complex or sophisticated situations, i recommend to use the dataclass API directly under emllib.dataclass.eml220

Changelog

0.2.0

Added

Changed

  • utils.validate() returns collections.namedtuple (bool, reason) instead of just bool

Removed


Repository initiated with fpgmaas/cookiecutter-poetry.

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

pyemllib-0.2.0.tar.gz (767.9 kB view details)

Uploaded Source

Built Distribution

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

pyemllib-0.2.0-py3-none-any.whl (918.6 kB view details)

Uploaded Python 3

File details

Details for the file pyemllib-0.2.0.tar.gz.

File metadata

  • Download URL: pyemllib-0.2.0.tar.gz
  • Upload date:
  • Size: 767.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.12 Linux/5.4.0-132-generic

File hashes

Hashes for pyemllib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2b130464c56c809426ed75d5f1611c00bc6b5429ce664f98c58f4860f777b7c4
MD5 0472a104041f360f593aa101483363c6
BLAKE2b-256 6169c42a6424915ae28f663baf8af41a33628ccc43fc203fd5e770f1c4d2f28b

See more details on using hashes here.

File details

Details for the file pyemllib-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyemllib-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 918.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.12 Linux/5.4.0-132-generic

File hashes

Hashes for pyemllib-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8dc52fa73263752ef7e335b66201152efede3d623972a0ddac7c1e5b0ae72eb4
MD5 275a868569c8128f83ee3152eca20056
BLAKE2b-256 4b9f7125d91d5c23aa18d6a8670dda516eda2796f51f99f7f378826a7cc3ca72

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