semvec/pypi-packages huggingface dataset:
acorn-py 0.1.36
Python bindings for acorn-lib crate
Requires Python: >=3.10
Keywords: research, automation

# ACORN 🌱
[<img alt="gitlab" src="https://img.shields.io/badge/code.ornl.gov-research_enablement-00662C?style=for-the-badge&logo=gitlab&color=%2300662C" height="20">](https://research.ornl.gov)
[<img alt="PyPI" src="https://img.shields.io/pypi/v/acorn-py?style=for-the-badge&logo=python" height="20">](https://pypi.org/project/acorn-py/)
> Python bindings for the [acorn-lib](https://crates.io/crates/acorn-lib) crate

## So what? Big deal...who cares?
`acorn-py` allows you to leverage best in class [persistent identifier](https://en.wikipedia.org/wiki/Persistent_identifier) validation and other [ACORN](https://acorn.ornl.gov) <sup>[[1]](#1)</sup> capabilities in your Python projects.

## Installation
### Pixi <sup>[[2]](#2)</sup>
> ⭐ Recommended
```shell
pixi add acorn-py --pypi
```

### Poetry
```shell
poetry add acorn-py
```

### Pip
```shell
pip install acorn-py
```

### Conda
> ⌛ Coming soon

## Example Usage
```python
from acorn.schema.validate import is_ark, is_doi, is_orcid, is_ror

# Archival Resource Keys
assert is_ark("https://n2t.net/ark:12148/btv1b8449691v/f29")

# Digital Object Identifiers
assert is_doi("10.11578/dc.20250604.1")

# Open Researcher and Contributor Identifiers
assert is_orcid("https://orcid.org/0000-0002-2057-9115")

# Research Organization Registry identifiers
assert is_ror("01qz5mb56")
```

---
**Footnotes**
-------------

[1]
---
The `acorn-py` Python wheel is built from Rust code using [Maturin](https://www.maturin.rs/). `acorn-py` does not support the entire ACORN API, see the [acorn-py project code](https://code.ornl.gov/research-enablement/acorn/-/blob/main/acorn-py/src/lib.rs) for details.

[2]
---
On linux, may need to augment your `pixi.toml` with
```toml
[system-requirements]
libc = { family = "glibc", version = "2.34" }
```
egauge-async 0.4.0
Async client for eGauge energy monitor (https://www.egauge.net)
Requires Python: >=3.11

# Egauge-Async

`asyncio` APIs for communicating with [eGauge](https://www.egauge.net) meters.

## Examples

### Get current rates
```python
import asyncio
from egauge_async import EgaugeClient

async def get_current_rates():
    egauge = EgaugeClient("http://egaugehq.d.egauge.net")
    current_readings = egauge.get_current_rates()
    print(current_readings)

asyncio.run(get_current_rates())
```

### Get weekly changes over the last 4 weeks

```python
import asyncio
from egauge_async import EgaugeClient

async def get_weekly_changes():
    egauge = EgaugeClient("http://egaugehq.d.egauge.net")
    weekly_changes = egauge.get_weekly_changes(num_weeks=4)
    print(weekly_changes)

asyncio.run(get_weekly_changes())
```

### Get available registers

```python
import asyncio
from egauge_async import EgaugeClient

async def get_registers():
    egauge = EgaugeClient("http://egaugehq.d.egauge.net")
    instantaneous_registers = egauge.get_instantaneous_registers()j
    print(instantaneous_registers)
    historical_registers = egauge.get_historical_registers()
    print(historical_registers)

asyncio.run(get_historical_registers())
```

## Implementation Details

This package uses the publically-documented [XML API](https://kb.egauge.net/books/egauge-meter-communication/page/xml-api)
provided by eGauge Systems. It also provides support for the newer JSON API with JWT authentication.

## Testing

The project includes both unit tests and integration tests:

### Running Tests

```bash
# Run all unit tests (default)
uv run pytest

# Run with coverage
uv run pytest --cov=egauge_async

# Run integration tests (requires real eGauge device)
export EGAUGE_HOST="egauge12345.local"
export EGAUGE_USERNAME="owner"
export EGAUGE_PASSWORD="your_password"
uv run pytest -m integration
```

Integration tests validate functionality against a real eGauge device and are automatically skipped if the required environment variables (`EGAUGE_HOST`, `EGAUGE_USERNAME`, `EGAUGE_PASSWORD`) are not set.

## Disclaimer

This project is not affiliated with, endorsed by, or sponsored by eGauge Systems LLC. Any
product names, logos, brands, or other trademarks are the property of their respective
trademark holders.