Skip to main content

Describe and run systems diagrams.

Project description


# Systems

`systems` is a set of tools for describing, running and visualizing
[systems diagrams](https://lethain.com/systems-thinking/).


Installation directions are below, and then get started by [working through the tutorial](./docs/tutorial.md)
or reading through the [Jupyter notebook example](../notebooks/hiring.ipynb) example.

For a more in-depth look at the system syntax, please read [the syntax specification](./docs/spec.md).

## Quickest start

Follow the installation instructions below, then write a system definition
such as:

Start(10)
Start > Middle @ 2
Middle > End

You can then evaluate your system (use `--csv` for an importable format):

cat tmp.txt | systems-run -r 3

Start Middle End
0 10 0 0
1 8 2 0
2 6 3 1
3 4 4 2

You can also export your system into [Graphviz](https://www.graphviz.org/):

cat tmp.txt | systems-viz

// Parsed
digraph {
0 [label=Start]
1 [label=Middle]
2 [label=End]
0 -> 1
1 -> 2
}

From there you could push that output through Graphviz's
`dot` renderer to generate a diagram:

cat tmp.txt | systems-viz | dot -Tpng -o tmp.png
open tmp.png

See [the tutorial](./docs/tutorial.md) for more detailed starting information.

## Jupyter notebooks

Likely the easiest way to iterate on a model is within a Jupyter notebook.
See an [example notebook here](./notebooks/hiring.ipynb).
[Read this blog post for more installation details](https://lethain.com/systems-jupyter-notebook/).

## Installation

To install via PyPi:

pip install systems

To install for local development:

git clone https://github.com/lethain/systems.git
cd systems
python3 -m venv ./env
source ./env/bin/activate
python setup.py develop

Run tests via:

python3 -m unittest tests/test_*.py

Please open an Github issue if you run into any problems!

## Using the command line tools

Run a model in a file:

cat tmp.txt | systems-run -r 3

Visualize a model into `dot` for Graphviz:

cat examples/hiring.txt | systems-viz | dot


## Uploading distribution

If you are trying to install this on PyPi, the steps are roughly:

python3 -m pip install --user --upgrade pip
python3 -m pip install --user --upgrade wheel
python3 -m pip install --user --upgrade twine
python3 setup.py sdist bdist_wheel
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*

That should more or less work. :)


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

systems-0.0.6.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

systems-0.0.6-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file systems-0.0.6.tar.gz.

File metadata

  • Download URL: systems-0.0.6.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for systems-0.0.6.tar.gz
Algorithm Hash digest
SHA256 1047cf9dba0c4911f20f0f5ae1e715f93189d774e6caff06dd3867a906f43534
MD5 23b4053a23760e70ee8276fc1f34f193
BLAKE2b-256 6a13d6138c3b99bbd9cdf919c313ae6c68ace6f52a07a67e2a5d00d555ea9ba9

See more details on using hashes here.

File details

Details for the file systems-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: systems-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.3

File hashes

Hashes for systems-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a6be20d72a54541199eef231a97b5dd82ce011de79c0ed13895579459431e536
MD5 4ff86fbe9e4f8238a20d4b5e856470d2
BLAKE2b-256 a9d435cd5e4d41947b073e8a8d8679ec5c725db8ca40532a3274eddc194239b8

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