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.5.tar.gz (10.3 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.5-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: systems-0.0.5.tar.gz
  • Upload date:
  • Size: 10.3 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.5.tar.gz
Algorithm Hash digest
SHA256 811625e4d3a0f2cc47e6123c87ce7e32f45d9d652c7653e74a7516d8b27a4449
MD5 824311113624a5ce7cab5119491e3d4c
BLAKE2b-256 e78c02844da92236e114bcc3264e082c7223d9f5807f2d6bc186b005fb248033

See more details on using hashes here.

File details

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

File metadata

  • Download URL: systems-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 13.7 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 67a5a1d29db5df186f98df6d7335c62c28afd55d4b85d974bedb997fbc0a4fc3
MD5 c7a63debfde81f601a1c4aa1a99aba4f
BLAKE2b-256 f703985815278e4173ad2b0d9c222665397f7f5611d1446d2f74ec7389a16ae0

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