Metadata-Version: 2.4
Name: current-data-py
Version: 0.1.0
Summary: Current Data protobuf messages and schema metadata
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: protobuf>=3.20
Requires-Dist: turbodata==0.1.0

# current-data-py

Current Data protobuf messages and schema metadata. Requires Python 3.9+.

```bash
pip install current-data-py
```

```python
from current_data_py import SCHEMA_TO_CLASS, descriptor_set, topic_metadata
from current_data_py.schema import Pose

message = Pose()
message.position.y = 1.0
metadata = topic_metadata(Pose)
decoded = SCHEMA_TO_CLASS[metadata["schema_name"]].FromString(message.SerializeToString())
```

TD examples write/read a Pose on `/head/pose/command`:

```bash
python -m current_data_py.write_td example.td
python -m current_data_py.read_td example.td
```

## Development and releases

Packaging configuration lives in `current_data_py/`. Generated messages live
only in the repository's `proto_gen/python/msg`. Regenerate them using the
existing `proto/generate.sh` workflow after changing `proto/msg`.
The build reads those files and adjusts their Python imports in the build
directory, placing them under `current_data_py._proto` in the wheel.
It does not modify or duplicate generated sources in the checkout.
The source distribution includes the original generated files so it can also
build without `protoc`. Installation requires neither the repository nor `protoc`.

```bash
cd current_data_py  # from the repository root
python -m pip install build twine
python -m build
python -m twine check dist/*
python tests/check_distribution.py
```

Artifacts are written to `current_data_py/dist/`. The build adds the shared
protobuf inputs to the source archive without copying them into this directory.

For development, use a regular `pip install .` and run from outside the checkout;
reinstall after changes. Editable installs are not supported by this build step.

Install the wheel in a fresh environment and run
`python /absolute/path/to/current_data_py/tests/check_package.py` from outside
the repository. Use a clean `dist` for each release and increment the version
in `pyproject.toml`. Confirm the package name, license and supported Python
versions before publishing. No license has been selected yet.

```bash
python -m twine upload --repository testpypi dist/*
# After validating the test release:
python -m twine upload dist/*
```
