This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
sirix-python-client is a Python SDK for SirixDB, a temporal versioned NoSQL database. It supports both synchronous and asynchronous operations and includes a CLI shell interface.
# Install all dependencies (runtime + dev + docs)
pip install -r requirements-all.txt
# Install in development mode
pip install -e .
# Run tests (requires Docker services running)
python -m pytest --cov=pysirix --cov-config=.coveragerc -v -s
# Run a single test file
python -m pytest tests/test_sirix_sync.py -v -s
# Run a single test
python -m pytest tests/test_sirix_sync.py::test_function_name -v -s
# Start test infrastructure (Keycloak + SirixDB)
bash test.sh
# Build documentation
cd docs && make htmlTests require Docker Compose services (Keycloak for auth, SirixDB server):
tests/resources/docker-compose.yml- Service definitions- Keycloak runs on port 8080
- SirixDB runs on port 9443
- Run
bash test.shto start services before running tests
The library provides identical interfaces for sync and async code:
sirix_sync(username, password, client: httpx.Client)→ synchronous operationssirix_async(username, password, client: httpx.AsyncClient)→ async/await operations- Both use the same underlying
Sirixclass, which detects the client type and instantiatesSyncClientorAsyncClient
- Sirix (
sirix.py) - Server-level orchestrator: access databases, execute global queries - Database (
database.py) - Database-level: create/delete databases, access resources - Resource (
resource.py) - Resource-level: CRUD operations on JSON/XML documents
- High-level:
JsonStoreSync/JsonStoreAsync(json_store.py) - MongoDB-like interface withinsert(),find(),update(),delete() - Low-level:
SyncClient/AsyncClient(sync_client.py,async_client.py) - Direct HTTP endpoint wrappers
pysirix/__init__.py- Entry points and public API exportspysirix/auth.py- Keycloak OAuth2 authentication with automatic token refreshpysirix/errors.py-SirixServerErrorexception andinclude_response_text_in_errors()context managerpysirix/types.py- TypedDict definitions for API responsespysirix/constants.py- Enums:DBType,Insert,TimeAxisShift
- Entry point:
pysirixcommand (configured in setup.py) - Implementation:
pysirix/shell/sirixsh.py - Config file:
~/.pysirix-shell/config.json
- Python 3.9+ required
- Uses httpx (0.21-0.24) for HTTP client
- Conventional commits:
feat:,fix:, etc. - Test files mirror source structure:
test_sirix_sync.py,test_sirix_async.py, etc.