A lightweight Python client SDK for the CSValchemy API
Project description
CSVAlchemy
A Python SDK for processing and analyzing spreadsheets using LLMs.
Installation
pip install CSVAlchemy-sdk
Overview
CSVAlchemy provides integration with OpenAI's LLM services alongside Excel processing capabilities. The library helps you efficiently process, analyze, and extract insights from spreadsheet data.
Features
- Spreadsheet Processing - Handle Excel and CSV files with advanced features
- LLM Integration - Seamless integration with OpenAI's language models
- Data Extraction - Extract structured data from complex spreadsheets
- Formula Extraction - Extract all the formula's from you spreadsheets
- Pivot Table Support - Process and analyze pivot tables
- Chart Analysis - Extract and encode chart data
- Conditional Formatting - Capture conditional formatting rules
- API Client - Easy-to-use client for the CSVAlchemy API
CSVAlchemy Feature Comparison
| Feature | Support |
|---|---|
| Excel (.xlsx) Processing | ✓ |
| CSV Processing | ✓ |
| OpenAI LLM Integration | ✓ |
| Formula Extraction | ✓ |
| Pivot Table Support | ✓ |
| Chart Analysis | ✓ |
| Conditional Formatting | ✓ |
| Data Validation Detection | ✓ |
| Merged Cell Detection | ✓ |
| Header Detection | ✓ (configurable) |
| Structural Anchor Extraction | ✓ |
| External Data Connections | ✓ (configurable) |
| VBA Macro Processing | ✓ (configurable) |
| RESTful API Access | ✓ (FastAPI endpoints) |
| Python SDK | ✓ |
| Customizable Configuration | ✓ |
| Error Handling Modes | ✓ (skip, warn, raise, fallback) |
| Parallel Processing | ✓ |
| Memory Optimization | ✓ (chunking for large spreadsheets) |
| Docker Deployment | ✓ |
| Cloud Deployment | ✓ |
| Authentication | ✓ (via environment variables) |
| Comprehensive Logging | ✓ |
| Open Source | ✓ (MIT License) |
Usage
from CSVAlchemy_sdk.core import encode_workbook
from CSVAlchemy_sdk.utils import load_workbook_from_file
from CSVAlchemy_sdk.config import get_config
# Process spreadsheets
workbook = load_workbook_from_file("Company_Financial_Data_For_PE.xlsx")
config = get_config()
encoded_data = encode_workbook(workbook, config)
# Now use the encoded data in your application
print("encoded_sheets ",encoded_data)
print(f"Processed {len(encoded_data['sheets'])} sheets")
API Documentation
Full API documentation is available at:
- Interactive API docs:
/docs - ReDoc API docs:
/redoc
Contributing to CSVAlchemy
We welcome contributions from the community! This guide will help you set up your local development environment and understand our contribution process.
Local Development Setup
-
Fork and Clone the Repository
git clone https://github.com/Unsiloed-ai/spreadsheet-llm.git cd spreadsheet-llm
-
Set Up a Virtual Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Development Dependencies
pip install -e ".[dev]"
-
Set Up Environment Variables
Create a
.envfile in the project root:OPENAI_API_KEY=your_api_key_here -
Run Tests to Verify Setup
pytest
Development Workflow
-
Create a Feature Branch
git checkout -b feature/your-feature-name
-
Make Your Changes
- Write code following our style guidelines
- Add tests for new functionality
- Update documentation as needed
-
Run Tests and Linting
# Run tests pytest # Run linting flake8 # Run formatter black .
-
Commit Your Changes
git add . git commit -m "Add a descriptive commit message"
-
Push to Your Fork
git push origin feature/your-feature-name
-
Create a Pull Request
Go to the original repository and create a pull request from your fork.
Code Style Guidelines
- Follow PEP 8 standards
- Use Black for code formatting
- Write docstrings for all functions, classes, and methods
- Include type hints according to PEP 484
Pull Request Process
- Ensure all tests pass and code is properly formatted
- Update documentation if necessary
- Link any related issues in your PR description
- Wait for review from maintainers
- Address any requested changes
- Once approved, your PR will be merged
Running the API Locally
To run the API server locally during development:
python run.py
The API will be available at http://localhost:8000 with interactive documentation at http://localhost:8000/docs.
Building the Package Locally
To build the package locally:
python -m build
Contact
If you have questions or need help, please:
- Open an issue on GitHub
- Contact the maintainers at hello@unsiloed-ai.com
Thank you for contributing to CSVAlchemy!
License
This project is licensed under the MIT License - see the LICENSE file for details.
About
Developed by Unsiloed AI
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 csvalchemy_sdk-0.1.1.tar.gz.
File metadata
- Download URL: csvalchemy_sdk-0.1.1.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0fa4491a03f3f8042ea166e0660a7286f65a70af2b9fbab1c9ce3a6b4c38a23
|
|
| MD5 |
92ed72943e9cd36750c8750510001135
|
|
| BLAKE2b-256 |
b85578f3c143ae9c5fcd4e72c9b6e64701d1ea22c62dff6b3a0217342176e5cf
|
File details
Details for the file csvalchemy_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: csvalchemy_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed7e13ffaeacf1094b8f06c4a9c971930c0a1b1a56fd11ed8ba3ab8490699bce
|
|
| MD5 |
82bb8d4bc820d0efc76bf2f813d71a72
|
|
| BLAKE2b-256 |
92d14f18de9a6cb2301122c9f5ab6add00f5de25614a9a4a52e92f04dfac7fed
|