Specify APIs with a Python dict and run with one line
Project description
🙈 Dead Simple Web Framework 🙉
Overview:
A dead simple framework for web applications:
Backend:
- Python 3.7 [Flask]
- MongoDB
- Celery
- TODO: Kafka Hooks
- TODO: Redis Hooks
- TODO: RabbitMQ Hooks
Installing:
$ pip install dead-simple-framework
Configuration:
TODO
Example Application (demo.py
):
* MongoDB must be running *
$ mongod
$ rabbitmq-server
$ celery -A demo worker -l info
from dead_simple_framework import Application
sample_config = {
'routes': {
'/demo': {
'name': 'demo',
'methods': ['GET', 'POST', 'DELETE', 'PUT'],
'template': None,
'defaults': None,
'logic': None,
'collection': 'demo'
},
'/': {
'name': 'index',
'methods': ['GET'],
'template': None,
'defaults': None,
'logic': lambda: str(Application.run_task('add', [5, 8], kwargs={}).get()),
}
},
'tasks': {
'add': {
'logic': lambda x,y: x + y,
'schedule': None,
'timeframe': None
}
}
}
app = Application(sample_config)
if __name__ == '__main__':
app.run()
-
Starts a local server at http://0.0.0.0:5000/
-
Serves CRUD operations for MongoDB collection
demo
at endpoint/demo
. -
Runs and returns the result of an asynchronous Celery task at endpoint
/
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 Distribution
Close
Hashes for dead_simple_framework-0.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 557cb832406dd4e4f78f2fd6ced09ee795d8fdf8c247bc72a8f600dda2917975 |
|
MD5 | ac7909cdf335cd8f88e1f05a300c7aea |
|
BLAKE2b-256 | bdaf1e7b7e1f26f93c12dc0b01e571b426de6f5adacc3350751ed340274e5ad2 |
Close
Hashes for dead_simple_framework-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d6ca27df35da8c64ee1f25296fba3c55b9c2b8835a8d9f381cd82a0c91c4fa3 |
|
MD5 | 761d1ad8c10c5349781c1cca9802ede7 |
|
BLAKE2b-256 | 9d5bbeea12742c66f6ee0c016235084261e319ae8219f419a250001d6360a001 |