Create JSON:API and Web App from database, with LogicBank -- 40X more concise, Python for extensibility.
Project description
Creates an executable API from a database:
API: swagger/OpenAPI and JSON:API compliant. Uses SAFRS , a modern approach that enables client applications to configure their own API to reduce network traffic.
Web App: a multi-page, multi-table web app; incorporates fab-quickstart.
Logic: spreadsheet-like rules for multi-table derivations and constraint that reduce transaction logic by 40X, using Logic Bank.
Installation
Install with pip:
cd ~/Desktop
mkdir server
cd server
virtualenv venv
source venv/bin/activate
# windows venv\Scripts\activate
pip install ApiLogicServer
Generation
ApiLogicServer create --project_name=my_api_logic_server
cd my_api_logic_server
virtualenv venv
source venv/bin/activate
# windows venv\Scripts\activate
pip install -r requirements.txt
Execution
python api_logic_server_run.py
python ui/basic_web_app/run.py
API: SAFRS JSON:API and Swagger
Your API is available in swagger:
Basic Web App - Flask Appbuilder
Generated fab pages look as shown below:
Multi-page: apps include 1 page per table
Multi-table: pages include related_views for each related child table, and join in parent data
Favorite field first: first-displayed field is “name”, or contains “name” (configurable)
Predictive joins: favorite field of each parent is shown (product name - not product id)
Ids last: such boring fields are not shown on lists, and at the end on other pages
Customize your app by editing ui/basic_web_app/app/views.py.
Logic:
Logic is declared in Python (example below), and is:
Extensible: logic consists of rules (see below), plus standard Python code
Multi-table: rules like sum automate multi-table transactions
Scalable: rules are pruned and optimized; for example, sums are processed as 1 row adjustment updates, rather than expensive SQL aggregate queries
Manageable: develop and debug your rules in IDEs, manage it in SCS systems (such as git) using existing procedures
The following 5 rules represent the same logic as 200 lines of Python:
Declare your logic by editing logic/rules_bank.py
More information:
The github project includes documentation and examples.
Acknowledgements
Many thanks to
Thomas Pollet, for SAFRS
Daniel Gaspar, for Flask AppBuilder
Achim Götz, for design collaboration
Change Log
0.0.6 - Initial Version
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for ApiLogicServer-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb22faeef9292762317f4fa080971b238f3ea4873bd4da36ae1c5f56bffe4c02 |
|
MD5 | eba9321f9be62ee2ad3e344d34df7023 |
|
BLAKE2b-256 | d1a449037119029f6a34d0359b719df37895e3fe76b94396d30b7c8af5eb4979 |