Skip to content
Example repo for Luigi projects
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/luigi_tree
test
.gitignore
MANIFEST.in
README.rst
setup.py

README.rst

Luigi Tree

Luigi Tree is an example project based on the Luigi Python package. Once installed you can create Pascal triangle like dependency graphs using the Luigi scheduler. This project can be used as an example starting point for anyone who is working to build a command line application based on the Luigi framework.

Background

This project was created in an effort to help anyone getting started working with Luigi. I have tried my best to make this project as "real world" as possible by using Python's setuptools for requirements and directory structure. I have also included unit tests which can be run with the following command:

python setup.py test

Check out the Luigi documentation for more code examples and use cases. I also did a blog post which goes into more detail about the usage and reasoning for this project here.

Installation

Clone luigi_tree and install it using a virtual environment:

git clone https://github.com/dsfcode/luigi_tree.git
cd luigi_tree
virtualenv /PATH/TO/VENV/luigi_tree
source /PATH/TO/VENV/luigi_tree/bin/activate
pip install .
# Optionally run the luigi server (defaults to http://localhost:8082/static/visualiser/index.html)
luigid
# Run luigi_tree with default options
luigi_tree

Usage

usage: luigi_tree [-h] [--level LEVEL] [--sleep SLEEP]
                  [--output-dir OUTPUT_DIR] [--server SERVER] [--port PORT]

optional arguments:
  -h, --help            show this help message and exit
  --level LEVEL         Set the number of levels the tree will have, default
                        is 2
  --sleep SLEEP         Set how many seconds each task will sleep for, default
                        is 2
  --output-dir OUTPUT_DIR
                        Directory path to write output targets to, default is
                        /tmp
  --server SERVER       Server the luigi scheduler is running on, default is
                        localhost. If there is no server running luigi_tree
                        will run using the local-scheduler
  --port PORT           Port the luigi scheduler is running on, default is
                        8082
You can’t perform that action at this time.