Skip to main content

An utility library that allows to read an Autosubmit 4 experiment configuration.

Project description

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")

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autosubmitconfigparser-1.0.79.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autosubmitconfigparser-1.0.79-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file autosubmitconfigparser-1.0.79.tar.gz.

File metadata

  • Download URL: autosubmitconfigparser-1.0.79.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for autosubmitconfigparser-1.0.79.tar.gz
Algorithm Hash digest
SHA256 465358abc4c41397ff2f7a985c5c484d36d7f123184b227d03463758bc7d7639
MD5 1a3b2faa3f5e22d0b44429924d22496a
BLAKE2b-256 91031cd5aabb8125b2989608d0425ef0a63c128a4261e3b64510a67d242cfaa0

See more details on using hashes here.

File details

Details for the file autosubmitconfigparser-1.0.79-py3-none-any.whl.

File metadata

File hashes

Hashes for autosubmitconfigparser-1.0.79-py3-none-any.whl
Algorithm Hash digest
SHA256 2649fa2c01a4b8b6379a17cc76b4767eea0c94180c74e04a22619542e506563b
MD5 5e54eb2dd24a15a93401b9a59b7d82ac
BLAKE2b-256 4f38f923a73d91d722e145b6b41383e9835e384d1006d0fb8f7e562db788e0f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page