Skip to main content

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

pica_dbapi-0.1.3.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pica_dbapi-0.1.3-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

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

Hashes for pica_dbapi-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a5f62084117b39c56eb7b511668159b00c175c7d5bfb66b01e380b8655820743
MD5 c5d37a1d2301acaf6a7b773e733ef8f2
BLAKE2b-256 7494104b7a0306ff54510f55cfe65719f28385c40cd56268fc21a27f2397940b

See more details on using hashes here.

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

Hashes for pica_dbapi-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9bc95de4d4567005727a1fa463fa2a15945379c397368a7a03e0e9f674395f80
MD5 956041d44231061d16e88e0fa1614d94
BLAKE2b-256 c97b80a2ec5640d4c2b1597aaa73c30261e8d9ca8a5839e82035ecae86c3877b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page