Made with Python Version: 3.9.4
- Create a venv inside moa directory
- Install requirements in the requirements.txt
- Activate venv
- Go to moa/app directory
- Run
python app.py
MOA (Matrix Operations Application) is a simple web app for editing your Excel matrix.
It's designed for people who want to group the rows and columns inside their Excel matricies quickly and easily. If you have a matrix at the size of 10x10, of course you can do it by hand. But what if you had a matrix size of 64x64. Then things would get really slow and tedious. So MOA was created.
MOA exists of two parts:
Inside the moa/app you can see a directory called matrix_processor. That is the part that handles matricies and file conversions. The rest of the files and folders inside moa/app is for the web app part.
Matrix Processor ( moa/app/matrix_processor ):
Inside matrix_processor directory there are five modules:
-
converters.py:
This module handles .xls and .xlsx file formats. It has two classes XlsFile() and XlsxFile(). These classes have a parse() method which will parse the file and return a Matrix() object. They can also take a Matrix() object and write it to a file with their write() method. -
errors.py:
This module has custom errors defined inside it. -
group_manager.py:
This module has a method called build_with() which reads the blueprint that the client has sent and returns a Matrix() object. -
matrix_processor.py:
This is the module that app.py interacts with. This module calls all of the other modules inside this directory. -
matrix.py:
Matrix() object is defined inside here.
-
/db:
Has matricies.db inside it. When a client uploads their Excel file it'll get converted to a Matrix() object. Then that Marix() object will be stored inside this table with client's session_id. -
/downloads:
When the client sends an export request, the blueprint that the client sent will be automatically converted to a file and written to this location. -
/static:
Static folder for Flask (a Python framework for web applications). Has gifs, images and JavaScript files inside. -
/templates:
Templates folder for Flask. Has the HTML files inside. -
app.py:
Entry point for the Flask app. Handles serving the web page and client requests. -
config.py:
A config file for Flask. Assigns download location, secret key, etc. -
session_id.py:
Has a Session_ID class. It's just for generating an ID for each session so that it can be stored inside the matricies.db. It has a max limit of 10.000 so after that it'll start from 0 again. So the database cannot get to big. This is to prevent breaking the max memory limit of the pythonanywhere.com.
Other Files:
- moa/requirements.txt:
For creating a venv with pip. - moa/env.json:
For computer specific variables. - moa/remote.txt:
Link to github repo - moa/docs: Has buch of documents. You can just ignore these.