semvec/pypi-packages huggingface dataset:
kb-dashboard-tools 0.2.7
Shared utilities for Kibana operations, authentication, and workflows
License: MIT
Requires Python: >=3.12

# kb-dashboard-tools

Shared utilities for Kibana operations, authentication, and workflows. This package provides common functionality used across the kb-yaml-to-lens ecosystem, including CLI tools, Language Server Protocol (LSP) servers, and future MCP servers.

## Features

- **KibanaClient**: HTTP client for interacting with Kibana's Saved Objects API and Elasticsearch APIs
- **Authentication utilities**: Credential normalization and URL redaction for safe logging
- **Result pattern**: Type-safe error handling without exceptions
- **ES|QL support**: Models for ES|QL query execution and results

## Installation

```bash
pip install kb-dashboard-tools
```

## Usage

### Kibana Client

```python
from kb_dashboard_tools import KibanaClient

# Note: ssl_verify=False is only for local development with self-signed certificates.
# Always use ssl_verify=True (the default) in production environments.
async with KibanaClient(
    url='https://localhost:5601',
    username='elastic',
    password='changeme',
    ssl_verify=False,  # Only for local dev with self-signed certs
) as client:
    # Upload a dashboard
    result = await client.upload_ndjson('dashboard.ndjson')

    # Execute ES|QL query
    esql_result = await client.execute_esql('FROM logs | LIMIT 10')
    print(f'Found {esql_result.row_count} rows')
```

### Authentication Utilities

```python
from kb_dashboard_tools import normalize_credentials, redact_url

# Normalize credentials (converts empty strings to None)
api_key = normalize_credentials(user_input)

# Redact credentials from URLs for safe logging
safe_url = redact_url('https://user:pass@example.com:9200/path')
# Returns: 'https://example.com:9200/path'
```

### Result Pattern

```python
from kb_dashboard_tools import Result

def divide(a: int, b: int) -> Result[float]:
    if b == 0:
        return Result.fail('Division by zero')
    return Result.ok(a / b)

result = divide(10, 2)
if result.success:
    print(f'Result: {result.unwrap()}')
else:
    print(f'Error: {result.error}')
```

## Development

See the main repository's [DEVELOPING.md](../../DEVELOPING.md) for development setup.

```bash
# Install dependencies
make install

# Run CI checks
make ci

# Run tests
make test
```

## License

MIT
kb-dashboard-core 0.2.7
Core compilation engine for YAML to Kibana dashboard format
License: MIT
Requires Python: >=3.12

# kb-dashboard-core

Core compilation engine for YAML to Kibana dashboard format.

## Overview

`kb-dashboard-core` is a pure Python library that provides the core compilation functionality for converting YAML dashboard definitions to Kibana's JSON format. This package contains no external service dependencies (no Elasticsearch, Kibana HTTP client, CLI framework, or LSP dependencies).

## Features

- Load dashboard configurations from YAML files
- Compile YAML dashboard definitions to Kibana JSON format
- Support for various panel types (Lens charts, markdown, etc.)
- Control and filter compilation
- Query building and validation

## Installation

```bash
pip install kb-dashboard-core
```

## Usage

```python
from kb_dashboard_core import load, render, dump

# Load dashboards from YAML
dashboards = load('path/to/dashboard.yaml')

# Render to Kibana format
for dashboard in dashboards:
    kibana_json = render(dashboard)
    print(kibana_json.model_dump_json(indent=2))

# Save dashboards back to YAML
dump(dashboards, 'path/to/output.yaml')
```

## Development

See [DEVELOPING.md](../../DEVELOPING.md) for development setup and workflows.

## License

MIT