Metadata-Version: 2.1
Name: alertapi
Version: 0.0.1
Summary: The Air Raid Alert API wrapper for Python3
Home-page: https://github.com/CrispCrow/AlertAPI
Author: CrispCrow
Author-email: minikslyh@gmail.com
License: MIT
Project-URL: Source (GitHub), https://github.com/CrispCrow/AlertAPI
Project-URL: Issue Tracker, https://github.com/CrispCrow/AlertAPI/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: attrs (==21.4.0)
Requires-Dist: aiohttp (==3.8.1)

<h1 align="center">AlertAPI</h1>
<p>
Static typed Air Raid Alert API wrapper for Python3.

Python 3.8+ are currently supported.
</p>

## Installation
Install AlertAPI from PyPi with the following command:

```bash
python -m pip install -U alertapi
# Windows users may need to use this instead...
py -3 -m pip install -U alertapi
```

----

## Updating

```bash
pip install --upgrade alertapi
```

----

## Start up client

```py
import asyncio

import aiohttp
import alertapi


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        client = alertapi.Client(session=session, access_token='...')
        print(await client.fetch_states())


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

----

## Example

```py
import asyncio

import aiohttp
import alertapi


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        client = alertapi.Client(session=session, access_token='...')

        print('State list:', await client.fetch_states())
        print('First 5 active alerts:', await client.fetch_states(with_alert=True, limit=5))
        print('Inactive alerts:', await client.fetch_states(with_alert=False))
        print('Kyiv info:', await client.fetch_state(25))
        print('Kyiv info:', await client.fetch_state('Kyiv'))
        print('Is active alert in Lviv oblast:', await client.is_alert('Lviv oblast'))


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

----

## Python optimization flags
CPython provides two optimisation flags that remove internal safety checks that are useful for development, and change other internal settings in the interpreter.

- python main.py - no optimisation - this is the default.
- python -O main.py - first level optimisation - features such as internal
    assertions will be disabled.
- python -OO main.py - second level optimisation - more features (**including
    all docstrings**) will be removed from the loaded code at runtime.

**A minimum of first level of optimizations** is recommended when running applications in a production environment.

