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": null,
"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.61",
"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": "b69d31ec08808dd075fcde1bb24044c366c26997d75c0da698e813a72220efe1",
"md5": "3bbf3f29fa002ca6234c2b2e9982788d",
"sha256": "9f8c4c8c6846e64f00a9f962f38649056d55b04238f1596d11dc6d3ac3bccf15"
},
"downloads": -1,
"filename": "autosubmitconfigparser-1.0.61-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3bbf3f29fa002ca6234c2b2e9982788d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 35646,
"upload_time": "2024-04-18T07:43:07",
"upload_time_iso_8601": "2024-04-18T07:43:07.874047Z",
"url": "https://files.pythonhosted.org/packages/b6/9d/31ec08808dd075fcde1bb24044c366c26997d75c0da698e813a72220efe1/autosubmitconfigparser-1.0.61-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-18 07:43:07",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "autosubmitconfigparser"
}