Metadata-Version: 2.4
Name: sep2tools
Version: 0.5.1
Summary: Useful functions for working with IEEE 2030.5 (SEP2)
Author-email: Alex Guinman <alex@guinman.id.au>
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
License-File: LICENSE
Requires-Dist: pydantic>=2.10.6 
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: sqlite_utils>=3.38
Requires-Dist: jupyter>=1.1.1 ; extra == "examples"
Requires-Dist: 1.41.2 ; extra == "examples"
Requires-Dist: altair>=6.1.0 ; extra == "examples"
Requires-Dist: pytest>=2.7.3 ; extra == "test"
Requires-Dist: pytest-cov>=6.0.0 ; extra == "test"
Project-URL: Source, https://github.com/aguinane/SEP2-Tools
Provides-Extra: examples
Provides-Extra: test

# SEP2-Tools

[![PyPI version](https://img.shields.io/pypi/pyversions/sep2tools)][pypi]
[![PyPi downloads](https://img.shields.io/pypi/dw/sep2tools)][pypi]

[pypi]: https://pypi.org/project/sep2tools/

This library provides some useful functions for working with IEEE 2030.5 (SEP2).

Note this library used to also include some functions for creating and validating certificates. This has now been moved to a seperate [SEP2-Certs](https://github.com/aguinane/SEP2-Certs) package. 

## Helper Functions

### Generating IDs

```python
from sep2tools.ids import generate_mrid

EXAMPLE_PEN = 1234
mrid = generate_mrid(EXAMPLE_PEN)
print(mrid)  # 2726-D70C-C6C2-40DB-B78E-9B38-0000-1234
```

### Bitmap Hex Mappings

Some helper functions are provided for calculating the hex representation of SEP2 bitmap fields.

```python
from sep2tools.hexmaps import get_role_flag

binval, hexval = get_role_flag(is_mirror=1, is_der=1, is_submeter=1)
print(binval)  # 0000000001001001
print(hexval)  # 0049
```

