kdb+ connections within a Flask application.
Project description
Flask & KDB (qPython3 | finos)
A repo designed to how to connect your Flask app to a q/KDB+ process using the finos python/kdb library - qPython3
Install
pip install Flask-kdb
Configuration
Thisis just a very basic showcase. Currently these envirnoment variables are used:
KDB_HOST
KDB_PORT
Usage
Import the class FlaskKDB and initialize using by using the constructor:
from flask import Flask
from flask_kdb import FlaskKDB
app = Flask(__name__)
app.config['KDB_HOST'] = 'localhost'
app.config['KDB_PORT'] = 5000
kdb = FlaskKDB(app)
or delayed initialisation (via init_app):
app = Flask(__name__)
app.config['KDB_HOST'] = 'localhost'
app.config['KDB_PORT'] = 5000
kdb = FlaskKDB()
kdb.init_app(app)
The first method is uses a persistant DB connection object that can be imported when required. I implemented this from this answer from toppatopvt on StackOverflow
References
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
Flask-kdb-1.0.0.tar.gz
(3.5 kB
view hashes)
Built Distribution
Close
Hashes for Flask_kdb-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dba3a32e276b03634b5d5dcb1f5c68d5ad7044b2c44e05bd64c51342d6170d3 |
|
MD5 | 5c7bc55229c1be158ef5b153262c1e83 |
|
BLAKE2b-256 | bdd098b70c56b8aec911419a37ca4ca33bddca7f8de659c544978bcbdf58727d |