SQL Upsert
A Python package for handling SQL upsert operations with pandas DataFrames.
Installation
pip install sql_upsert
Usage
import sql_upsert as pdu
import pandas as pd
from sqlalchemy import create_engine
# Create engine
engine = create_engine('sqlite:///example.db')
# Create sample DataFrame
df = pd.DataFrame({'id': [1, 2], 'value': ['a', 'b']})
# Write with upsert functionality
pdu.to_sql_upsert(df, 'my_table', engine, unique_columns=['id'])
Features
- Automatic handling of upsert operations
- Support for custom unique constraints
- Compatible with any SQLAlchemy supported database
- Preserves column types when creating tables
Requirements
- Python >= 3.6
- SQLAlchemy >= 1.4.0
- pandas >= 1.0.0
Metadata
Release files for sql-upsert 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sql_upsert-0.1.2.tar.gz | 2.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sql_upsert-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.3 kB
Release files / sql_upsert-0.1.2.tar.gz
| Download URL | sql_upsert-0.1.2.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d71544522c17aee84aca0e1db93f390ecee11c976339c3fe7608ea5af47e024
|
|
BLAKE2b-256 checksum How to use checksums |
470e182afa83c54d1292d503129f24c05c87d4c08c92755dc01140945eac008d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.1
|
Release files / sql_upsert-0.1.2-py3-none-any.whl
| Download URL | sql_upsert-0.1.2-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5c585faa6931312df440b1317c2ba40ca48516dbca5da0d983740b94a6d23903
|
|
BLAKE2b-256 checksum How to use checksums |
fa9e0c935491a66c478729af0a966c1b42de1b4dccd525ba52bf19d3cf4772a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.1
|