Important
π« Ethical Restrictions
My works cannot be used in:
- Military applications or systems
- Surveillance technologies
- Any activity violating human rights
Category | Details |
---|---|
Core Operations | π₯ CSV-to-DB Import β’ π€ DB-to-CSV Export β’ π Bidirectional Sync |
Database Support | β PostgreSQL β’ β MySQL β’ β SQLite β’ π MongoDB β’ βοΈ AWS Aurora β’ π’ Oracle β’ π₯οΈ IBM DB2 |
SDK Advantages | π§© Modular Design β’ π Client Libraries β’ π CLI Tools β’ π§ͺ Mock Testing Framework |
# Clone repository
git clone https://github.com/SSobol77/csv-db-sdk.git
cd csv-db-sdk
# Basic Installation (Core Functionality)
pip install csv-db-sdk
# Development Setup (Testing + Coverage)
pip install "csv-db-sdk[testing]"
# Full Installation (All Features)
pip install "csv-db-sdk[full]"
Strict SemVer compliance for all dependencies: psycopg2-binary ~= 2.9.9 # Compatible with 2.9.x (2.9.9 β€ version < 3.0) boto3 ~= 1.34.112 # Compatible with 1.34.x (1.34.112 β€ version < 2.0)
- Major versions (X.0.0): Breaking API changes
- Minor versions (1.X.0): Backwards-compatible features
- Patch versions (1.0.X): Backwards-compatible bug fixes
Component | Supported Versions | Stability Level |
---|---|---|
PostgreSQL | 12-16 | Production |
MySQL | 5.7-8.1 | Production |
Oracle DB | 19c-23c | Verified |
MongoDB | 4.4-7.0 | Production |
# Safe Upgrade Path
pip install --upgrade-strategy eager "csv-db-sdk>=1.2,<2.0"
# Version Pinning Example
echo "csv-db-sdk==1.2.3" >> production-requirements.txt
from csv_db_sdk import PostgresConnector
# Initialize connector
config = {
"host": "localhost",
"user": "admin",
"password": "secret",
"database": "mydb"
}
pg = PostgresConnector(config)
# Import CSV to table
pg.import_csv("data/users.csv", "users_table")
# Export table to CSV
pg.export_csv("analytics/results.csv", "sales_data")
csv-db-sdk/
βββ π core/ # SDK Core Components
β βββ connectors.py # Base DB connector logic
β βββ utilities.py # CSV parsing/validation
βββ π db_adapters/ # Database-specific implementations
β βββ postgres.py # PostgreSQL adapter
β βββ mongodb.py # MongoDB adapter
β βββ ... # Other databases
βββ π examples/ # Ready-to-run scenarios
β βββ basic_import.py # CSV β DB example
β βββ advanced_export.py # DB β CSV with filtering
βββ π tests/ # Comprehensive test suite
βββ unit/ # Isolated component tests
βββ integration/ # End-to-end workflow tests
# PostgreSQL Example
postgres:
host: "db-server.prod"
port: 5432
database: "analytics"
user: "${DB_USER}"
password: "${DB_PASS}"
sslmode: "require"
# MongoDB Example
mongodb:
uri: "mongodb+srv://cluster.prod.mongodb.net"
authSource: "admin"
tls: true
Multi-level Validation:
# Run all tests
pytest tests/ -v
# Test specific database
pytest tests/postgres -v --cov=db_adapters.postgres
# Generate coverage report
pytest --cov-report html --cov=.
Test Type | Coverage | Tools Used |
---|---|---|
Unit Testing | 92% Core logic | pytest, unittest |
Integration Tests | 85% DB-specific workflows | Docker, Testcontainers |
Performance Bench | 10k rows/sec (PostgreSQL) | Locust, pyperf |
- Fork the repository
- Create feature branch:
git checkout -b feat/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feat/amazing-feature
- Open Pull Request
GNU GPLv3 - See LICENSE for full text.
π Commercial use requires special permission - contact author for details.