Skip to main content

Pass directories between metaflow steps.

Project description

Magic Directories

An experimental plugin for passing data in directories in between steps.

Warning: this package is highly experimental.

Installation

pip install metaflow-plugin-magicdir

Usage

You can use @magicdir to pass local directories between metaflow steps. This will also work remotely.

#flow.py
from metaflow import FlowSpec, step
from metaflow.plugins import magicdir

class MagicDirFlow(FlowSpec):

    @magicdir(dir='mydir')
    @step
    def start(self):
        with open('mydir/output1', 'w') as f:
            f.write('hello world')
        with open('mydir/output2', 'w') as f:
            f.write('hello world again')
        self.next(self.end)

    @magicdir(dir='mydir')
    @step
    def end(self):
        print('first', open('mydir/output1').read())
        print('second', open('mydir/output1').read())

if __name__ == "__main__":
    MagicDirFlow()

If you run the above flow, you will see:

python flow.py run --with batch

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

metaflow_plugin_magicdir-0.0.2.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file metaflow_plugin_magicdir-0.0.2.tar.gz.

File metadata

  • Download URL: metaflow_plugin_magicdir-0.0.2.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for metaflow_plugin_magicdir-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8fb8e3ca930e2ed6bc56da02e2a023fc86434c2406ea12613dce8f666bd44394
MD5 886d3db30efc03f9c3feae73b864373a
BLAKE2b-256 a0e89b07e7c711aed76a6ad7024873e1f03fea53bcdc7acd54a1b3dea6ebba36

See more details on using hashes here.

File details

Details for the file metaflow_plugin_magicdir-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: metaflow_plugin_magicdir-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for metaflow_plugin_magicdir-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b14d49247d2300006d7e09cc6a33ce6ed2356aa77d2dce02a7156070b442826e
MD5 08dec5bc65401fa03c287fa9797b5b22
BLAKE2b-256 6169465228ddfc1ca6a42c41c6aff2a1db51492f09c0a524e26aa334aa6c798b

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