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
csvsql -h
usage: csvsql [-h] user password host database table filename
positional arguments:
user user for database login
password password for login if necessary
host host IP for database
database database to run queries on
table table to insert into (will create new if doesn't exist)
filename filepath of CSV file to insert
optional arguments:
-h, --help show this help message and exit
--overwrite Overwrite already-present table in database
example
csvsql test test HOST Test test_table ./TestDocs/test.csv
The above example connects to the Test database using the test user and inserts the test.csv file into test_table.
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.Session import Session
sess = Session('username','password', 'localhost', db='Test')
sess.create_table('test_table', ['column1', 'column2', 'column3'], \
[int, int, int])
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.
License
Metadata
Release files for cssaw-central 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cssaw_central-1.3.0.tar.gz | 5.8 kB | Without provenance | Details for cssaw_central-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cssaw_central-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for cssaw_central-1.3.0-py3-none-any.whl |
Total release size: 17.6 kB
Release files / cssaw_central-1.3.0.tar.gz
| Download URL | cssaw_central-1.3.0.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47cffd00029dd67713d4982a3dbf00fdbd46c837bda260022a137fa35435068a
|
|
BLAKE2b-256 checksum How to use checksums |
c50f7c781fa76abf14698d580616cf6bc1aa75d54438271e66abe39f19902138
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Release files / cssaw_central-1.3.0-py3-none-any.whl
| Download URL | cssaw_central-1.3.0-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b9ae7d9f9c4127a3175cc6745a599faceef9b6034546be9bcae0d8558f98820
|
|
BLAKE2b-256 checksum How to use checksums |
fec8d39d75260e53a0c8e88430b46bdf1708683723f6fd546473e61525ea8563
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
|
Security for cssaw-central 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.