Skip to main content

Command file for scientific workflows.

Project description

Commandfile

PyPI version Build status Coverage Status License

Purpose and scope

Commandfile defines a file format to pass arguments and runtime metadata to executables. Its intended use case is to simplify and harmonize the calling convention of scientific modules in the LISA Scientific Ground Segment.

Usage

This project provides a drop-in replacement for the ArgumentParser provided by argparse.

# example.py
from commandfile.argparse import CommandfileArgumentParser as ArgumentParser

parser = ArgumentParser()
parser.add_argument("--some-value", type=int, required=True)
args = parser.parse_args()
print(args.some_value)

When using this parser, your program can either be executed by passing arguments on the command-line, or by providing a single --commandfile argument compliant with the file format specification. When developing locally, both approaches can be combined, the command-line arguments overriding the arguments specified in the commandfile.

$ cat example-cmdfile.yaml
header:
  version: 1.21.4
parameters:
  - key: some-value
    value: '42'
inputs: []
outputs: []
$ example.py --commandfile example-cmdfile.yaml
42
$ example.py --commandfile example-cmdfile.yaml --some-value 24
24

Project details


Download files

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

Source Distribution

commandfile-0.1.3.tar.gz (40.6 kB view details)

Uploaded Source

Built Distribution

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

commandfile-0.1.3-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file commandfile-0.1.3.tar.gz.

File metadata

  • Download URL: commandfile-0.1.3.tar.gz
  • Upload date:
  • Size: 40.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.5

File hashes

Hashes for commandfile-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8ff001141d026b0adaabf1134a1c09969079ef1cb76bff125be80ac035aec1e0
MD5 c70103a9485ce3b9d9f4a0b72eb96b25
BLAKE2b-256 c0462a88eb10d65a475072cb0e5527bd2b182b19467bef8af08980bd93b29088

See more details on using hashes here.

File details

Details for the file commandfile-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for commandfile-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 622d5f1fcffa1259469dde82c23add2e39a783beea9614428f085ab52d4a6298
MD5 130454ab596c3ed5e48494d3a53bd661
BLAKE2b-256 d867d2e08bc5db2077dcd6e0fce9fb57208f016f936ce6da97e0c27cff1a906d

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