semvec/pypi-packages huggingface dataset:
environmental-risk-metrics 0.3.5
Calculate environmentalrisk metrics for a given polygon
Requires Python: >=3.10

# Environmental Risk Metrics

![License](https://img.shields.io/badge/license-MIT-blue.svg)
![Python Version](https://img.shields.io/badge/Python-3.12%2B-blue.svg)

Calculate environmental risk metrics for a given polygon using advanced geospatial and data processing tools.

## Table of Contents

- [Features](#features)
- [Getting Started](#getting-started)
  - [Prerequisites](#prerequisites)
  - [Installation](#installation)
- [Usage](#usage)
  - [Running the API](#running-the-api)
  - [Using Jupyter Notebooks](#using-jupyter-notebooks)
- [Data Resources](#data-resources)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)

## Features

- **NDVI Calculation:** Compute Normalized Difference Vegetation Index (NDVI) values for specified polygons.
- **Sentinel-2 Integration:** Load and process Sentinel-2 satellite data for various spectral bands.
- **Interactive Notebooks:** Utilize Jupyter notebooks for data analysis and visualization.
- **Comprehensive Soil Data:** Incorporates detailed soil type information for accurate risk assessment.
- **Protected Areas:** Get nearest Ramsar protected sites for a given geometry
- **Social Indices:** Get Global Witness data for the countries containing or intersecting the given geometry
- **Endangered Species:** Get endangered species data for the countries containing or intersecting the given geometry
- **Climate Data:** Get climate data for the countries containing or intersecting the given geometry

## Getting Started

### Prerequisites

- Python 3.12+
- [Git](https://git-scm.com/)

### Installation

1. **Clone the Repository**

   ```bash
   pip install environmental-risk-metrics
   ```

## Examples

### Using Jupyter Notebooks

Interactive analysis can be performed using the provided Jupyter notebooks.

1. **Navigate to the Notebooks Directory**

   ```bash
   cd notebooks
   ```

2. **Launch Jupyter Notebook**

   ```bash
   jupyter notebook
   ```

3. **Open and Run the Desired Notebook**

   For example, open `01 - all_metrics.ipynb` to explore environmental risk metrics calculations.

## Contributing

Contributions are welcome! Please follow these steps:

1. **Fork the Repository**

2. **Create a Feature Branch**

   ```bash
   git checkout -b feature/YourFeature
   ```

3. **Commit Your Changes**

   ```bash
   git commit -m "Add some feature"
   ```

4. **Push to the Branch**

   ```bash
   git push origin feature/YourFeature
   ```

5. **Open a Pull Request**

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

## Contact

Developed by [Thimm](mailto:thimm@regenrate.com). For any inquiries or feedback, please reach out via email.
bullinv-api-client 0.1.2
Add your description here
Requires Python: >=3.10

BullInv API Client (WebSocket + REST SDK)

Python SDK for streaming aggregate market data and indicators from BullInv WebSocket service, plus a simple REST client for QuestDB queries producing pandas DataFrames.

Defaults
- Default WebSocket URL: `wss://quote-ws.bullinv.tech`
- Subscriptions format: `"<timespan>.<ticker>"` (e.g., `"15m.*"`, `"1m.AAPL"`)

Install

```bash
pip install bullinv-api-client
# or with uv for local dev
uv venv && uv pip install -e .
```

WebSocket Authentication
- Provide your API key to the client; the SDK sends the first auth frame automatically.
- If the server responds with `{"type":"error","message":"unauthorized"}`, the SDK logs an error and closes the connection.

Sync client (polygon-style wrapper)

```python
from bullinv_api_client import WebSocketClient, DataType

client = WebSocketClient(api_key="live_pk_9f3a2e1c4b7d")
client.subscribe("1m.AAPL", datatype=DataType.Aggregates)
client.run(lambda batch: print(batch))
```

Logging (to see auth failures)

```python
import logging
logging.basicConfig(level=logging.INFO)
```

REST (QuestDB) Client

- Base URL: `https://questdb-api.bullinv.tech`
- Endpoint: `/questdb/exe`
- Headers required (Cloudflare Access):
  - `CF-Access-Client-Id`
  - `CF-Access-Client-Secret`

Set credentials in a `.env` file in your working directory:

```bash
CF_ACCESS_CLIENT_ID=xxxxx
CF_ACCESS_CLIENT_SECRET=yyyyy
```

Usage to fetch daily candles as a pandas DataFrame:

```python
from dotenv import load_dotenv
from bullinv_api_client import QuestDBClient

load_dotenv()
client = QuestDBClient()
df = client.get_daily_candles("AAPL", start_date="2024-01-01", end_date="2024-06-01")
print(df.head())
```

Example script:

```bash
python examples/pandas_daily_candles.py
```