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)

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-0.1.2-cp311-cp311-manylinux_2_28_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

py_rust_odbc_csv-0.1.2-cp310-none-win_amd64.whl (185.0 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

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