A lightweight and fun DBAPI built on pandas/csv ๐. Supported SQL: SELECT, INSERT, UPDATE, DELETE, JOIN, GROUP BY.
Project description
Pica DBAPI ๐
Welcome to Pica DBAPI - a lightweight and fun Pandas Integrated CSV API!
Pica stands for Pandas Integrated CSV API.
Features ๐
- Lightweight DBAPI built on Pandas and CSV ๐
- Simple and intuitive API ๐คฉ
- Supports common SQL operations: SELECT, INSERT, UPDATE, DELETE, JOIN, GROUP BY ๐ ๏ธ
- Automatic lazy-loading of CSV files ๐
- CREATE TABLE and DROP TABLE operations ๐๏ธ
- Comprehensive test coverage with pytest โ
Installation ๐ง
pip install pica-dbapi
Supported SQL Operations ๐
Pica supports the following SQL operations:
- SELECT: Retrieve data from CSV files. ๐
- INSERT: Insert new records into CSV files. โ
- UPDATE: Update existing records in CSV files. ๐
- DELETE: Delete records from CSV files. โ
- JOIN: Join rows from multiple CSV files. ๐
- GROUP BY: Aggregate records using GROUP BY clauses. ๐
- CREATE TABLE: Create a new CSV file with specified columns. ๐
- DROP TABLE: Delete the CSV file and remove the corresponding table object. ๐๏ธ
Quick Start ๐
Below is a quick start guide demonstrating key features (as shown in example_basic.py):
# Clone the repository ๐ฅ
git clone https://github.com/kitfactory/pica.git
cd pica
# Create a virtual environment and install dependencies ๐ ๏ธ
python -m venv .venv
# On Windows:
.venv\Scripts\activate
# On Unix/Linux:
# source .venv/bin/activate
# Install Pica in editable mode ๐ง
pip install -e .
# Run the example โถ๏ธ
python example/example_basic.py
This example demonstrates various features including:
- Basic SELECT with WHERE clause ๐
- GROUP BY with aggregation ๐
- JOIN operations between CSV-backed tables ๐
- Direct usage with Pandas DataFrame ๐ผ
- Automatic lazy-loading of CSV files when initial DataFrames are not provided ๐
- CREATE TABLE and DROP TABLE functionalities ๐๏ธ ๐๏ธ
Contributing ๐ค
Contributions and suggestions are welcome! Please open an issue or submit a pull request. ๐ฌโจ
License ๐
This project is licensed under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pica_dbapi-0.1.3.tar.gz.
File metadata
- Download URL: pica_dbapi-0.1.3.tar.gz
- Upload date:
- Size: 30.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5f62084117b39c56eb7b511668159b00c175c7d5bfb66b01e380b8655820743
|
|
| MD5 |
c5d37a1d2301acaf6a7b773e733ef8f2
|
|
| BLAKE2b-256 |
7494104b7a0306ff54510f55cfe65719f28385c40cd56268fc21a27f2397940b
|
File details
Details for the file pica_dbapi-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pica_dbapi-0.1.3-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bc95de4d4567005727a1fa463fa2a15945379c397368a7a03e0e9f674395f80
|
|
| MD5 |
956041d44231061d16e88e0fa1614d94
|
|
| BLAKE2b-256 |
c97b80a2ec5640d4c2b1597aaa73c30261e8d9ca8a5839e82035ecae86c3877b
|