Metadata-Version: 2.4
Name: igc-net
Version: 0.1.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: click>=8.0
Requires-Dist: maturin>=1.8,<2 ; extra == 'dev'
Requires-Dist: pytest>=9 ; extra == 'dev'
Requires-Dist: pytest-asyncio ; extra == 'dev'
Requires-Dist: ruff ; extra == 'dev'
Provides-Extra: dev
License-File: LICENSE
Summary: Python bindings for the igc-net flight log exchange protocol
Keywords: igc,p2p,iroh,gliding,soaring
Home-Page: https://igcnet.io
License-Expression: Apache-2.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://igcnet.io
Project-URL: Issues, https://github.com/ntnu-dse/igc-net-py/issues
Project-URL: Repository, https://github.com/ntnu-dse/igc-net-py

# igc-net (Python)

Python bindings for the [igc-net](https://igcnet.io) flight log exchange protocol,
wrapping the Rust reference implementation via PyO3.

## Installation

Install from PyPI:

```bash
pip install igc-net
```

If no matching wheel is available for your platform, `pip` will build the
extension from source. That requires a local Rust toolchain.

For unreleased local development, use a checkout and `maturin develop`; see
Development below.

## Quick start

```python
from igc_net import IgcNode, FlightMetadata
from pathlib import Path

# Inspect an IGC file (offline, no network needed)
meta = FlightMetadata.from_igc(Path("flight.igc").read_bytes())
print(meta.pilot_name, meta.duration_s)

# Publish to the network
with IgcNode(str(Path.home() / ".igc-net")) as node:
    result = node.publish(Path("flight.igc").read_bytes(), filename="flight.igc")
    print(result.igc_hash)
```

## CLI

```bash
igc-net announce flight.igc       # Publish an IGC file
igc-net runindex --policy eager   # Run an indexer node
igc-net fetch <igc_hash>          # Retrieve by hash
igc-net inspect flight.igc        # Analyze offline
igc-net list                      # Show local index
```

## Development

Requires Rust toolchain and Python 3.12+.

```bash
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
make test
```

Useful targets:

```bash
make help
make fmt
make vet
make itest
make compliance
```

Cross-language compliance tests require the Rust CLI binary and do not assume a
local sibling checkout. Install it separately and point the tests at it:

```bash
cargo install igc-net-cli
IGCNET_RS_BIN="$HOME/.cargo/bin/igc-net" make compliance
```

