Browse Source

Initial commit

master
Illia Chub 1 year ago
commit
642bb02d32
  1. 0
      .gitignore
  2. 28
      main.py
  3. 3
      requirements.txt
  4. 7
      setup.py

0
.gitignore vendored

28
main.py

@ -0,0 +1,28 @@
from flask import Flask
from flask_restful import Resource, Api, reqparse
import pyodbc
def main():
global databaseConnectionDescriptor
global databaseSelector
app = Flask(__name__)
storage = Api(app)
if __name__ == '__main__':
app.run(port=5051, debug=False)
def ExecuteArbitraryQuery(databaseSelector, query: str):
databaseSelector.execute(query)
def InsertRowIntoTable(databaseSelector, table: str, rows: str, values: str):
databaseSelector.execute(
"INSERT INTO " + table + "(" + rows + ")" +
"VALUES" + "(" + values + ")"
)
databaseConnectionDescriptor = pyodbc.connect('DRIVER={Devart ODBC Driver for SQLite};Direct=True;Database=selfprivacy-storage;String Types= Unicode')
databaseSelector = databaseConnectionDescriptor.cursor()
main()

3
requirements.txt

@ -0,0 +1,3 @@
pyodbc
flask
flask_restful

7
setup.py

@ -0,0 +1,7 @@
from distutils.core import setup
setup(
name='selfprivacy-storage-api',
version='0.0.1',
scripts=['main.py',],
)
Loading…
Cancel
Save