Metadata-Version: 2.4
Name: galaxy_beep_frame
Version: 0.1.2
Summary: Interface for BEEP Frame manipulation
Author-email: linarphy <linarphy@linarphy.net>
License-File: LICENSE
Keywords: BEEP
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.14
Requires-Dist: galaxy-graph>=1.1.3
Description-Content-Type: text/markdown

# Galaxy BEEP frame

Build and manage Block Extensible Exchange Protocol (BEEP) Frame.

## Getting started

### Requirements

- Python >= 3.14

### Installation

> [!TIP]
> This library is a core component of `galaxy_beep`, a soon to be developed BEEP
> server. Installing it alone is not intended as it is designed as a dependency.

To install this package in the current python environment, use:
`python -m pip install galaxy_beep_frame`

### Usage

```py
from io import BytesIO

from galaxy_beep_frame.frame import Frame, ContinuationIndicator
from galaxy_beep_frame.header_type import PossibleHeaderType
from galaxy_beep_frame.converter import Lexer, Parser

# emitter
frame = Frame(
    payload=(
        b"Content-Type: application/beep+xml\r\n"
        b"\r\n"
        b"<greeting>\r\n"
        b"   <profile uri='http://iana.org/beep/TLS' />\r\n"
        b"</greeting>\r\n"
    ),
    channel_number=0,
    message_number=0,
    sequence_number=0,
    answer_number=None,
    continuation_indicator=ContinuationIndicator.COMPLETE,
    header_type=PossibleHeaderType.RPY,
)

bus = BytesIO(frame.build())

# client
lexer = Lexer()
frames = Parser.parse(lexer.lex(bus))

if len(frames) > 0:
    greeting_frame = frames[0]
```

> [!CAUTION]
> This library is intended for developer use. It is a component of `galaxy_beep`
> package, not yet developed. It is not intended to use alone.

## Documentation

A complete documentation is available in the
[wiki](https://git.linarphy.net/linarphy/galaxy_beep_frame/wiki).

## Development

### Development Requirements

This project use [mise](https://mise.jdx.dev) to manage development
tools.

> [!TIP]
> If [mise](https://mise.jdx.dev) is installed, and
> [mise.toml](mise.toml) is trusted with `mise trust`, all tools can be
> installed automatically with `mise install``

This project use the following tools:

- [just](https://just.systems): command runner
- [hatch](https://hatch.pypa.io): project manager and package builder
- [uv](https://docs.astral.sh/uv): package installer
- [ruff](https://docs.astral.sh/ruff): python linter and formatter
- [ty](https://docs.astra.sh/ty): python type checker
- [jujutsu](https://jj-vcs.dev): version control

> [!NOTE]
> Tools used in the project consume and produce interoperable format to
> avoid vendor lock-in. This is the toolchain of the current maintener.

### Development Usage

[just](https://just.system) can be used to speed up development for an
identical toolchain.

Before making a commit, `just fix` will run all tests, format the code,
lint and type check. If you don’t want to modify the code, `just check`
will run all tests, lint and type check without any attempt to fix any
issue.

Before a version change, `just release` will push all local commits to
repository and publish the new package version.

All available commands can be listed with `just -l`.

## License

This project is licensed under the GNU GPL v3+.
See [license file](LICENSE) for more information.

## Acknowledgement

Thanks to all the people that worked on the tools used, like python,
neovim and mise.
