semvec/pypi-packages huggingface dataset:
onebullex 1.0.0
A production-ready Python client for the OneBullEx Exchange API
Requires Python: >=3.7

# OneBullEx Python Client

A production-ready, typed, and robust Python client for the [OneBullEx Exchange](https://www.onebullex.com) API.

Designed for trading systems and quantitative infrastructure, offering:
- **Clean Architecture**: Strict separation of transport, authentication, and business logic.
- **Robustness**: Connection pooling, exponential backoff retries, and strict timeouts.
- **Type Safety**: Pydantic models for all major interactions.
- **Safety**: Proactive rate limiting and idempotent-aware retry logic.

## Installation

```bash
pip install requests pydantic
pip install -e .
```

## Quick Start

### Public Data

```python
from onebullex import OneBullExClient

# Initialize (defaults to PROD environment)
client = OneBullExClient()

# Get Market Summary
summary = client.market.summary()
print(summary)

# Get Orderbook
depth = client.market.orderbook("BTCUSDT")
print(f"Best Bid: {depth['bids'][0]}")
```

### Authenticated Trading

```python
from onebullex import OneBullExClient
from onebullex.models.orders import PlaceSpotOrder, OrderSide, OrderType

client = OneBullExClient(
    api_key="YOUR_API_KEY",
    secret="YOUR_SECRET",
    identify="YOUR_IDENTIFY_CODE"
)

# Place a Limit Order
order = PlaceSpotOrder(
    symbol="BTCUSDT",
    side=OrderSide.BUY,
    orderType=OrderType.LIMIT,
    price="45000.0",
    quantity="0.001"
)

try:
    response = client.orders.place(order)
    print(f"Order Placed: {response}")
except Exception as e:
    print(f"Trading Error: {e}")
```

## Architecture

This client treats infrastructure as code:

- **`onebullex.transport`**: Low-level HTTP/WebSocket handling with `requests.Session`.
- **`onebullex.auth`**: `Signer` class for HMAC-SHA256 signatures with automatic server-time drift correction.
- **`onebullex.models`**: Pydantic models for request validation.
- **`onebullex.errors`**: Hierarchical exception mapping (e.g., specific `InsufficientBalanceError` vs generic `ClientError`).

## Development

Run tests:
```bash
python -m unittest discover tests
```

Run verification script (Public API):
```bash
python examples/verify_rest_v2.py
```

## License

MIT
pygwy-txt-analysis 0.0.1
A library to analize and plot AFM scans
Requires Python: >=3.9

# README

## Overview

This script provides tools for analyzing and visualizing surface profiles exported from **Gwyddion** `.txt` files. It allows you to create height maps, profile plots, perform peak/valley detection, and compute statistical metrics and model fits from surface data.

---
## Installation

`pip install /path/to/pygwy_txt-[VERSION].tar.gz`

---

# Important File Naming Convention
To ensure proper ordering in the aggregated plots, the filenames of the `.txt` files has to have the x-axis parameter as first number in the file name.

```
1s_sample.txt
5s_sample.txt
10s_sample.txt
```
---
## Classes and Initialization

### `PygwyTxt`
Handles reading, analysis, and visualization of a single Gwyddion `.txt` scan file.

**Initialization parameters:**
- `file_path: str` – Path to the input `.txt` file containing surface data.  
- `scan_size_x: float` – Horizontal scan size in micrometers.  
- `scan_size_y: float` – Vertical scan size in micrometers.  
- `name: str, optional` – Custom name for the dataset. Defaults to the filename.  
- `peak_finder_settings: PeakFinderSettings, optional` – Settings controlling peak/valley detection.

**Key methods:**
- `plot_scan()` – Creates a heatmap of the full scan.  
- `plot_profile()` – Plots the height profile along the central scan line.  
- `plot_profile_section(start, stop, line)` – Plots a selected section of a chosen scan line.  
- `plot_debug(line)` – Visualizes detected peaks and valleys for inspection.  
- `export_stats()` – Saves calculated statistics as a JSON file.  

**Automatically computed values:**
- Mean height and mean period  
- Standard deviation, minimum, maximum  

---

### `StatJson`
Collects and processes multiple JSON statistic files to visualize aggregated results or fits.

**Initialization parameters:**
- `base_path: str` – Directory containing JSON statistic files.

**Key methods:**
- `plot(plot_type, x_label, x_unit, plot_name_appendix='', model=None, params=None, show_title=True, x_log=False, y_log=False)` – Plots mean and standard deviation of height (`plot_type=0`) or period (`plot_type=1`). Optionally applies a model fit.  
- `export_plot_data(plot_type)` – Exports the plotted data (including fits) to a CSV file.  

---

### `PeakFinderSettings`
Defines configurable parameters for the `scipy.signal.find_peaks` algorithm to control peak and valley detection.

**Initialization parameters (all optional):**
- `height` – Required height of peaks.  
- `threshold` – Required vertical difference between peaks and neighbors.  
- `distance` – Minimum horizontal distance between peaks.  
- `prominence` – Required prominence of peaks.  
- `width` – Required width of peaks.  
- `wlen` – Window length for peak prominence evaluation.  
- `rel_height` – Relative height at which the peak width is measured.  
- `plateau_size` – Range of flat peak plateaus.