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 + RabbitMQ
- TODO: Kafka Hooks
- TODO: Redis 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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91784afde87799404cede1d37c7a7b0c72f36d9618a9b5f743c227e99f6f799b |
|
MD5 | 667ca1af0257c9a27e5f3f8932524fe1 |
|
BLAKE2b-256 | d052a90f76e60e8bba62730654ee4f1e8eba5fef80c9a7d527980975fe0f5b17 |
Close
Hashes for dead_simple_framework-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 590e1d778b8fa49a5b61c3bcf943df73363f7dd10f66d4c4b6f991e1b071991e |
|
MD5 | 5fcb55e6eb1478354f8f0cf1898a154f |
|
BLAKE2b-256 | cf01d99876f86e470b0c18c60419590b04b3a304ff44a72b46d8e0c926df8644 |