Skip to main content

sedml

A SED-ML Python reader based on pydantic.

Currently supports:

  • L1V1
  • L1V2
  • L1V3
  • L1V4

Usage

To parse from a string, use sedml.loads:

>>> import sedml
>>> s = sedml.loads("""<sedML xmlns="http://sed-ml.org/sed-ml/level1/version4" level="1" version="4">
...   <listOfSimulations>
...     <uniformTimeCourse id="sim1" initialTime="0" outputStartTime="0" outputEndTime="1000" numberOfSteps="1000">
...       <algorithm kisaoID="KISAO:0000019"/>
...     </uniformTimeCourse>
...   </listOfSimulations>
...   <listOfModels>
...     <model id="model1" language="urn:sedml:language:sbml.level-3.version-1" source="https://example.com/model.xml"/>
...   </listOfModels>
...   <listOfTasks>
...     <task id="task1" modelReference="model1" simulationReference="sim1"/>
...   </listOfTasks>
... </sedML>
... """)
>>> s
SEDML(
    level='1',
    version='4',
    models=[
        Model(
            id='model1',
            source='https://example.com/model.xml',
            language='urn:sedml:language:sbml.level-3.version-1'
        )
    ],
    simulations=[
        UniformTimeCourse(
            id='sim1',
            algorithm=Algorithm(kisaoID='KISAO:0000019'),
            initialTime=0.0,
            outputStartTime=0.0,
            outputEndTime=1000.0,
            numberOfSteps=1000
        )
    ],
    tasks=[
        Task(id='task1', modelReference='model1', simulationReference='sim1')
    ]
)

To export a SED-ML model, use sedml.dumps:

>>> b = sedml.dumps(s)
>>> print(b.decode())
<?xml version='1.0' encoding='UTF-8'?>
<sedML xmlns="http://sed-ml.org/sed-ml/level1/version4" level="1" version="4">
  <listOfModels>
    <model id="model1" source="https://example.com/model.xml" language="urn:sedml:language:sbml.level-3.version-1"/>
  </listOfModels>
  <listOfSimulations>
    <uniformTimeCourse id="sim1" initialTime="0.0" outputStartTime="0.0" outputEndTime="1000.0" numberOfSteps="1000">
      <algorithm kisaoID="KISAO:0000019"/>
    </uniformTimeCourse>
  </listOfSimulations>
  <listOfTasks>
    <task id="task1" modelReference="model1" simulationReference="sim1"/>
  </listOfTasks>
</sedML>

By default, it includes the XML declaration with UTF-8 encoding, and it is pretty-printed. This can be customized when calling sedml.dumps.

To read from or write to a os.PathLike, use sedml.load or sedml.dump, respectively.

Installation

pip install sedml

Development

We are using pytest for testing, and pre-commit hooks to format and lint the codebase.

To easily set-up a development environment, run the following commands:

git clone https://github.com/maurosilber/sedml
cd sedml
conda env create --file environment-dev.yml
pre-commit install

which assume you have git and conda preinstalled.

Metadata

Release files for sedml 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sedml 0.1.0
File Size Uploaded Provenance Actions
sedml-0.1.0.tar.gz 13.7 kB Without provenance Details for sedml-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sedml 0.1.0
File Interpreter ABI Platform Actions
sedml-0.1.0-py3-none-any.whl Python 3 none any Details for sedml-0.1.0-py3-none-any.whl

Total release size: 29.5 kB

Release files / sedml-0.1.0.tar.gz

Download URL sedml-0.1.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7e8198310ca6ac82122540b421dfefa7337ade38a7ec3b2f2789e7a751139da2
BLAKE2b-256 checksum
How to use checksums
68d36edf91a3b9160ccfcc8b0205cbc2b2cde542f9cedbfa502746b341f7ee3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / sedml-0.1.0-py3-none-any.whl

Download URL sedml-0.1.0-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e72ecbef63b0ba8cb4e6f8fccecb7c40b78987665a6a7106dc5aee2edb4ee2b
BLAKE2b-256 checksum
How to use checksums
107527c59b91a471f0a6801887b1bd43ae7837a48240729daba94e2c3a4e9804
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Security for sedml 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page