Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maurosilber/sedml
https://github.com/maurosilber/sedml
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/maurosilber/sedml
- Owner: maurosilber
- License: mit
- Created: 2023-10-02T09:46:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-02T12:49:06.000Z (over 1 year ago)
- Last Synced: 2024-11-30T00:51:51.214Z (about 1 month ago)
- Language: Python
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sedml
A [SED-ML](https://sed-ml.org) Python reader based on [pydantic](https://docs.pydantic.dev/latest/).
Currently supports:
- L1V1
- L1V2
- L1V3
- L1V4## Usage
To parse from a string,
use `sedml.loads`:```python
>>> import sedml
>>> s = sedml.loads("""
...
...
...
...
...
...
...
...
...
...
...
...
... """)
>>> 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`:```python
>>> b = sedml.dumps(s)
>>> print(b.decode())
```
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.