Python wraper for extracting data from ODBC Source to CSV using Rust, made to be memory eficient and fast!
Project description
RUST ODBC 2 CSV
Extracting data from ODBC Source to CSV using Rust, made to be memory eficient and fast!
import os, json
from py_rust_odbc_csv import odbc_csv
REQUIRED PARAMETERS
the required parameters are the ODBC connection string and the query to be executed, but you can also pass the bach size and the desired filename
conn = f"Driver={{ODBC Driver NAME}};System=host;Uid={os.environ['USERNAME']};Pwd={os.environ['PASS']}"
query = "SELECT * FROM \"DB\".\"TABLE\""
EXCUTION
To execute we call the odbc_csv function and pass the list of arguments:\
- 1st ODBC Connection String;
- 2nd Query String;
- 3rd Bach Size, Number of rows to load at a time (Optional);
- 4rd Required File Name, if not the csv file will be generate with a UUIDv4 name (Optional);
The result will be in JSON format (json {success: bool, msg: str, fname: str (path)}
)
res = odbc_csv([conn, query])
r = json.loads(res)
BUILD FROM SOURCE
maturin build --release -i python
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file py_rust_odbc_csv-1.0.1-cp311-none-win_amd64.whl
.
File metadata
- Download URL: py_rust_odbc_csv-1.0.1-cp311-none-win_amd64.whl
- Upload date:
- Size: 183.1 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a84fc36fd3fe4d4354e8e4c9cbb63e69660dda4d8191e2c1ce27815090f8c2d |
|
MD5 | 55562bd2d80ceacb1d2f947900b69e9c |
|
BLAKE2b-256 | a93785138918593081eee4a13f3c606ae759f47b14356ed3a75c03a4e70ea3a5 |
File details
Details for the file py_rust_odbc_csv-1.0.1-cp310-none-win_amd64.whl
.
File metadata
- Download URL: py_rust_odbc_csv-1.0.1-cp310-none-win_amd64.whl
- Upload date:
- Size: 183.1 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22a0fee3cdba933a47a1616f3e902a6b91fbc98e18c0bdf88164dbecd48cce1e |
|
MD5 | 3fc35b491b8563a0d4274c9f295c2cd8 |
|
BLAKE2b-256 | f55782f93da38c71842f666da5be79e72a6b3cad69983f37420d50e10152b90b |