Metadata-Version: 2.1
Name: halon-api
Version: 0.0.5
Summary: A wrapper for the REST API of mail transfer agent (MTA) Halon
Home-page: https://github.com/tobiasbp/halon-api
Author: Tobias Balle-Petersen
Author-email: tobiasbp@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Communications :: Email :: Mail Transport Agents
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6.1
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests

# halon-api
A Python wrapper for the API for Mail Transport Agent Halon build with the [requests](https://docs.python-requests.org/) library.
The functions in the wrapper are described in [doc/functions.md](./doc/functions.md)
in the project repository.

Please read [the original documentation](https://docs.halon.io/api) for
complete in depth documentation on function arguments and the data returned by the API.

The wrapper is available as a PyPI package [_halon-api_](https://pypi.org/project/halon-api/).

# Install
Install the PyPI package using _pip_: `pip install halon-api`

# How to use

```
from halon_api import HalonAPI

h = HalonAPI(
    "halon.example.com",
    "halon-user",
    "secret-password",
)

print("Halon software version:", h.get_software_version())
```

If you want to use your own CA (certificate authority), you can set the environment
variable `REQUESTS_CA_BUNDLE` to hold the path to a CA_BUNDLE. You can also pass
the pass the path to the `HalonAPI` object with the argument `verify`.
Read more in the [requests documentation](https://2.python-requests.org/en/master/user/advanced/#ssl-cert-verification).

# Development
How to set up development environment.

## Setup virtual environment
* Make virtual python environment: `python -m venv .venv`
* Activate environment: `source .venv/bin/activate`
* Deactivate virtual environment (When done): `deactivate`

## Install software
* Install required packages: `pip install requirements.txt`
* Install required packages for development: `pip install requirements-dev.txt`
* Use _pre-commit_ to install git hook scripts: `pre-commit install`

## Build the PyPI package
How to build and install the PyPI package locally.
* Build the package: `python -m build`
* Install the package: `pip install dist/halon-api-x.y.z.tar.gz`

## Generate documentation
Automated documentation of API functions can be generated by _pydoc-markdown_.
It will update the file `doc/functions.md`.
* Generate markdown (from repo root): `pydoc-markdown doc/pydoc-markdown.yaml`


