Metadata-Version: 2.4
Name: dachshund
Version: 0.1.1
Summary: An embedded, real-time admin dashboard for any Python service
Author: Simon Roy
License: MIT License
        
        Copyright (c) 2026 Simon Roy
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Source, https://github.com/PenguinBoi12/dachshund
Project-URL: Issues, https://github.com/PenguinBoi12/dachshund/issues
Keywords: dashboard,admin,monitoring,metrics,realtime,websocket
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: System :: Monitoring
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: aiohttp==3.13.5
Requires-Dist: Jinja2==3.1.6
Requires-Dist: markdown-it-py==4.2.0
Requires-Dist: nh3==0.3.7
Provides-Extra: dev
Requires-Dist: pytest==9.1.1; extra == "dev"
Requires-Dist: pytest-cov==7.1.0; extra == "dev"
Requires-Dist: pytest-asyncio==1.4.0; extra == "dev"
Requires-Dist: black==26.5.1; extra == "dev"
Requires-Dist: mypy==2.1.0; extra == "dev"
Provides-Extra: doc
Requires-Dist: mkdocs==1.6.1; extra == "doc"
Requires-Dist: mkdocs-material==9.7.6; extra == "doc"
Requires-Dist: mkdocstrings[python]==1.0.8; extra == "doc"
Requires-Dist: pymdown-extensions==12.3; extra == "doc"

# Dachshund
> *A live admin dashboard for any Python service, embedded in the process itself.*

[![Tests](https://github.com/PenguinBoi12/dachshund/actions/workflows/tests.yml/badge.svg)](https://github.com/PenguinBoi12/dachshund/actions/workflows/tests.yml)
[![PyPI](https://img.shields.io/pypi/v/dachshund)](https://pypi.org/project/dachshund/)
[![CodeQL Advanced](https://github.com/PenguinBoi12/dachshund/actions/workflows/codeql.yml/badge.svg)](https://github.com/PenguinBoi12/dachshund/actions/workflows/codeql.yml)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/PenguinBoi12/dachshund/badge)](https://securityscorecards.dev/viewer/?uri=github.com/PenguinBoi12/dachshund)

> **Beta.** Dachshund works, but its API may still change between releases. Pin a version before depending on it.

![A dachshund dashboard showing a worker's jobs](docs/docs/img/dashboard.png)

## What is Dachshund
Dachshund runs as a thread inside your web app, bot, worker or daemon. There's no router to hook into and no extra service to deploy. Declare pages and widgets in code, emit events from anywhere, and the dashboard updates live over WebSocket.

#### Key features
- **Embedded**: starts with your process, nothing else to run
- **Live**: every `emit()` reaches the open pages as it happens
- **Pages**: group widgets into pages and tabs, lay them out in rows and columns
- **Actions**: buttons that call your own Python functions
- **Authentication**: plug in your app's own auth, with public and private pages
- **Extensible**: write your own widgets in a few lines of Python and JavaScript

## Getting Started

#### 1- Install the package

**Requirements:** Python 3.12 or higher

```bash
pip install dachshund
```

#### 2- Start the dashboard

Call `init()` once, when your application starts. The dashboard runs on a background thread for as long as your process does.

```python
import dachshund

dachshund.init("My service", description="What my service does")
```

#### 3- Add a page

Widgets live in rows: open one with `with page.row():`, then `page.add()` each widget. Widgets in a row sit side by side, and a row with one widget takes the full width.

```python
from dachshund import Page
from dachshund.widgets import Number, TimeSeriesChart

page = Page("overview", title="Overview")

with page.row():
    page.add(Number("users"))

with page.row():
    page.add(TimeSeriesChart("latency"))
    page.add(TimeSeriesChart("errors"))

dachshund.include(page)
```

#### 4- Emit events

A widget shows the events emitted under its name. Emit from anywhere in your code, on any thread.

```python
dachshund.emit("users", value=1204)
dachshund.emit("latency", value=96)
```

Start your application and visit http://127.0.0.1:1212.

#### Extra: exposing the dashboard

The dashboard has no authentication by default. Anyone who can reach its port sees every page and can run every action. Keep it on `127.0.0.1`, or give `init()` an `authorize` function to decide who gets in.

To listen on every interface, for example inside a container:

```python
dachshund.init("My service", host="0.0.0.0", port=1212)
```

A reverse proxy must allow WebSocket upgrades on `/_ws`, which carries the live updates.

## Development
```bash
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
```

Run the checks:

```bash
black dachshund/ tests/
mypy dachshund
pytest
```

## License
Dachshund is released under MIT.
