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.2.0.tar.gz (42.9 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.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for commandfile-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3c92193ff3ffac440c73cda94e84cd9278370659fd23d247a08a1070a6f61192
MD5 44c91ee9285e523b0f40b35a587360c9
BLAKE2b-256 5d0e6074f9c5aa0f8ef8b9cd2e666fceef0d7d9b948ba7029e853fdfb4ed3d8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for commandfile-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac5c2c329426a0db333e34892acf103f4ed61df843105cfa46b279cd2ffc0d9d
MD5 939af9a340047f171c192b33aa503da4
BLAKE2b-256 d2893b9b3272104ac9a82c15356770874d60a34775da774c987e740d27e421b1

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