How nsu-ai/kappa works
Project type and purpose
• This is a Python client-side SDK (“kf_sdk”) that wraps HTTP calls to two microservices:
• SessionManagementApi (user‐micro‐service)
• DatasetManagementApi (data-micro-service)
• Its purpose is to simplify authentication (session management) and dataset retrieval for Kappa Framework v1.0.0.
File structure
• Top‐level: CI/CD configs (.github/, .travis.yml, .gitlab‐ci.yml, tox.ini), packaging (setup.py, pyproject.toml, requirements.txt), docs/ (OpenAPI‐generated Markdown for each endpoint and model), tests/
• kf_sdk package:
• configuration.py – global settings (host URLs, tokens)
• api_client.py / rest.py – HTTP client layer built on urllib3
• api/ – one class per endpoint group (dataset_management_api.py, session_management_api.py)
• models/ – Pydantic (v2) data classes for request and response bodies
• exceptions.py – custom exception types
a. Main components:
1) Client application (user code)
2) kf_sdk layers:
• Configuration (host, auth token)
• ApiClient & HTTP transport (rest.py)
• API modules (SessionManagementApi, DatasetManagementApi)
• Model layer (Pydantic classes)
• Exception/Error handling
3) External microservices:
• User-micro-service (Session endpoint)
• Data-micro-service (Dataset endpoint)
4) Optional: CI/CD pipelines (GitHub Actions, Travis, GitLab CI) and docs generator
b. Relationships and interactions:
• Client code imports kf_sdk → configures host & token → instantiates ApiClient
• ApiClient invokes API class methods → translate method call into HTTP request → send to microservice
• Microservice returns JSON → ApiClient deserializes into model objects → returns to client
• Errors in HTTP or validation propagate via custom exceptions
c. Architectural patterns & design principles:
• Layered architecture (transport layer, API interface layer, model layer, exception layer)
• Separation of concerns: configuration, client transport, API definitions, data models
• OpenAPI‐driven code generation (docs/ content mirrors generated SDK)
• Dependency injection of Configuration into ApiClient
d. Key technologies & libraries:
• Python 3.8+
• urllib3 for HTTP transport
• Pydantic v2 for models and validation
• setuptools / pip packaging
Detail without over-splitting
• Logical layers of the SDK but avoid showing every single file
• Groupings: configuration, transport, API, models, exceptions
• Both Session and Dataset flows side by side, highlighting shared ApiClient and config