Skip to main content

Minimal Headless BI for perfectionists on deadlines

Project description

 ______     ______     ______     ______   ______     __  __    
/\  ___\   /\  __ \   /\  == \   /\__  _\ /\  ___\   /\_\_\_\   
\ \ \____  \ \ \/\ \  \ \  __<   \/_/\ \/ \ \  __\   \/_/\_\/_  
 \ \_____\  \ \_____\  \ \_\ \_\    \ \_\  \ \_____\   /\_\/\_\ 
  \/_____/   \/_____/   \/_/ /_/     \/_/   \/_____/   \/_/\/_/ 
                                                                
                                                                                                         

Cortex Hero

The simplest semantic layer for building data driven applications.

Cortex provides a unified semantic layer that lets you define what matters once and ship analytics faster. Abstract away data complexity, monitor results in realtime, and take proactive actions all through a simple REST API built for modern developers and AI.

  • 🎯 Semantic Layer: Define metrics, dimensions, and measures in JSON with support for output formatting, conditional logic, and parameter systems
  • ⚡ Query Engine: Turn your metrics into optimized queries with built-in caching (Redis, in-memory)
  • 🔌 Data Sources: PostgreSQL, MySQL, BigQuery, SQLite, and Spreadsheets (CSV/Google Sheets). Easy to add custom sources.
  • 📊 Dashboards: Build dashboards using 10+ chart types. Easily extended to support custom visualizations.
  • 📁 File Storage: Upload CSV files with automatic SQLite conversion, hash-based change detection, and cloud storage support (GCS)
  • 👥 Multi Tenant: Hierarchical organization (Workspaces → Environments → Consumers) with context-aware query execution
  • 🔐 API First: Comprehensive REST API with OpenAPI documentation

Quick Start

Installation

# Install with API support
pip install telescope-cortex[api]

# Start the server
python -m cortex

Access the API:

  • API Server: http://localhost:9002
  • Interactive Docs: http://localhost:9002/docs

For detailed installation instructions, see the Getting Started Guide.

Create Metric

import httpx

# Define a metric with output formatting
metric = {
    "name": "monthly_revenue",
    "description": "Total revenue aggregated by month",
    "table_name": "sales",
    "measures": [
        {
            "name": "revenue",
            "type": "sum",
            "query": "amount",
            "formatting": [{
                "name": "currency",
                "type": "format",
                "mode": "post_query",
                "format_string": "${:,.2f}"
            }]
        }
    ],
    "dimensions": [
        {
            "name": "month",
            "query": "sale_date",
            "type": "time"
        }
    ]
}

# Create the metric
response = httpx.post("http://localhost:9002/api/v1/metrics", json=metric)

# Execute the metric
result = httpx.post(
    f"http://localhost:9002/api/v1/metrics/{response.json()['id']}/execute",
    json={"parameters": {"start_date": "2024-01-01"}}
)
{
  "success": true,
  "data": [
    {
      "month": "2024-01-01",
      "revenue": "$12,500.50"
    },
    {
      "month": "2024-02-01",
      "revenue": "$14,230.75"
    }
  ],
  "metadata": {
    "metric_id": "8f3e5b12-9c1a-4d3b-8e2f-7a6c5b4d3e2f",
    "duration": 25.4,
    "row_count": 2,
    "query": "SELECT sale_date, SUM(amount) FROM sales WHERE sale_date >= '2024-01-01' GROUP BY 1",
    "parameters": {
      "start_date": "2024-01-01"
    }
  }
}

See the API Reference for complete API documentation.

Studio

Cortex includes a modern GUI for managing workspaces, data sources, metrics, and dashboards.

cd frontend/cortex
yarn install
yarn run dev

Documentation

📚 Core

Concepts Description
Getting Started Installation, configuration, and quick start tutorial
Architecture System architecture
Multi Tenancy Workspaces, environments, and consumer management
Development Contributing guidelines and development setup

🔧 Modules

Module Description
Core Modules Overview of all core components
Semantic Layer Metric definitions, measures, dimensions, and formatting
Query Engine SQL generation, caching, and preaggregations
Data Sources Database connectors and schema introspection
Dashboards Visualization types and widget configuration
API Reference REST API endpoints and usage examples

📖 Guides

Contributing

Contributions are welcome! Please see the Development Guide

License

This project is licensed under the MIT License - see the LICENSE file for details.

Attribution

Cortex was inspired by Cube's Semantic Layer and Metabase. We built upon their work to create a lightweight analytics platform.

Support

For questions and support:

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

telescope_cortex-0.0.1a7.tar.gz (5.5 MB view details)

Uploaded Source

Built Distribution

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

telescope_cortex-0.0.1a7-py3-none-any.whl (5.7 MB view details)

Uploaded Python 3

File details

Details for the file telescope_cortex-0.0.1a7.tar.gz.

File metadata

  • Download URL: telescope_cortex-0.0.1a7.tar.gz
  • Upload date:
  • Size: 5.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.11 Darwin/25.1.0

File hashes

Hashes for telescope_cortex-0.0.1a7.tar.gz
Algorithm Hash digest
SHA256 ac7eb23a6c12ea8b22c0490979112bc00ca761034ba8cfcdf4f55061cf017a3f
MD5 bd56067c1911647a75450716b543bdbc
BLAKE2b-256 511083fa86379cd8ab3506c79dc9da8088b5f45de69441410582cd6048dd703d

See more details on using hashes here.

File details

Details for the file telescope_cortex-0.0.1a7-py3-none-any.whl.

File metadata

  • Download URL: telescope_cortex-0.0.1a7-py3-none-any.whl
  • Upload date:
  • Size: 5.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.11 Darwin/25.1.0

File hashes

Hashes for telescope_cortex-0.0.1a7-py3-none-any.whl
Algorithm Hash digest
SHA256 4d04eef08f1056a8cd9db0b696e66dafdb8f5a31a52a7b3be1c41d2dd712e15a
MD5 ed72f13a6d28375843ac382cc98bc1ea
BLAKE2b-256 3018f198b7b80d96f6919dfc5b1d3216aab841ddbda13b83c6ed563d3e9735f1

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