Skip to main content

IntoSQL for Python

Convert spreadsheets (XLSX, XLS, ODS), CSV and JSON into SQL for PostgreSQL, MySQL, MariaDB, SQLite, SQL Server or Oracle with the IntoSQL API. Column types are inferred and dirty values fixed, so the script loads on the first try.

pip install intosql

Python 3.9 or newer. The API is part of IntoSQL Pro; make a key in Settings, API keys.

Convert a file

import os
from intosql import IntoSQL, spec

intosql = IntoSQL(os.environ["INTOSQL_API_KEY"])

conversion = intosql.convert(
    "ventas.xlsx",
    name="ventas.xlsx",
    spec=spec("postgresql", table="ventas"),
)

print(conversion["report"]["rows"]["converted"], conversion["output"]["url"])

The file streams to storage as it is; the output URL downloads the script for ten minutes. Read the conversion again (intosql.conversions.retrieve(id)) for a fresh one.

Convert a file by URL

conversion = intosql.convert_url(
    "https://example.com/exports/ventas.csv",
    spec=spec("mysql"),
)

Check a webhook

Save a webhook address in Settings, API keys, and IntoSQL calls it when a conversion is done, failed or canceled.

from intosql import parse_webhook

# Raises WebhookSignatureError when the signature doesn't match.
event = parse_webhook(
    request.get_data(),
    request.headers.get("IntoSQL-Signature", ""),
    os.environ["INTOSQL_WEBHOOK_SECRET"],
)

Errors and retries

Failed requests raise IntoSQLError with the HTTP status, a code that doesn't change (needs_pro, over_quota, too_big, invalid_spec, invalid_url and more) and the request_id. A conversion that ends as failed raises ConversionFailedError with its code and the engine's problems. Rate limits, a full account, server errors and lost connections are retried twice with the same idempotency key (max_retries changes it); already_started never is.

Every endpoint: intosql.com/developers. This SDK: intosql.com/docs/sdks/python.

Metadata

Release files for intosql 0.1.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 intosql 0.1.1
File Size Uploaded
intosql-0.1.1.tar.gz 16.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for intosql 0.1.1
File Interpreter ABI Platform
intosql-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.8 kB

Release files / intosql-0.1.1.tar.gz

Download URL intosql-0.1.1.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bfb39f7b8e7b29de0f4e7e61e6e1de8dac5e0e5e5d747f9fccc5a93b2af41ce0
BLAKE2b-256 checksum
How to use checksums
a076fdee9d30d7fc2718ff2f4daccb7667d17eaff56b90940be9f2f9ba7615d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / intosql-0.1.1-py3-none-any.whl

Download URL intosql-0.1.1-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
133855ddb7c9a1e1dcec08981c69f8d3b2ac1db934e26ac04c446e3ceaa35a56
BLAKE2b-256 checksum
How to use checksums
0ed5ff19c672d69b48fb24cda335484eece80d445b17af65dac4ff15895a2fa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.1 This release

2 release files

0.1.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