~kf5jwc/sms-printer

ref: 001bc477efa7f19caabd0709e22738bcb00bb077 sms-printer/sms_printer/parsers/README -rw-r--r-- 751 bytes View raw
001bc477 — Kyle Jones Create a namespace for parsers 1 year, 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
This is a namespace for providing parsers.

Adding a new parser is done by creating a new package within this namespace.

Each package is expected to have a a `validate` and a `parse` function.

```validate(data: str) -> bool```

`validate` is expected to parse and validate `data` using whichever format your parser is compatible with.


```parse(data: str) -> List[Message]```

`parse` is expected to accept the same `data`, parse it, and provide a list of messages with a `Message` specific interface.


```
Message:
    sender: str
    text: str
```

The `Message` interface must simply provide for access to information.
They currently only provide a list of messages with the sender number and message text.

- `message.sender`
- `message.text`