Satta is a powerful note taking tool that can help you capture and automate your ideas. This document goes over the technical details. The rest is left to your imagination…
Notes are organized as a tree similar to a filesystem. You can click on any file to open it.
Notes can be published under Views > Permissions
. There are several ways a note can be viewed/rendered:
To make editing easier, you can select your familar keybind:
If a note ends with .py
, it is treated as a Python script. Execute your scripts with Ctrl + B
shortcut.
To install Python PyPI packages, specify it here:
Internally, Satta spins up a VM to execute the script in a sandboxed environment. And yes, your script will have access to the internet.
Here is an example: link
Scripts can be scheduled using crontabs.
The timezone of your browser is important because the hour field uses this info.
You can read and write notes within a Python script. There are three built-in Python functions:
get_note(name: str) -> str
set_note(name: str, value: str)
delete_note(name: str)
The name of the note is similar to a file path: path/to/file.txt
.
This is useful persisting state across script executions:
prev = get_note("prev_balance")
curr = find_curr()
if curr < prev:
alert("not found")
Satta parses your Python script to create a list of functions. Each function is turned into a button and its signature is used as the inputs.
Satta currently supports these are the Python types as parameters:
str
int
float
bool
On the web interface, once the user runs a function, a function call with the supplied arguments is appended temporarily to the end of your script.
The docstring for the file is parsed as Markdown and added to the webpage. Similarly the function docstring is added to the form. Each argument also has comments.
Here is an example: link
Satta ignores functions whose names start with ‘_’(underline). These are treated as private functions and not exposed on the web app.
Sometimes, for testing, it is easier to write the logic outside functions. We can do that with
if __name__ == "__main__":
For web apps, the __name__
variable is set to something else so the block is ignored.