autosubmitconfigparser


Nameautosubmitconfigparser JSON
Version 1.0.76 PyPI version JSON
download
home_pagehttps://earth.bsc.es/gitlab/ces/autosubmit4-config-parser.git
SummaryAn utility library that allows to read an Autosubmit 4 experiment configuration.
upload_time2024-12-16 14:01:06
maintainerNone
docs_urlNone
authorDaniel Beltran Mora
requires_pythonNone
licenseNone
keywords climate weather workflow hpc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Simple library that allows to read the data of an Autosubmit experiment.

### Usage: ####

```python
#import the main config library
from autosubmitconfigparser.config.configcommon import AutosubmitConfig
import os
# Init the configuration object where expid = experiment identifier that you want to load
expid = "a01y"
as_conf = AutosubmitConfig("a01y")
# This will load the data from the experiment
as_conf.reload(True)

#all data is stored in the as_conf.experiment_data dictionary
as_conf.experiment_data
# Obtain only section data
as_conf.jobs_data
# Obtain only platforms data
as_conf.platforms_data
# Obtain all data in parameter format( %SECTION%.%SUBSECTION%.%SUBSECTION% )
parameters = as_conf.deep_parameters_export(as_conf.experiment_data)
# To parse the placeholders from a file use the following function
#write sample text
with open("as_sample.txt", "w") as f:
    f.write("This is a sample text with a placeholder %DEFAULT.EXPID%")

#write the parsed text
with open("as_sample_parsed.txt", "w") as f:
    f.write(as_conf.parse_placeholders(open("as_sample.txt","r").read(), parameters))


# print the file content
with open("as_sample.txt", "r") as f:
    print(f.read())
# print the file content
with open("as_sample_parsed.txt", "r") as f:
    print(f.read())
    
# Result must be:
# This is a sample text with a placeholder %DEFAULT.EXPID%
# This is a sample text with a placeholder expid

# delete samples
os.remove("as_sample.txt")
os.remove("as_sample_parsed.txt")
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://earth.bsc.es/gitlab/ces/autosubmit4-config-parser.git",
    "name": "autosubmitconfigparser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "climate, weather, workflow, HPC",
    "author": "Daniel Beltran Mora",
    "author_email": "daniel.beltran@bsc.es",
    "download_url": "https://files.pythonhosted.org/packages/b1/1e/ef01fa6a43ec77e671cb99228166d7c8ac41e8392c8753149a9cb498be7f/autosubmitconfigparser-1.0.76.tar.gz",
    "platform": null,
    "description": "Simple library that allows to read the data of an Autosubmit experiment.\n\n### Usage: ####\n\n```python\n#import the main config library\nfrom autosubmitconfigparser.config.configcommon import AutosubmitConfig\nimport os\n# Init the configuration object where expid = experiment identifier that you want to load\nexpid = \"a01y\"\nas_conf = AutosubmitConfig(\"a01y\")\n# This will load the data from the experiment\nas_conf.reload(True)\n\n#all data is stored in the as_conf.experiment_data dictionary\nas_conf.experiment_data\n# Obtain only section data\nas_conf.jobs_data\n# Obtain only platforms data\nas_conf.platforms_data\n# Obtain all data in parameter format( %SECTION%.%SUBSECTION%.%SUBSECTION% )\nparameters = as_conf.deep_parameters_export(as_conf.experiment_data)\n# To parse the placeholders from a file use the following function\n#write sample text\nwith open(\"as_sample.txt\", \"w\") as f:\n    f.write(\"This is a sample text with a placeholder %DEFAULT.EXPID%\")\n\n#write the parsed text\nwith open(\"as_sample_parsed.txt\", \"w\") as f:\n    f.write(as_conf.parse_placeholders(open(\"as_sample.txt\",\"r\").read(), parameters))\n\n\n# print the file content\nwith open(\"as_sample.txt\", \"r\") as f:\n    print(f.read())\n# print the file content\nwith open(\"as_sample_parsed.txt\", \"r\") as f:\n    print(f.read())\n    \n# Result must be:\n# This is a sample text with a placeholder %DEFAULT.EXPID%\n# This is a sample text with a placeholder expid\n\n# delete samples\nos.remove(\"as_sample.txt\")\nos.remove(\"as_sample_parsed.txt\")\n```\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "An utility library that allows to read an Autosubmit 4 experiment configuration.",
    "version": "1.0.76",
    "project_urls": {
        "Homepage": "https://earth.bsc.es/gitlab/ces/autosubmit4-config-parser.git"
    },
    "split_keywords": [
        "climate",
        " weather",
        " workflow",
        " hpc"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d791991eb56e96099140cde292b20dd2d5c11448e69dccf69fd2d1b9d5484f3",
                "md5": "bd1889c3f7686f1a1a715a066e77cd9f",
                "sha256": "259ab15313a821f30031c56152cec11b3c3dbea06c35431dce787094413c3240"
            },
            "downloads": -1,
            "filename": "autosubmitconfigparser-1.0.76-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bd1889c3f7686f1a1a715a066e77cd9f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 43478,
            "upload_time": "2024-12-16T14:01:04",
            "upload_time_iso_8601": "2024-12-16T14:01:04.552011Z",
            "url": "https://files.pythonhosted.org/packages/0d/79/1991eb56e96099140cde292b20dd2d5c11448e69dccf69fd2d1b9d5484f3/autosubmitconfigparser-1.0.76-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b11eef01fa6a43ec77e671cb99228166d7c8ac41e8392c8753149a9cb498be7f",
                "md5": "14645779a1691fd121a9adfc7258911c",
                "sha256": "a873ef3b35bce82d76e471c0f85147783d02060fd43e9de037976b827b46860c"
            },
            "downloads": -1,
            "filename": "autosubmitconfigparser-1.0.76.tar.gz",
            "has_sig": false,
            "md5_digest": "14645779a1691fd121a9adfc7258911c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 34817,
            "upload_time": "2024-12-16T14:01:06",
            "upload_time_iso_8601": "2024-12-16T14:01:06.428031Z",
            "url": "https://files.pythonhosted.org/packages/b1/1e/ef01fa6a43ec77e671cb99228166d7c8ac41e8392c8753149a9cb498be7f/autosubmitconfigparser-1.0.76.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-16 14:01:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "autosubmitconfigparser"
}
        
Elapsed time: 0.38300s