Skip to main content

alkymi - Pythonic task automation

Project description

alkymi ⚗️

build docs coverage pypi versions

Alkymi is a pure Python (3.6+) library for describing and executing tasks and pipelines with built-in caching and conditional evaluation based on checksums.

Alkymi is easy to install, simple to use, and has no dependencies outside of Python's standard library. The code is cross-platform, and allows you to write your pipelines once and deploy to multiple operating systems (tested on Linux, Windows and Mac).

Documentation, including a quickstart guide, is provided here.

Features

  • Easily define complex data pipelines as decorated Python functions
    • This allows you to run linting, type checking, etc. on your data pipelines
  • Return values are automatically cached to disk, regardless of type
  • Efficiently checks if pipeline is up-to-date
    • Checks if external files have changed, bound functions have changed or if pipeline dependencies have changed
  • No domain specific language (DSL) or CLI tool, just regular Python
    • Supports caching and conditional evaluation in Jupyter Notebooks
  • Cross-platform - works on Linux, Windows and Mac
  • Expose recipes as a command-line interface (CLI) using alkymi's Lab type

Sample Usage

For examples of how to use alkymi, see the quickstart guide.

Example code:

import numpy as np
import alkymi as alk

@alk.recipe()
def long_running_task() -> np.ndarray:
    # Perform expensive computation here ...
    hard_to_compute_result = np.array([42])
    # Return value will be automatically cached to disk
    return hard_to_compute_result

result = long_running_task.brew()  # == np.ndarray([42])

Or one of the examples, e.g. MNIST.

Upcoming Features

The following features are being considered for future implementation:

  • Type annotations propagated from bound functions to recipes
  • Support for call/type checking all recipes (e.g. by adding a check command to Lab)
  • Cache maintenance functionality
  • Parallel execution of pipeline

Known Issues

  • alkymi currently doesn't check custom objects for altered external files when computing cleanliness (e.g. MyClass has a self._some_path that points to a file somewhere outside alkymi's internal cache)
  • alk.foreach() currently only supports enumerable inputs of type List or Dict
  • Recipes marked transient will always be dirty, and thus always require reevaluation. This functionality should be replaced by a proper means of creating recipes that don't cache outputs, but only run when needed to provide inputs for downstream recipes

Installation

Install via pip:

pip install --user alkymi

Or see the Installation page.

Testing

After installing, you can run the test suite (use the lint, coverage and type_check recipes to perform those actions):

python3 labfile.py brew test

License

alkymi is licensed under The MIT License as found in the LICENSE.md file

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

alkymi-0.0.7.tar.gz (55.3 kB view details)

Uploaded Source

Built Distribution

alkymi-0.0.7-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file alkymi-0.0.7.tar.gz.

File metadata

  • Download URL: alkymi-0.0.7.tar.gz
  • Upload date:
  • Size: 55.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.2

File hashes

Hashes for alkymi-0.0.7.tar.gz
Algorithm Hash digest
SHA256 69e7fe7f4de1fed363f917e89f2d589a42b5fedeca6a08bfdca62bea13b63d02
MD5 4fbfd6ed7d6bd3c5114b20d3bffc8889
BLAKE2b-256 5719a7f11831a795ac305a2cff8372d421d31c0c27a9b6113ce71e732c9ff799

See more details on using hashes here.

File details

Details for the file alkymi-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: alkymi-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.2

File hashes

Hashes for alkymi-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3048270cfa4a885ffb0fe4c519ad319ee4304cc2986d36dd11d1bed76ab90ae9
MD5 fe86b1dc63502300e16fbd9e820a5baf
BLAKE2b-256 0b8338cbdbeee1a6d1ae7e368fedde446f0999ef9b07c8d1607ffcbdb373a131

See more details on using hashes here.

Supported by

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