Skip to main content

A Notebook alternative that supports branching code

Project description

Codacy Badge made-with-python PyPI

GitHub license Open Source Love png1 Documentation Status

Maintenance PRs Welcome

GitHub issues GitHub issues-closed

Say Thanks!

Satyrn

Satyrn Satyrn is an alternative to Jupyter notebooks that supports branching code cells and network collaboration.

What that means

Code in Satyrn is executed in "Cells", which are small blocks of code that should perform a few small functions, but share variables, functions, imports, etc. Splitting code into these Cells allows users to run lots of "setup" cells and then play around with a cell that depends on the setup to function. This prevents users from having to run lengthy code over and over again. A similar application is Jupyter's Notebook.

Most code is executed as a list of instructions,

print(1)
print(2)
print(3)

However, Satyrn's code execution is different. Code inside of cells still executes normally, but cells are not necessarily linked linearly. One cell, which we'll call "root", can have two "Children", "childA" and "childB". Because root is the parent, it will run first. But because childA and childB are siblings on the same level in the heirarchy, they will be run simultaneously. This is particularly useful in situations like data analysis, where lots of data must be preprocessed before they can be used. If you have multiple sets of data to preprocess, why not preprocess them simultaneously instead of waiting for them to finish 1-by-1?

Satyrn is also a great tool for collaboration. While using the UI, the graph state is shared over your local network via a CherryPy WSGI server. This allows machines on your local network to edit the same code you're working on by navigating to your IP address in their browser, no Python/Satyrn installations required. If you desire more security, the --hidden command line argument will hide your Satyrn instance from the network. Use caution when working with Satyrn on public networks.

Contributors

Join the dev Discord!

Setup

  • Run python -m pip install satyrn-python
  • Run satyrn to open the UI (unstable)
  • Run satyrn cli to open the CLI

Command Line Arguments

  • cli - Starts the CLI instead of the UI

  • ui - Starts the UI (Default behavior)

  • -h --hidden - Starts the UI on 127.0.0.1 instead of 0.0.0.0, preventing machines on your local network to access your Satyrn instance

  • -p=n --port=n - Designates the port for the UI to run on

  • -q --quiet - Quiet startup + shutdown

CLI Commands

  • quit - Quits out of interpreter

  • cell [cell_name] [content_type](python/markdown) [add_content](y/n)

    • Creates cell with given parameters
    • All cells require unique names
    • The first cell created will always be treated as the "root" cell, and will always be executed first in a complete execution call.
    • Set content_type to "python" for python cells
    • If add_content is "y", a text box will pop up. Input your python code here.
  • remove [cell_name]

    • Deletes cell and its links from graph.
  • edit [cell_name]

    • Reopens text input window so that users can edit cells
  • link [first_cell_name] [second_cell_name]

    • Links the two cells whose names are provided. You can technically still make branching graphs this way, but they will not work at all.
  • sever [first_cell_name] [second_cell_name]

    • Severs the link between the two cells whose names are provided
  • merge [first_cell_name] [second_cell_name]

    • Merges the two cells if they are adjacent.
  • swap [first_cell_name] [second_cell_name]

    • Swaps the contents and names of the named cells. e.g.
      • a -> b -> c
      • swap a b
      • b -> a -> c
  • execute [cell_name_1] [cell_name_2] ...

    • If no cell names are defined, the entire graph will execute sequentially
    • If cell names are defined, they will execute in the order they are named
  • display [cell_name]

    • If cell_name is defined, that cell's contents will be printed to the console
    • Otherwise, the entire graph will be displayed in matplotlib.
  • list

    • Prints a list of all cell names and edge pairs in graph
  • reset_runtime

    • Deletes all local variables created by cells.
  • reset_graph

    • Deletes all cells and variables. Equivalent of restarting Satyrn session.
  • save [filename]

    • Saves graph, supported formats are .satx, .py, and .ipynb.
  • [filename]

    • This will run a .satx file. It's just a reformatted version of the normal Satyrn input. This test file shows the basic syntax rules.

CLI Example

Here, code written in [ ] brackets was typed into the text box popup.

♄: cell root python y
[x = 10]
♄: cell mid python y
[x *= 22]
♄: cell bottom python y
[print(x)]
♄: link root mid
♄: link mid bottom
♄: execute
220
♄: quit

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

satyrn_python-0.8.9.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

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

satyrn_python-0.8.9-py3-none-any.whl (2.5 MB view details)

Uploaded Python 3

File details

Details for the file satyrn_python-0.8.9.tar.gz.

File metadata

  • Download URL: satyrn_python-0.8.9.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.5

File hashes

Hashes for satyrn_python-0.8.9.tar.gz
Algorithm Hash digest
SHA256 9e50ee1889166c95cd52cd4fed3311dd5c8fed3512d22c95a6cb95c2f281f30e
MD5 635aaea1587edde1441c8e013b40aade
BLAKE2b-256 37a8138f516e7ad378012b226f03db27c8ddd018b64108a09ab4f59eb78f7749

See more details on using hashes here.

File details

Details for the file satyrn_python-0.8.9-py3-none-any.whl.

File metadata

  • Download URL: satyrn_python-0.8.9-py3-none-any.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.5

File hashes

Hashes for satyrn_python-0.8.9-py3-none-any.whl
Algorithm Hash digest
SHA256 d2214356043fb3951ea6e5a77e52442b6f4961cb9c57a4ef76e842b912fea2f4
MD5 d8f7cb59daf7613e0b37d1a433140fb2
BLAKE2b-256 6e7eb47d78af1174dc88666d9d40858ec6b319757de8171db374bf869f390b1a

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