Basic Integration Platform
Project description
Basic Integration Platform
Provides all-in-one package with:
- tracing
- journal
- Web UI
Tends to help to create basic integration solutions. Heavily inspired by node-red.
Install
pip install binp uvicorn
Example:
from random import randint
from binp import BINP
bip = BINP()
@bip.app.post('/random', response_model=int)
@bip.journal
async def generate_random():
"""
Generate random number in range 0 ... 1024
"""
return randint(0, 1024)
@bip.action
@bip.journal
async def currency_rate():
"""
Fetch currency rate for EUR -> USD
"""
# go to external service
euro = 1.3
await bip.journal.record('rates fetched', base_currency='USD', euro=euro)
Save as 'example.py' and run it by
uvicorn example:bip.app
It will expose
- http://127.0.0.1:8000 - UI and API
- http://127.0.0.1:8000/docs - Swagger docs for user-defined APIs
- http://127.0.0.1:8000/internal/docs - Swagger docs for internal APIs
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
binp-0.0.2.tar.gz
(121.0 kB
view hashes)
Built Distribution
binp-0.0.2-py3-none-any.whl
(122.3 kB
view hashes)