IndexedCP Python library - #26
Conversation
161c0c3 to
c86b7f5
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a Python port of the IndexedCP project, setting up the basic structure and tooling for a Python implementation alongside the existing Node.js version.
- Adds Python package structure with
src/indexedcp/andtests/directories - Configures Python development tooling (pytest, black, ruff, mypy) with appropriate settings
- Creates basic smoke tests to validate pytest configuration and package import
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
python/src/indexedcp/__init__.py |
Defines package metadata and version |
python/tests/__init__.py |
Initializes test package |
python/tests/test_basic.py |
Basic smoke tests for pytest configuration and package import |
python/requirements.txt |
Runtime dependencies (cryptography, aiohttp) |
python/requirements-dev.txt |
Development dependencies for testing and code quality |
python/pyproject.toml |
Project configuration and build metadata |
python/README.md |
Documentation for Python implementation |
.gitignore |
Adds Python-specific ignore patterns |
horner
left a comment
There was a problem hiding this comment.
This commit is really not worthy of anything yet. Call it WIP still. It is the structure and the foundation on which to build. It’s always good to do a first commit like this and build on it. I’ll merge when we meet the goals.
5f02d28 to
c0cc3b1
Compare
- Initialize Python implementation of IndexedCP with minimal project setup. - Add colored logger module with comprehensive tests
Implement zero-dependency storage layer for Python IndexedCP following JavaScript keystore pattern. Uses Python's built-in sqlite3 module for persistence without external database dependencies.
…n layer Implemented IndexedCPClient with file chunking, SQLite storage backend, and HTTP upload queue. Created storage abstraction (BaseStorage, SQLiteStorage) with async context manager support. Added comprehensive test suite (44 tests) covering client operations, storage layer, and logging utilities. Includes examples and documentation following JS implementation patterns.
…tracking - Implement upload_buffered_files() with chunked uploads - Add exponential backoff retry logic (configurable) - Add progress callbacks (on_upload_progress, on_upload_error, on_upload_complete) - Add background upload process (non-blocking) - Add session tracking and automatic cleanup
c0cc3b1 to
d89e366
Compare
- Add IndexedCPServer class with FastAPI backend for file uploads - Implement three path handling modes: ignore (default), sanitize, allow-paths - Add chunked upload reassembly with session tracking - Include API key authentication middleware - Add integration tests and interactive demos
d89e366 to
a549b5b
Compare
There was a problem hiding this comment.
There is A lot in here that is too noisy. I would just do the TLDR and the details on how to use it. Not how it works.
I also think it should work like the node layer works. The files paths for be the same.
There was a problem hiding this comment.
Reduced ReadMe content to 153 lines
Both client implementations use same path:
Client DB: ~/.indexcp/db/client.db (user's home directory)
Node Python
Correcting the Server path(CWD)
Server Node: this.outputDir = options.outputDir || process.cwd();
Server Python: upload_dir: str = "./uploads",
Fix: self.upload_dir = Path(upload_dir) if upload_dir else Path.cwd() LINK
There was a problem hiding this comment.
As a demonstration. This thing is way too complex. We want to show three or four lines of Python code for a client to work.
There was a problem hiding this comment.
Previously I have included Multiple ways we can upload the file through client_demo.py
Short : https://www.youtube.com/shorts/RSIwcoRnTu0
I have updated the client_demo.py to 50 lines which includes the core 4 lines.
await client.initialize()
await client.add_file(demo_file)
results = await client.upload_buffered_files()
await client.close()
There was a problem hiding this comment.
Actually tho:
NOTE This is a beta package and encryption is not supported in the client or in the server.
- Server code should removed
- encryption on the client should be supported.
|
|
||
| class IndexedCPClient: | ||
|
|
||
| def __init__( |
There was a problem hiding this comment.
I don't see any client side encryption
There was a problem hiding this comment.
I have not included the Encryption in this PR (to keep it less code). I am working on it. adithya1012#22
- Server upload_dir now defaults to cwd() (matches Node.js) - Simplify README: focus on usage, remove implementation details - Simplify client_demo.py: 50 lines vs 380, shows 4-line usage
|
edited the first comment to add the video https://www.youtube.com/shorts/RSIwcoRnTu0 |
There was a problem hiding this comment.
Actually tho:
NOTE This is a beta package and encryption is not supported in the client or in the server.
- Server code should removed
- encryption on the client should be supported.
- Implement RSA-4096 and AES-256-GCM encryption (crypto_utils.py) - Add pluggable keystore abstraction with filesystem implementation - Include 44 comprehensive tests (21 crypto + 23 keystore) - Set secure file permissions (0600/0700) with thread-safe locking
feat(python): Add crypto utilities and keystore system
- Updated examples to support Node server - Updated integration testing - Readme updated
- Introduced EncryptedStorage class for encrypted storage. - Updated create_storage function to support encrypted storage. - Modified FileSystemKeyStore and SQLiteStorage initialization logs for consistency. - Updated tests to support encryption features in IndexedCPClient.
3665798 to
707543b
Compare
Python Implementation of IndexedCP
Short file upload with Encryption: https://youtube.com/shorts/00Lj3eQnLVs
Old One wo Encryption Short file upload: https://www.youtube.com/shorts/RSIwcoRnTu0
Summary
Complete Python port of IndexedCP with end-to-end encryption support. Implements RSA-4096 + AES-256-GCM encryption compatible with Node.js server and encrypted storage.
What's New
Encryption Support
Core Features
Key Features
Encryption Architecture
Client Features
Testing
Interactive Demos
Server Demo (
examples/server_demo.py):Client Demo (
examples/client_demo.py):Issues
adithya1012#12 -> 3 Sub issues
adithya1012#16 -> 4 Sub issues
adithya1012#21 -> 4 Sub issues