Getting started as a lib user now works :)

This commit is contained in:
ChillerDragon 2023-03-16 16:56:37 +01:00
parent 24758fbaa9
commit fa0751790e

View file

@ -1,9 +1,16 @@
A teeworlds network protocol library, designed according to sans I/O (http://sans-io.readthedocs.io/) principles
## install
```bash
pip install twnet_parser
```
## sample usage
```python
packet = parse(b'\x04\x0a\x00\xcf\x2e\xde\x1d\04') # 0.7 close
import twnet_parser.packet
packet = twnet_parser.packet.parse(b'\x04\x0a\x00\xcf\x2e\xde\x1d\04') # 0.7 close
print(packet) # => <class: 'TwPacket'>: {'version': '0.7', 'header': <class: 'Header'>, 'messages': [<class: 'CtrlMessage'>]}
print(packet.header) # => <class: 'Header'>: {'flags': <class: 'PacketFlags7, 'size': 0, 'ack': 10, 'token': b'\xcf.\xde\x1d', 'num_chunks': 0}
@ -12,12 +19,6 @@ for msg in packet.messages:
print(msg.name) # => close
```
## install
```bash
pip install twnet_parser
```
## development setup
```bash