Skip to content

Commit 30d41a2

Browse files
committed
Add initial code
0 parents  commit 30d41a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+3140
-0
lines changed

.bandit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bandit]
2+
exclude: tests

.checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- bandit
2+
- flake8
3+
- pydocstyle

.editorconfig

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.py]
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.{rst,ini,cfg}]
16+
indent_style = space
17+
indent_size = 4
18+
19+
[*.{yml,html,xml,xsl,json}]
20+
indent_style = space
21+
indent_size = 2
22+
23+
[*.{css,less}]
24+
indent_style = space
25+
indent_size = 2
26+
27+
[*.dot]
28+
indent_style = tab
29+
indent_size = 1
30+
insert_final_newline = false

.gitignore

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
db.sqlite3
58+
59+
# Flask stuff:
60+
instance/
61+
.webassets-cache
62+
63+
# Scrapy stuff:
64+
.scrapy
65+
66+
# Sphinx documentation
67+
docs/_build/
68+
69+
# PyBuilder
70+
target/
71+
72+
# Jupyter Notebook
73+
.ipynb_checkpoints
74+
75+
# pyenv
76+
.python-version
77+
78+
# celery beat schedule file
79+
celerybeat-schedule
80+
81+
# SageMath parsed files
82+
*.sage.py
83+
84+
# Environments
85+
.env
86+
.venv
87+
env/
88+
venv/
89+
ENV/
90+
env.bak/
91+
venv.bak/
92+
93+
# Spyder project settings
94+
.spyderproject
95+
.spyproject
96+
97+
# Rope project settings
98+
.ropeproject
99+
100+
# mkdocs documentation
101+
/site
102+
103+
# mypy
104+
.mypy_cache/

.travis.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
language: python
2+
sudo: true
3+
dist: xenial
4+
services:
5+
- redis-server
6+
- rabbitmq
7+
cache: pip
8+
python:
9+
- "3.5"
10+
- "3.6"
11+
- "3.7"
12+
addons:
13+
apt:
14+
packages:
15+
- python3-enchant
16+
- graphviz
17+
env:
18+
matrix:
19+
- DJANGO=20
20+
- DJANGO=21
21+
- DJANGO=master
22+
- TOXENV=docs
23+
matrix:
24+
fast_finish: true
25+
allow_failures:
26+
- env: DJANGO=master
27+
exclude:
28+
- python: "3.6"
29+
env: TOXENV=docs
30+
- python: "3.7"
31+
env: TOXENV=docs
32+
before_script:
33+
- |
34+
if [[ -z $TOXENV ]]; then
35+
export TOXENV=py$(echo $TRAVIS_PYTHON_VERSION | sed -e 's/\.//g')-dj$DJANGO
36+
fi
37+
- echo $TOXENV
38+
install:
39+
- pip install -U codecov tox
40+
script: tox -e $TOXENV
41+
after_success: codecov

CONTRIBUTING.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# How to contribute
2+
3+
## Design Goals
4+
5+
### M.U.S.T
6+
7+
This package follows a couple of MUST have design principles.
8+
9+
##### Maintainable
10+
11+
The package and it is features needs to be maintainable. It is more important
12+
upgrade to the latest Django or Python release than it is to add more
13+
features.
14+
15+
##### User friendly
16+
17+
The features, as well as the code, should be accessible to users and first time
18+
contributors. Documentation is key!
19+
20+
##### Specific
21+
22+
A good package solves only one problem and solves it well. We don't want people
23+
to add code to their runtime environment that they don't need.
24+
25+
##### Tested
26+
27+
All features need to be tested. A CI suite should be in place. Running and
28+
writing tests should be reasonably accessible for first time contributors.
29+
30+
31+
## Release
32+
33+
We follow [semantic versioning](https://semver.org/). To release a new version
34+
simply [create a new GitHub release][create-release], specify the version and
35+
add the changelog into the release description.
36+
37+
[create-release]: https://github.com/codingjoe/galahad/releases/new

LICENSE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ISC License
2+
3+
Copyright (c) 2018, Johannes Hoppe
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted, provided that the above
7+
copyright notice and this permission notice appear in all copies.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Galahad
2+
3+
**The workflow automation framework for machines with heart.**
4+
5+
Galahad is a free workflow automation framework designed to bring simplicity
6+
to complex workflows.
7+
8+
9+
## Design
10+
11+
### Principles
12+
13+
#### Common sense is better than convention
14+
15+
Galahad does not follow any academic modeling notation developed by a poor Phd
16+
student who actually never worked a day in their life. Businesses are already
17+
complex which is why Galahad is rather simple. There are only two types of
18+
tasks – human & machine – as well as edges to connect them. It's so simple a
19+
toddler (or your CEO) could design a workflow.
20+
21+
#### Lean Automation (breaking the rules)
22+
23+
Things don't always go according to plan especially when humans are involved.
24+
Even the best workflow can't cover all possible edge cases. Galahad
25+
embraces that fact. It allows uses to interrupt a process at any given point
26+
and modify it's current state. All while tracking all changes. This allows
27+
developers to automate the main cases and users handle manually exceptions.
28+
This allows you businesses to ship prototypes and MVPs of workflows.
29+
Improvements can be shipped in multiple iterations without disrupting the
30+
business.
31+
32+
#### People
33+
34+
Galahad is build with all users in mind. Managers should be able to develop
35+
better processes. Users should able to interact with the tasks every single
36+
day. And developers should be able to rapidly develop and test new features.
37+
38+
## Core Components
39+
40+
### Process
41+
42+
The `Process` object holds the state of a workflow instances. It is represented
43+
by a Django Model. This way all process states are persisted in your database.
44+
45+
Processes are also the vehicle for the other two components `Tasks` and
46+
`edges`.
47+
48+
### Task
49+
50+
A task defines the behavior or a process. It can be considered as a simple
51+
transaction that changes state of a process. There are two types of tasks,
52+
human and machine tasks.
53+
54+
Human tasks are represented by Django `View`s. A user can change the processes
55+
state via a Django form or a JSON API.
56+
57+
Machine tasks are represented by simple methods on the `Process` class. They
58+
can change the state and perform any action you can think of. They can decide
59+
which task to execute next (exclusive gateway) but also start or wait for multiple
60+
other tasks (split/join gateways).
61+
62+
Furthermore tasks can implement things like sending emails or fetching data
63+
from an 3rd party API. All tasks are executed asynchronously to avoid blocking
64+
IO and locked to prevent raise conditions.
65+
66+
### Edges
67+
68+
Edges are the glue that binds tasks together. They define the transitions
69+
between tasks. They are represented by a simple list of tuples. Edges have no
70+
behavior but define the structure of a workflow.

docs/commands.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
===================
2+
Management Commands
3+
===================
4+
5+
.. automodule:: galahad.management.commands
6+
7+
render_process_graph
8+
--------------------
9+
10+
Render graphs for all processes as SVG files to the working directory.

0 commit comments

Comments
 (0)