Skip to main content

Very basic pipelining toolbox

Project description

MicroPype

A tiny package to create very basic pipeline executing command lines and/or calling python functions.

Install

pip install micropype

API

Here are the two mains functions you need:

cached_run

Use it to execute a cammand line.

Arguments:

  • cmd: Command line
  • out_files: One or a list of file path(s) that are created by the command.
  • title:(str, default: None) - A title
  • log: (str, default: None) - A path to a log file (text file)
  • versions: (dict, default: None) - A dictionnary giving all the versions that must be logged
  • raise_errors: (bool, default: True) - Wether to raise python error if the command failed (if True) or just print error in the console and continue (if False)

cached_function_call

Use it to call a python function.

Arguments:

  • func: A callable python object (function)
  • args: List of the arguments
  • out_files: One or a list of file path(s) that are created by the command.
  • title:(str, default: None) - A title
  • log: (str, default: None) - A path to a log file (text file)
  • versions: (dict, default: None) - A dictionnary giving all the versions that must be logged
  • raise_errors: (bool, default: True) - Wether to raise python error if the command failed (if True) or just print error in the console and continue (if False)

Configuration file

Example

Here is an example of simple configuration file:

steps:
    do_ls: true
    do_myfunction: false

And then the pipeline:

from micropipe import cached_run, cached_function_call

log = "mylog.txt"

out_f = "lsOutput.log"
cached_run(
    f"ls -lrt >> {out_f}",
    out_f,
    "Listing current folder items",
    log_f
)

cached_function_call(
    myfuntion,
    [arg1, arg2],
    [file_1, file_2],
    title=f"Executing a python function",
    log=log_f
)

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

micropype-0.2.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

micropype-0.2.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file micropype-0.2.1.tar.gz.

File metadata

  • Download URL: micropype-0.2.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for micropype-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4b4f9a155e0db67554ae3295e0c5a93d2a475078806e351cf5924a06a180195c
MD5 d12902a8cf855743369dbd6fdd2166c2
BLAKE2b-256 c3dccc22ef8a1b6942ea22be415f1bc108d1411e01fed1d1d19a0cb477d8eee8

See more details on using hashes here.

File details

Details for the file micropype-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: micropype-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for micropype-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f131abb34e1e4b198f0a1667a60de1605f56ab24b5b06b780d705a3fbf8fb40c
MD5 b0bf18ff6a84eaae6e9eb241da25d8ad
BLAKE2b-256 a89537cc99e908e3d35eacbdda3de62976726c99047f9b9f025b94fff91555ba

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