Package: notes-pico
Notes Pico is a simple note-taking web application. It was originally
written by Charles Leifer as a demo of how to write a simple, but slick
web application using the Flask web micro-framework. The application is
described in the blog posthttp://charlesleifer.com/blog/saturday-morning-hack-a-little-note-taking-app-with-flask/. Notes Pico is a port of this application to the
[Picoweb](https://github.com/pfalcon/picoweb/) web pico-framework
for Pycopy (https://github.com/pfalcon/pycopy), a minimalist Python
implementation. It was ported by Paul Sokolovsky.Deploying on Pycopy “Unix” versionTo install and run the application, you should install Pycopy
“Unix” port as described athttps://github.com/pfalcon/pycopy.
Once you havepycopyexecutable in your PATH (recommended, but
not strictly necessary), change directory to where you want to install
the app (~/tmp/should be good for a quick test) and installnotes-picopackage:pycopy -m upip install -p app notes-picoapp(argument of-poption) is a subdirectory into which to
install the application. To run the app, execute:MICROPYPATH=app pycopy -m notes_picoThis will initialize note storage and output a URL to open in a browser:* Running on http://127.0.0.1:8081/Open the link and start adding notes (after typing text press “Add note”
button or press Ctrl+Enter). Note that Picoweb port is intended to be
simple and low-resource, so supports only plain-text notes, unlike the
original Flask application.Deploying on embedded Pycopy targetsNotes Pico can also run on “embedded” (microcontroller) Pycopy
targets with networking capabilities and suitable heap size (TBC).
As Notes Pico is full-stack application and contains relatively a
lot of code, the only realistic way to deploy it on such systems is
using “frozen bytecode” approach, where pre-compiled Python modules
are made part of the binary firmware image to flash on the target.
Instructions below use Pycopy ESP8266 port as an example.cd pycopy/ports/esp8266pycopy-mupip install-pmodulesnotes-picomakemake deploy(see README in the directory for more params)Boot ESP8266 module, run following commands at the device prompt.import notes_pico.__main__notes_pico.__main__.main(host="0.0.0.0")Connect with a web browser tohttp://DEVICE_IP:8081, whereDEVICE_IPis an IP address of ESP8266 device. (Consult Pycopy
ESP8266 port documentation for network connection setup.)Storage backendsNotes Pico supports 3 storage backends:BTreeFilesystemSQLite3As a first step towards portability to Pycopy microcontroller
versions, the default backend for the package installed from PyPI
via the commands in the previous section is BTree database. The
notes are stored innotes.dbdatabase file of the current
directory, in BerkeleyDB 1.x format.If you would like to try filesystem/SQLite3 backend, you’ll need to
checkouthttps://github.com/pfalcon/notes-picoand edit filenotes_pico/config.py. The repository has a convenience
Makefile to install dependencies and run the application, similar
to the effect achieved by the commands above.Known issues and limitationsAs mentioned above, Picoweb port of the application supports only
plain-text notes, no formatting, images or videos.Embedded targets support is experimental, added in version 0.8.