Skip to main content

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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

animl2-0.1.1.tar.gz (34.4 kB view hashes)

Uploaded Source

Built Distribution

animl2-0.1.1-py3-none-any.whl (30.7 kB view hashes)

Uploaded Python 3

Supported by

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