semvec/pypi-packages huggingface dataset:
flaskgraph 0.1.2
Easily embed Chart.js charts in Flask apps via jinja from the backend
License: MIT
Keywords: flask, chartjs, charts, visualization, data, graph

# FlaskGraph

FlaskGraph makes it dead simple to drop [Chart.js](https://www.chartjs.org/) charts into your Flask app without touching JavaScript. You just write Python, pass it to your template, and you're done.

---

## 🔧 Installation

```bash
pip install flaskgraph
```

---

## ⚡ Quickstart

### 1. Import & Use in Flask

```python
from flaskgraph import graph

@app.route("/")
def dashboard():
    chart = graph.bar(
        ['Jan', 'Feb', 'Mar'],
        {"Appointments": [27, 35, 12]}, # pass data as dict for descriptive tooltip
        legend=False,
        label_color='standard',
        grid=False,
        colortheme='sky'
    )
    return render_template("dashboard.html", chart=chart)
```

### 2. In Your Template

**Include Chart.js in your HTML `<head>`:**

```html
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
```

**Render the chart inside a container with a set width (the canvas is included automatically):**

```html
<div style="width: 100%; max-width: 600px;">
  {{ chart|safe }}
</div>
```

---

## 📊 Supported Chart Types

```python
graph.bar(labels, data, ...)
graph.line(labels, data, ...)
graph.donut(labels, data, ...)
graph.scatter(labels, data, ...)
```

Each method returns a fully ready-to-render HTML `<canvas>` with a Chart.js config script.

---

## 🎨 Parameters

| Parameter     | Type    | Description                                                  |
|---------------|---------|--------------------------------------------------------------|
| `labels`      | list    | X-axis labels                                                |
| `data`        | list    | Y-axis values                                                |
| `label_color` | str     | Label color: `"standard"`, `"dark"`, or `"light"`            |
| `legend`      | bool    | Show/hide the legend                                         |
| `grid`        | bool    | Show/hide background grid lines                              |
| `colortheme`  | str     | One of the predefined themes below                           |

---

## 🌈 Available Color Themes

```
blue, green, red, yellow, orange,
purple, pink, teal, sky, lime,
slate, gray, zinc,
neon-green, neon-pink, neon-blue
```

---

## ✅ Example

```python
revenue = graph.line(
    ['Q1', 'Q2', 'Q3', 'Q4'],
    [5000, 7000, 4000, 6500],
    label_color='dark',
    legend=True,
    grid=True,
    colortheme='lime'
)
```

```html
<div style="max-width: 700px;">
  {{ revenue|safe }}
</div>
```

That's it. No JavaScript. No extra config.
fastbktree 0.1.1
A Rust BK-tree implementation for fast fuzzy string matching in Python
License: MIT
Requires Python: >=3.8
Keywords: bktree, levenshtein, fuzzy-matching, string-matching, rust

# fastbktree :deciduous_tree:

A Rust implementation of [BK-trees](https://en.wikipedia.org/wiki/BK-tree) for fast fuzzy string matching in Python.


## Installation

```bash
uv add fastbktree
# pip install fastbktree
```

## Quickstart
```python
from fastbktree import BKTree

# Create a BK-tree from a list of strings
tree = BKTree(["hello", "help", "hell", "shell", "helper"])
results = tree.search("helo", max_distance=2)
```

## Reference

### `BKTree(iterable)`
Creates a new BK-tree from an iterable of strings.

```python
tree = BKTree(["word1", "word2", "word3"])
```

### `tree.search(query: str, max_distance: int) -> List[Tuple[str, int]]`
Searches for strings similar to `query` within `max_distance` Levenshtein distance.
Returns a list of `(string, distance)` tuples.

```python
results = tree.search("query", max_distance=2)
# [('hello', 1), ('help', 1), ('shell', 2), ('hell', 1)]
```

### `levenshtein_distance(a: str, b: str) -> int`
Pure Rust implementation of Levenshtein distance between two strings.

```python
from fastbktree import levenshtein_distance

distance = levenshtein_distance("kitten", "sitting")  # 3
```


## License
MIT