File: README.md

package info (click to toggle)
pynina 1.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 756 kB
  • sloc: python: 761; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 524 bytes parent folder | download
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
28
29
# Nina-API
A Python API wrapper to retrieve warnings from the german NINA app.

## How to use package

```python
import asyncio

from pynina import Nina, ApiError


async def main():
    try:
        n: Nina = Nina()
        n.add_region("146270000000")
        await n.update()

        for i in n.warnings["146270000000"]:
            print(i)
            print(i.is_valid())

    except ApiError as error:
        print(f"Error: {error}")


loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
```