Simple library that allows to read the data of an Autosubmit experiment.
Usage:
#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")
Metadata
Release files for autosubmitconfigparser 1.0.79
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autosubmitconfigparser-1.0.79.tar.gz | 36.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autosubmitconfigparser-1.0.79-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 76.4 kB
Release files / autosubmitconfigparser-1.0.79.tar.gz
| Download URL | autosubmitconfigparser-1.0.79.tar.gz |
|---|---|
| Size | 36.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
465358abc4c41397ff2f7a985c5c484d36d7f123184b227d03463758bc7d7639
|
|
BLAKE2b-256 checksum How to use checksums |
91031cd5aabb8125b2989608d0425ef0a63c128a4261e3b64510a67d242cfaa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Release files / autosubmitconfigparser-1.0.79-py3-none-any.whl
| Download URL | autosubmitconfigparser-1.0.79-py3-none-any.whl |
|---|---|
| Size | 40.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2649fa2c01a4b8b6379a17cc76b4767eea0c94180c74e04a22619542e506563b
|
|
BLAKE2b-256 checksum How to use checksums |
4f38f923a73d91d722e145b6b41383e9835e384d1006d0fb8f7e562db788e0f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|