Python library for working with AnIML files
Project description
AnIML2
Description
Python package for working with AnIML data files.
Currently implements AnIML v0.90, as described per the xml schema ./schemas/animl-core.xsd, hope to upgrade to v1.0 in the near future.
Acknowledgements
The following repos have been used as inspiration for this project:
- https://github.com/FAIRChemistry/pyAnIML
- https://gitlab.com/opensourcelab/scientificdata/animl/animl_python
Scope
- Create, open & edit AnIML files
- Provide a simple interface to the AnIML schema and to assist users in avoiding common pitfalls
- The package does not check for logical inconsistencies in the files, e.g. missing references, duplicate IDs, etc. Instead this is left to the user and/or schema validation tools. (Might be addressed in a future version :)
Installation
Package is available on PyPI under the name animl2
and can be installed using pip.
Example
from xml.dom import minidom
from xml.etree import ElementTree as ET
from animl2.models import AnIMLDoc, Sample
doc = AnIMLDoc()
doc.append(Sample(name='sample1', sampleID="1"))
doc.append(Sample(name='sample2', sampleID="2"))
doc.append(Sample(name='sample3', sampleID="3"))
et = doc.dump_xml()
xml_string = minidom.parseString(ET.tostring(et)).toprettyxml(indent=" ")
print(xml_string)
<?xml version="1.0" ?>
<AnIML xmlns="urn:org:astm:animl:schema:core:draft:0.90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="0.90" xsi:schemaLocation="urn:org:astm:animl:schema:core:draft:0.90 http://schemas.animl.org/current/animl-core.xsd">
<SampleSet>
<Sample name="sample1" sampleID="1"/>
<Sample name="sample2" sampleID="2"/>
<Sample name="sample3" sampleID="3"/>
</SampleSet>
</AnIML>
Project Goals
The following MVP (minimum viable product) goals are defined for this project. They're not set in stone and may change as the project progresses but they should give a good idea of what to expect.
MVP1
- Possible to create, open & edit AnIML xml files.
- The following AnIML document features are supported:
- Samples
- Experiment Steps
- Helper function to simplify outputing the xml to a file or string.
MVP2
- TBC
Long term goals
- Document signing support
- Document diff feature support
Long term goals (maybe)
- Document validation
- Technique definitions helper functions
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
File details
Details for the file animl2-0.1.2.tar.gz
.
File metadata
- Download URL: animl2-0.1.2.tar.gz
- Upload date:
- Size: 35.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2cc1fc1f743ab1c7daf78ee3d800bda06e684ac5ff2cb7f7252085c75cf1b17 |
|
MD5 | 8cf474f49e206bccffe0c74296efe2b3 |
|
BLAKE2b-256 | e8a5266ae50f6219a8bbbce8e992704ec6882f0d5a9a010d8f7ebbc1e09097ec |
File details
Details for the file animl2-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: animl2-0.1.2-py3-none-any.whl
- Upload date:
- Size: 30.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bb2ed29d2eeb194a0de166282defd2ef163908bcd5338dc89ba6304184ee0d3 |
|
MD5 | 7b5b1da5edad66b5c08c63b9587603c4 |
|
BLAKE2b-256 | 47da0eca29a3653f52450cac31933724e8d915b70a30e12d571d6adc3e851b77 |