semvec/pypi-packages huggingface dataset:
vue-ssr 0.1.0
Render Vue components on the server side
Requires Python: >=3.11

# Vue Server-Side Rendering in Python

[![Test Workflow](https://github.com/krmax44/vue-ssr-python/actions/workflows/test.yaml/badge.svg)](https://github.com/krmax44/vue-ssr-python/actions/workflows/test.yaml)
[![PyPI - Version](https://img.shields.io/pypi/v/vue-ssr)](https://pypi.org/project/vue-ssr/)
[![API documentation](https://img.shields.io/badge/-api%20docs-blue)](https://krmax44.github.io/vue-ssr-python/vue_ssr.html)


Client for [`vue-ssr-service`](https://github.com/krmax44/vue-ssr-service). See its documentation for a [quick start guide](https://github.com/krmax44/vue-ssr-service#getting-started-with-vite).

> [!WARNING]
> This project is in a proof-of-concept state.

## Stand-alone

```python
from vue_ssr import ServerRenderer

renderer = ServerRenderer()
renderer.render("myComponent", props={"name": "friend"})
# "<p>Hello, friend!</p>"
```

## With Django

Works well in conjunction with [`django-vite`](https://github.com/MrBin99/django-vite). Add it to your installed apps:

```py
INSTALLED_APPS = [
  "vue_ssr",
  ...
]
```

Then, you can simply use the provided template tag:

```django
{% load vue_ssr %}
<user-greeting>{% render_vue "userGreeting" name=request.user.username %}</user-greeting>
```

Or pass a dict with props:

```django
<my-app>{% render_vue "myApp" props=props %}</my-app>
```
pybind11-rdp 0.1.5
C++/pybind11/NumPy implementation of the Ramer-Douglas-Peucker algorithm (Ramer 1972; Douglas and Peucker 1973) for 2D and 3D data.
Requires Python: >=3.7

# Ramer-Douglas-Peucker Algorithm (c++ binding for python via pybind11)

>   A speed up (~8000x) version of [python version of rdp](https://github.com/fhirschmann/rdp).

C++/pybind11/NumPy implementation of the Ramer-Douglas-Peucker algorithm (Ramer 1972; Douglas and Peucker 1973) for 2D and 3D data.

The Ramer-Douglas-Peucker algorithm is an algorithm for reducing the number of points in a curve that is approximated by a series of points.


## Installation

### via pip

```bash
pip install -U pybind11-rdp
```

### from source

```bash
git clone --recursive https://github.com/cubao/pybind11-rdp
pip install ./pybind11-rdp
```

Or

```bash
pip install git+https://github.com/cubao/pybind11-rdp.git
```

(you can build wheels for later reuse by ` pip wheel git+https://github.com/cubao/pybind11-rdp.git`)

## Usage

Test installation: `python -c 'from pybind11_rdp import rdp; print(rdp([[1, 1], [2, 2], [3, 3], [4, 4]]))'`

Simple pythonic interface:

```python
from pybind11_rdp import rdp

rdp([[1, 1], [2, 2], [3, 3], [4, 4]])
[[1, 1], [4, 4]]
```

With epsilon=0.5:

```python
rdp([[1, 1], [1, 1.1], [2, 2]], epsilon=0.5)
[[1.0, 1.0], [2.0, 2.0]]
```

Numpy interface:

```python
import numpy as np
from pybind11_rdp import rdp

rdp(np.array([1, 1, 2, 2, 3, 3, 4, 4]).reshape(4, 2))
array([[1, 1],
       [4, 4]])
```

## Tests

```bash
make python_install
make python_test
```

## Benchmark

```bash
python3 test.py
```

## Notice

As <https://github.com/fhirschmann/rdp/issues/13> points out, `pdist` in `rdp` is **WRONGLY** Point-to-Line distance.
We use Point-to-LineSegment distance.

```python
from rdp import rdp
print(rdp([[0, 0], [10, 0.1], [1, 0]], epsilon=1.0)) # wrong
# [[0.0, 0.0],
#  [1.0, 0.0]]

from pybind11_rdp import rdp
print(rdp([[0, 0], [10, 0.1], [1, 0]], epsilon=1.0)) # correct
# [[ 0.   0. ]
#  [10.   0.1]
#  [ 1.   0. ]]
```

## References

Douglas, David H, and Thomas K Peucker. 1973. “Algorithms for the Reduction of the Number of Points Required to Represent a Digitized Line or Its Caricature.” Cartographica: The International Journal for Geographic Information and Geovisualization 10 (2): 112–122.

Ramer, Urs. 1972. “An Iterative Procedure for the Polygonal Approximation of Plane Curves.” Computer Graphics and Image Processing 1 (3): 244–256.