A high-performance, asynchronous, and extensible Python package for processing files, generating embeddings, and storing them in various vector databases with optional cloud storage integration.
Project description
๐ EmbeddingFramework
Modular โข Extensible โข Production-Ready
A Python framework for embeddings, vector databases, and cloud storage providers.
๐ Documentation
A modular, extensible, and production-ready Python framework for working with embeddings, vector databases, and cloud storage providers.
Designed for AI, NLP, and semantic search applications, EmbeddingFramework provides a unified API to process, store, and query embeddings across multiple backends.
โจ Features
๐น Multi-Vector Database Support
- ChromaDB โ Local and persistent vector storage.
- Milvus โ High-performance distributed vector database.
- Pinecone โ Fully managed vector database service.
- Weaviate โ Open-source vector search engine.
๐น Cloud Storage Integrations
- AWS S3 โ Store and retrieve embeddings or documents.
- Google Cloud Storage (GCS) โ Scalable object storage.
- Azure Blob Storage โ Enterprise-grade cloud storage.
๐น Embedding Providers
- OpenAI Embeddings โ State-of-the-art embedding generation.
- Easily extendable to other providers.
๐น File Processing & Preprocessing
- Automatic file type detection.
- Text extraction from multiple formats including
.txt,.pdf,.docx,.csv,.xls,.xlsx. - Preprocessing utilities for cleaning and normalizing text.
- Intelligent text splitting for optimal embedding performance.
- Large dataset handling for Excel files with efficient chunking to preserve embedding context.
๐น Utilities
- Retry logic for robust API calls.
- File utilities for safe and efficient I/O.
- Modular architecture for easy extension.
๐ฆ Installation & Setup
# Basic installation
pip install embeddingframework
# With development dependencies
pip install embeddingframework[dev]
โก Quick Start Example
from embeddingframework.adapters.openai_embedding_adapter import OpenAIEmbeddingAdapter
from embeddingframework.adapters.vector_dbs import ChromaDBAdapter
# Initialize embedding provider
embedding_provider = OpenAIEmbeddingAdapter(api_key="YOUR_OPENAI_API_KEY")
# Initialize vector database
vector_db = ChromaDBAdapter(persist_directory="./chroma_store")
# Generate embeddings
embeddings = embedding_provider.embed_texts(["Hello world", "EmbeddingFramework is awesome!"])
# Store embeddings
vector_db.add_texts(["Hello world", "EmbeddingFramework is awesome!"], embeddings)
๐ Project Structure
embeddingframework/
โ
โโโ adapters/ # Vector DB & storage adapters
โ โโโ base.py
โ โโโ chromadb_adapter.py
โ โโโ milvus_adapter.py
โ โโโ pinecone_adapter.py
โ โโโ weaviate_adapter.py
โ โโโ storage/ # Cloud storage adapters
โ
โโโ processors/ # File processing logic
โโโ utils/ # Helper utilities
โโโ tests/ # Test suite
๐งช Testing
pytest --maxfail=1 --disable-warnings -q
With coverage:
pytest --cov=embeddingframework --cov-report=term-missing
๐ CI/CD
This project includes a GitHub Actions workflow (.github/workflows/python-package.yml) for:
- Automated testing with coverage.
- Version bumping & changelog generation.
- PyPI publishing.
- GitHub release creation.
๐ License
This project is licensed under the MIT License โ see the LICENSE file for details.
๐ค Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
- Fork the repository.
- Create a new branch (
feature/my-feature). - Commit your changes.
- Push to your branch.
- Open a Pull Request.
๐ Why EmbeddingFramework?
- Unified API โ Work with multiple vector DBs and storage providers seamlessly.
- Extensible โ Add new adapters with minimal effort.
- Production-Ready โ Built with scalability and reliability in mind.
- Developer-Friendly โ Clean, modular, and well-documented codebase.
๐ Full Documentation Overview
Below is a comprehensive, end-to-end guide covering all features, usage patterns, and advanced configurations of EmbeddingFramework.
1๏ธโฃ Introduction
EmbeddingFramework is designed to simplify the integration of embeddings, vector databases, and cloud storage into AI-powered applications. It provides:
- A unified API for multiple backends.
- Extensible architecture for adding new providers.
- Production-ready reliability with retries, error handling, and modular design.
2๏ธโฃ Installation
pip install embeddingframework
pip install embeddingframework[dev] # For development
3๏ธโฃ Supported Vector Databases
| Database | Type | Key Features |
|---|---|---|
| ChromaDB | Local | Persistent storage, lightweight |
| Milvus | Distributed | High-performance, scalable |
| Pinecone | Managed | Fully hosted, easy to scale |
| Weaviate | Open-source | Semantic search, hybrid queries |
4๏ธโฃ Cloud Storage Integrations
EmbeddingFramework supports:
- AWS S3
- Google Cloud Storage
- Azure Blob Storage
Example:
from embeddingframework.adapters.storage.s3_storage_adapter import S3StorageAdapter
storage = S3StorageAdapter(bucket_name="my-bucket")
storage.upload_file("local.txt", "remote.txt")
5๏ธโฃ Embedding Providers
Currently supported:
- OpenAI Embeddings
- Easily extendable to HuggingFace, Cohere, etc.
Example:
from embeddingframework.adapters.openai_embedding_adapter import OpenAIEmbeddingAdapter
provider = OpenAIEmbeddingAdapter(api_key="YOUR_KEY")
embeddings = provider.embed_texts(["Hello", "World"])
6๏ธโฃ File Processing
EmbeddingFramework provides a robust and extensible file processing pipeline that can handle a wide variety of file formats and sizes. This includes:
- Automatic File Type Detection โ The framework automatically determines the file type and routes it to the appropriate parser.
- Text Extraction โ Supports extracting text from:
.txtโ Plain text files.pdfโ PDF documents.docxโ Microsoft Word documents.csvโ Comma-separated values.xls/.xlsxโ Microsoft Excel spreadsheets (including multi-sheet workbooks)
- Preprocessing Utilities โ Cleans and normalizes extracted text for better embedding quality (e.g., removing stopwords, normalizing whitespace).
- Intelligent Text Splitting โ Splits large documents into smaller, context-friendly chunks for optimal embedding performance.
- Large Dataset Handling for Excel โ Efficiently processes large Excel files by:
- Reading all sheets in the workbook.
- Converting each row into a string representation.
- Chunking rows into manageable segments to avoid exceeding embedding context limits.
- Applying quality filters to remove empty or low-value chunks.
This design ensures that even massive datasets can be processed without memory overload or loss of semantic context.
Example:
from embeddingframework.processors.file_processor import FileProcessor
processor = FileProcessor()
# Process a PDF
pdf_text = processor.process_file("document.pdf")
# Process a large Excel file with multiple sheets
excel_text = processor.process_file("large_dataset.xlsx")
# Process a CSV file
csv_text = processor.process_file("data.csv")
# Process a DOCX file
docx_text = processor.process_file("report.docx")
Advanced Usage:
# Asynchronous processing with custom chunk sizes and quality filters
import asyncio
async def process_files():
await processor.process_file_async(
"large_dataset.xlsx",
chunk_size=2000,
text_chunk_size=1000,
merge_target_size=3000,
parallel=True,
min_quality_length=50
)
asyncio.run(process_files())
7๏ธโฃ Utilities
- Retry logic
- File utilities
- Preprocessing helpers
8๏ธโฃ CLI Usage
EmbeddingFramework includes a CLI:
embeddingframework --help
9๏ธโฃ Advanced Configurations
- Custom vector DB adapters
- Custom embedding providers
- Batch processing
- Async support
๐ End-to-End Example
from embeddingframework.adapters.openai_embedding_adapter import OpenAIEmbeddingAdapter
from embeddingframework.adapters.vector_dbs import ChromaDBAdapter
provider = OpenAIEmbeddingAdapter(api_key="KEY")
db = ChromaDBAdapter(persist_directory="./store")
texts = ["AI is amazing", "EmbeddingFramework is powerful"]
embeddings = provider.embed_texts(texts)
db.add_texts(texts, embeddings)
๐ Feature Matrix
| Feature | Supported |
|---|---|
| Multi-DB Support | โ |
| Cloud Storage | โ |
| File Processing | โ |
| Retry Logic | โ |
| CLI | โ |
| Async | โ |
๐ Learn More
For the full documentation, visit:
๐ EmbeddingFramework Docs
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 embeddingframework-1.0.8.tar.gz.
File metadata
- Download URL: embeddingframework-1.0.8.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
645a399a23b47e4b18bfe856bac612954e56ddb7b9503b376cbe66ac0ca24bc7
|
|
| MD5 |
5282f6133e75e6701cba7199b75c7a35
|
|
| BLAKE2b-256 |
30f02d3903e22c3caba46c673e087eb7b7dd595a7f2080fc1737a9c83ed33589
|
File details
Details for the file embeddingframework-1.0.8-py3-none-any.whl.
File metadata
- Download URL: embeddingframework-1.0.8-py3-none-any.whl
- Upload date:
- Size: 28.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a601a5e9367d5e6c2099ce8fb2bcc810afa4a2c7837c425cd16b5c8bbdbb371
|
|
| MD5 |
b91eb994dcbf8787c444a93d6bcdcf85
|
|
| BLAKE2b-256 |
98dda12f347df3c44497dacc02258c64bd971e5ed7b413f86274e22eb2d72666
|