Skip to main content

sqlcsv-exporter

sqlcsv-exporter is a publishable CLI package for streaming SQL Server query results into CSV files without loading the full result set into memory.

Features

  • Reads SQL from a .sql file
  • Rewrites a declared @InAsOfDate value when present
  • Supports trusted or SQL authentication
  • Streams rows with chunked fetchmany() and chunked CSV writes
  • Shows live Rich progress while the export runs
  • Ships with pytest coverage for core behavior

Install

poetry install

Run

poetry run sqlcsv-exporter \
  --sql ./queries/report.sql \
  --output ./exports/report.csv \
  --server my-sql-server \
  --database Reporting

With SQL authentication:

poetry run sqlcsv-exporter \
  --sql ./queries/report.sql \
  --output ./exports/report.csv \
  --server my-sql-server \
  --database Reporting \
  --sql-auth \
  --username reporting_user \
  --password secret

Override the as-of date used in a declared @InAsOfDate variable:

poetry run sqlcsv-exporter \
  --sql ./queries/report.sql \
  --output ./exports/report.csv \
  --server my-sql-server \
  --database Reporting \
  --date 2026-03-26

Publish

poetry build
poetry publish

Metadata

Release files for sqlcsv-exporter 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlcsv-exporter 1.0.1
File Size Uploaded
sqlcsv_exporter-1.0.1.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlcsv-exporter 1.0.1
File Interpreter ABI Platform
sqlcsv_exporter-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.3 kB

Release files / sqlcsv_exporter-1.0.1.tar.gz

Download URL sqlcsv_exporter-1.0.1.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3e1fabdcec939d47f22c5c990beb6e6965cf56a35493e657799227d93a5ffada
BLAKE2b-256 checksum
How to use checksums
148106e4d9b022c5f47e71185950720b7a4924dd85690f4eeb5a411a93890ed5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.7 Windows/11

Release files / sqlcsv_exporter-1.0.1-py3-none-any.whl

Download URL sqlcsv_exporter-1.0.1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
047ce3ba353fd865f3aa82f312c92263e2974c468e2a621587b9a258d2bfa857
BLAKE2b-256 checksum
How to use checksums
d921f7d19a486f09e19b5e8cdb294a722ab8b7258ca655a307cab9fe21ee53c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.7 Windows/11

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page