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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Flask-kdb-1.0.0.tar.gz.
File metadata
- Download URL: Flask-kdb-1.0.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
696c6a2e2374483156f62776ddf999b842f4f68efc0c0fc6d46002544685480d
|
|
| MD5 |
dd79c751c8540726b9054d5ece76eeb5
|
|
| BLAKE2b-256 |
9a0614df9e6403fbe340bb9476de623b3c330a50be1de3cf6105968b1878a45a
|
File details
Details for the file Flask_kdb-1.0.0-py3-none-any.whl.
File metadata
- Download URL: Flask_kdb-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dba3a32e276b03634b5d5dcb1f5c68d5ad7044b2c44e05bd64c51342d6170d3
|
|
| MD5 |
5c7bc55229c1be158ef5b153262c1e83
|
|
| BLAKE2b-256 |
bdd098b70c56b8aec911419a37ca4ca33bddca7f8de659c544978bcbdf58727d
|