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 | Provenance | Actions |
|---|---|---|---|---|
| sql_upsert-0.1.2.tar.gz | 2.5 kB | Without provenance | Details for sql_upsert-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sql_upsert-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for sql_upsert-0.1.2-py3-none-any.whl |
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
|
Security for sql-upsert 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.