Skip to main content

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

py_rust_odbc_csv-1.0.1-cp311-none-win_amd64.whl (183.1 kB view details)

Uploaded CPython 3.11 Windows x86-64

py_rust_odbc_csv-1.0.1-cp310-none-win_amd64.whl (183.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

File details

Details for the file py_rust_odbc_csv-1.0.1-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for py_rust_odbc_csv-1.0.1-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 6a84fc36fd3fe4d4354e8e4c9cbb63e69660dda4d8191e2c1ce27815090f8c2d
MD5 55562bd2d80ceacb1d2f947900b69e9c
BLAKE2b-256 a93785138918593081eee4a13f3c606ae759f47b14356ed3a75c03a4e70ea3a5

See more details on using hashes here.

File details

Details for the file py_rust_odbc_csv-1.0.1-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for py_rust_odbc_csv-1.0.1-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 22a0fee3cdba933a47a1616f3e902a6b91fbc98e18c0bdf88164dbecd48cce1e
MD5 3fc35b491b8563a0d4274c9f295c2cd8
BLAKE2b-256 f55782f93da38c71842f666da5be79e72a6b3cad69983f37420d50e10152b90b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page