Inspiration

During my research as a graduate student, I end up needing to record many equations specific to my field. Instead of storing the equations in a static document, I wanted a more interactive form of documentation that would let me use the equations. But I didn't want to maintain an entire web app for it, so I decided to create a library to simplify development of an interactive equation sheet.

Furthermore, this library could be used to generate web-based user interfaces for prototypes of applications. Especially for domain experts who know programming (computational scientists, ML practitioners) who are familiar with programming but do not have extensive web development experience.

What it does

This library creates a form-based UI for functions by generating frontend and backend endpoints based on a functions signature (input parameters/variables) and documentation (rst/sphinx style docstring). A complete web app can be created with the same effort required to create a FastAPI backend.

How we built it

This library is built on top of FastAPI which is used to serve all the end points. The front end web pages are generated using Jinja2 HTML templating and the website uses the AttriCSS classless stylesheet. Function signature inspection was done through the inspect library from inspect, a standard python library. Documentation parsing was done through the docstring_parser python library. The python library was built and distributed using the poetry tool.

Challenges we ran into

The differences between form encoded data and json encoded data meant that a small amount of javascript had to be used in the front end for proper communication in the backend. Since the generated endpoints required the dynamic generation of functions and classes, some bug fixes/work around I found to solve certain issues could not be implemented with dynamically generated objects.

Accomplishments that we're proud of

I managed to get a functional version of the library working and published to the python package index PyPI

What we learned

  • How to dynamically generate classes in python
  • How html forms communicate with the backend
  • How to publish a python library

What's next for autoserver (autoserver)

  • Proper Testing and Library Documentation
  • More supported types (Booleans, Custom Enumerations)
  • Generating files for Docker, Terraform and Ansible to automate deployment
  • Support for displaying LaTeX

Built With

Share this project:

Updates