sedml


Namesedml JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryA SED-ML reader based on pydantic.
upload_time2023-10-02 12:50:52
maintainer
docs_urlNone
author
requires_python>=3.10
licenseMIT License Copyright (c) 2023 Mauro Silberberg Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords sed-ml xml pydantic pydantic-xml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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("""<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`:

```python
>>> 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.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "sedml",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "SED-ML,XML,pydantic,pydantic-xml",
    "author": "",
    "author_email": "Mauro Silberberg <maurosilber@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/68/d3/6edf91a3b9160ccfcc8b0205cbc2b2cde542f9cedbfa502746b341f7ee3a/sedml-0.1.0.tar.gz",
    "platform": null,
    "description": "# sedml\n\nA [SED-ML](https://sed-ml.org) Python reader based on [pydantic](https://docs.pydantic.dev/latest/).\n\nCurrently supports:\n\n- L1V1\n- L1V2\n- L1V3\n- L1V4\n\n## Usage\n\nTo parse from a string,\nuse `sedml.loads`:\n\n```python\n>>> import sedml\n>>> s = sedml.loads(\"\"\"<sedML xmlns=\"http://sed-ml.org/sed-ml/level1/version4\" level=\"1\" version=\"4\">\n...   <listOfSimulations>\n...     <uniformTimeCourse id=\"sim1\" initialTime=\"0\" outputStartTime=\"0\" outputEndTime=\"1000\" numberOfSteps=\"1000\">\n...       <algorithm kisaoID=\"KISAO:0000019\"/>\n...     </uniformTimeCourse>\n...   </listOfSimulations>\n...   <listOfModels>\n...     <model id=\"model1\" language=\"urn:sedml:language:sbml.level-3.version-1\" source=\"https://example.com/model.xml\"/>\n...   </listOfModels>\n...   <listOfTasks>\n...     <task id=\"task1\" modelReference=\"model1\" simulationReference=\"sim1\"/>\n...   </listOfTasks>\n... </sedML>\n... \"\"\")\n>>> s\nSEDML(\n    level='1',\n    version='4',\n    models=[\n        Model(\n            id='model1',\n            source='https://example.com/model.xml',\n            language='urn:sedml:language:sbml.level-3.version-1'\n        )\n    ],\n    simulations=[\n        UniformTimeCourse(\n            id='sim1',\n            algorithm=Algorithm(kisaoID='KISAO:0000019'),\n            initialTime=0.0,\n            outputStartTime=0.0,\n            outputEndTime=1000.0,\n            numberOfSteps=1000\n        )\n    ],\n    tasks=[\n        Task(id='task1', modelReference='model1', simulationReference='sim1')\n    ]\n)\n\n```\n\nTo export a SED-ML model,\nuse `sedml.dumps`:\n\n```python\n>>> b = sedml.dumps(s)\n>>> print(b.decode())\n<?xml version='1.0' encoding='UTF-8'?>\n<sedML xmlns=\"http://sed-ml.org/sed-ml/level1/version4\" level=\"1\" version=\"4\">\n  <listOfModels>\n    <model id=\"model1\" source=\"https://example.com/model.xml\" language=\"urn:sedml:language:sbml.level-3.version-1\"/>\n  </listOfModels>\n  <listOfSimulations>\n    <uniformTimeCourse id=\"sim1\" initialTime=\"0.0\" outputStartTime=\"0.0\" outputEndTime=\"1000.0\" numberOfSteps=\"1000\">\n      <algorithm kisaoID=\"KISAO:0000019\"/>\n    </uniformTimeCourse>\n  </listOfSimulations>\n  <listOfTasks>\n    <task id=\"task1\" modelReference=\"model1\" simulationReference=\"sim1\"/>\n  </listOfTasks>\n</sedML>\n\n```\n\nBy default,\nit includes the XML declaration with UTF-8 encoding,\nand it is pretty-printed.\nThis can be customized when calling `sedml.dumps`.\n\nTo read from or write to a `os.PathLike`,\nuse `sedml.load` or `sedml.dump`,\nrespectively.\n\n## Installation\n\n```\npip install sedml\n```\n\n## Development\n\nWe are using pytest for testing,\nand pre-commit hooks to format and lint the codebase.\n\nTo easily set-up a development environment,\nrun the following commands:\n\n```\ngit clone https://github.com/maurosilber/sedml\ncd sedml\nconda env create --file environment-dev.yml\npre-commit install\n```\n\nwhich assume you have git and conda preinstalled.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Mauro Silberberg  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A SED-ML reader based on pydantic.",
    "version": "0.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/maurosilber/sedml/issues",
        "Homepage": "https://github.com/maurosilber/sedml"
    },
    "split_keywords": [
        "sed-ml",
        "xml",
        "pydantic",
        "pydantic-xml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "107527c59b91a471f0a6801887b1bd43ae7837a48240729daba94e2c3a4e9804",
                "md5": "01a10b2fa0bdb96ff64d58b9197f5ad2",
                "sha256": "6e72ecbef63b0ba8cb4e6f8fccecb7c40b78987665a6a7106dc5aee2edb4ee2b"
            },
            "downloads": -1,
            "filename": "sedml-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "01a10b2fa0bdb96ff64d58b9197f5ad2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 15819,
            "upload_time": "2023-10-02T12:50:50",
            "upload_time_iso_8601": "2023-10-02T12:50:50.867974Z",
            "url": "https://files.pythonhosted.org/packages/10/75/27c59b91a471f0a6801887b1bd43ae7837a48240729daba94e2c3a4e9804/sedml-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "68d36edf91a3b9160ccfcc8b0205cbc2b2cde542f9cedbfa502746b341f7ee3a",
                "md5": "e62f7aec81389542f9ce9daf95d02118",
                "sha256": "7e8198310ca6ac82122540b421dfefa7337ade38a7ec3b2f2789e7a751139da2"
            },
            "downloads": -1,
            "filename": "sedml-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e62f7aec81389542f9ce9daf95d02118",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 13720,
            "upload_time": "2023-10-02T12:50:52",
            "upload_time_iso_8601": "2023-10-02T12:50:52.563331Z",
            "url": "https://files.pythonhosted.org/packages/68/d3/6edf91a3b9160ccfcc8b0205cbc2b2cde542f9cedbfa502746b341f7ee3a/sedml-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-02 12:50:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "maurosilber",
    "github_project": "sedml",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "sedml"
}
        
Elapsed time: 0.11439s