Access Point Module to CSSAW Database
Project description
CSSAW_Central
Installation
pip install cssaw-central
Usage
csvsql script
The package comes with a script to automatically upload a csv file to the given table in a sql database. It takes user, pass, host IP, database, table, and cSV file path as arguments
example
csvsql test test HOST test_table ./TestDocs/test.csv
Session module
Session object acts as a wrapper for sqlalchemy connection. The connection is created and stored in the Session object at initialization, and any results can be taken from the self.conn object or, if using execute_sql(), can be taken from the returned results python list.
Example:
from cssaw_central import Session
sess = Session('test','test', 'localhost', db='Test')
sess.create_table('test_table', ['column1', 'column2', 'column3'], \
['int', 'int', 'int'], ['True', 'False', 'False'])
sess.insert('test_table', ['column1', 'column2', 'column3'], [0, 1, 2])
print(sess.execute_SQL('./queries/test.sql'))
The above script will create a connection to the Test database at localhost:3306 (assuming that it exists), insert the given values into their appropriate columns in test_table, and then execute test.sql from the queries file.
To Do:
- Stripped implementation of SELECT
- Stripped implementation of UPDATE
- Stripped implementation of JOIN
License
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
Hashes for cssaw_central-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6bc6802f1281127ef5892eed548377ab05265ca814a183cf8c241fba88a426d |
|
MD5 | f765c4479a5d6966b5f59b46139284ab |
|
BLAKE2b-256 | b7df1fe6f00531ffaca1113de288afea12032347b166f147846273a34b5a92e7 |