Skip to main content

Data loader for Helix platform

Project description

Helix Data Loader

A command-line utility for loading data into Helix platform from CSV and JSONL files.

Features

  • Process CSV and JSONL files with dynamic schema detection
  • Automatic table schema and tenant ID detection
  • Proper handling of UTF-8 files with BOM (Byte Order Mark)
  • Batch processing for improved performance
  • Multithreaded operation for high throughput
  • Real-time progress tracking and reporting
  • Comprehensive transaction metrics and HTTP status code reporting
  • Debug mode for detailed request/response logging
  • Support for both create/update and delete operations

Installation

pip install helix-data-loader

Usage

# Load data from CSV file with auto-detection of tenant ID and schema
helix-data-loader --file data.csv --table-name my_table --api-key your-api-key

# Load data using API key from environment variable
export HELIX_API_KEY=your-api-key
helix-data-loader --file data.csv --table-name my_table

# All tenant IDs are now detected automatically from the schema
helix-data-loader --file data.csv --table-name my_table --api-key your-api-key

# Load data with batch processing and multiple threads
helix-data-loader --file data.jsonl --table-name my_table --threads 8

# Start from a specific line
helix-data-loader --file data.csv --table-name my_table --start-line 100

# Delete mode (uses first column as the primary key)
helix-data-loader --file data.csv --table-name my_table --delete

# With debug output
helix-data-loader --file data.csv --table-name my_table --debug

# Use a custom configuration file
helix-data-loader --file data.csv --table-name my_table --config custom_config.json

# Show version information
helix-data-loader --version

Configuration

The API key can be provided in three different ways (in order of precedence):

  1. Command line argument: --api-key your-api-key
  2. Environment variable: HELIX_API_KEY=your-api-key
  3. Configuration file

Create a configuration file named config.json in your working directory:

{
  "api": {
    "api_key": "your-api-key"
  },
  "defaults": {
    "table_name": "default_table",
    "start_line": 1,
    "threads": 4,
    "debug": false
  },
  "performance": {
    "batch_size": 499
  }
}

Automatic Table Schema and Tenant ID Detection

The utility automatically fetches table schema information from the Helix API, which provides:

  • Automatic detection of the tenant ID (no need to configure or specify it)
  • Correct namespace and version information for API URLs
  • Future compatibility as the API evolves

This schema information is required for the tool to function. If the schema cannot be retrieved, the tool will exit with an error message.

Context ID Auto-generation

The utility automatically generates a random UUID for the context ID for each run, eliminating the need to specify this parameter manually.

Development

Running Tests

The package includes a comprehensive test suite:

# Install development dependencies
pip install pytest pytest-cov

# Run tests with the test runner
./run_tests.py

# Or use pytest directly
pytest tests/

# Run tests with coverage report
pytest tests/ --cov=helix_data_loader

Building the Package

# Install build tools
pip install build twine

# Build distribution packages
python -m build

# Test installation from local build
pip install dist/helix_data_loader-*.whl

License

MIT

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

helix_data_loader-0.4.1.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

helix_data_loader-0.4.1-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file helix_data_loader-0.4.1.tar.gz.

File metadata

  • Download URL: helix_data_loader-0.4.1.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for helix_data_loader-0.4.1.tar.gz
Algorithm Hash digest
SHA256 b5f1ea0c123e19cca0225ff506535c5ebcbe291cf2395243ecb7e4d78c9890a0
MD5 3d366f481b5af14434f31692e1b3cbac
BLAKE2b-256 38a404c085bfbcac3c9e08aadf6ff101c1c213bb1dbbf34ae366390d9dd6c33f

See more details on using hashes here.

File details

Details for the file helix_data_loader-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for helix_data_loader-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91d4ba39e14e0176b1bede1287c0890de1ea9a6ab789244c9692e265187f7792
MD5 c890be59e8d5ca1c5078156fd75b5fe6
BLAKE2b-256 06c6b6c9769d4271e81ccc6df06a5620ef284858555dc18928f5317539ac6eba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page