semvec/pypi-packages huggingface dataset:
pcurvepy2 0.2.1
Principal curves implementation in Python
Requires Python: >=3.9

# pcurvepy
### Principal Curves

This is an implementation of the Principal Curves (Hastie '89) algorithm in Python.

It is a fork of the `zsteve/pcurvepy` package where
the projection indices are selected according to our
translation of the R/C++ `princurve` package.

Installation:
```
pip install pcurvepy2
```

Example:

```python
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import pcurve

data = pd.read_csv('test_data.csv')
x = data.loc[:, ('X1', 'X2')].to_numpy()

# transform data to have zero mean
x = x - np.mean(x, 0)
index = np.arange(0, len(x))

curve = pcurve.PrincipalCurve(k=5)
curve.fit(x)

plt.scatter(x[:, 0], x[:, 1], alpha=0.25, c=index)
plt.plot(curve.points[:, 0], curve.points[:, 1], c='k')

# get interpolation indices
pseudotime_interp, point_interp, order = curve.unpack_params()


```

![example](example.png)
selenium-package 0.0.1
A Python package for Selenium automation with action and executor patterns.
Requires Python: >=3.9

# Selenium Package

A Python package for Selenium automation with action and executor patterns.

## Features

- **BaseAction**: Abstract base class for creating Selenium actions
- **BaseExecutor**: Abstract base class for executing actions with conditions and timeouts
- **Exception Handling**: Custom exceptions for better error handling
- **Type Hints**: Full type annotation support

## Installation

```bash
pip install selenium-package
```

## Usage

### Basic Action

```python
from selenium_package import BaseAction
from selenium.webdriver import Chrome

class ClickAction(BaseAction):
    def _execute_action(self):
        element = self.web_instance.find_element("id", "my-button")
        element.click()
        return "Button clicked successfully"

# Usage
driver = Chrome()
action = ClickAction(web_instance=driver)
result = action.run()
```

### Basic Executor

```python
from selenium_package import BaseExecutor

class ClickExecutor(BaseExecutor):
    def _is_condition_to_stop_met(self, result=None):
        return result == "Button clicked successfully"

# Usage
executor = ClickExecutor(
    action=ClickAction(web_instance=driver),
    timeout=30,
    wait_to_verify_condition=1
)
result = executor.run()
```

## Development

### Setup

```bash
git clone https://github.com/jgabrielsb/selenium-package.git
cd selenium-package
pip install -e ".[dev]"
```

### Running Tests

```bash
pytest
```

### Code Formatting

```bash
black selenium_package tests
isort selenium_package tests
```

## License

MIT License - see LICENSE file for details.