postal-admin-client
A python 3.5+ admin client for the open source mail delivery platform postal.
This package is only for postal administrators and do not include support for the message and send API.
Postal currently don't have a proper HTTP API for administation so we rely on faking a brower filling forms and dealing with csrf tokens to make rails happy.
This can for example be used to manage and create new organizations.
This package can be installed from PyPI
pip install postal-admin-client
Example
Initalize client
>> import postal_admin_client
>>
>> client = postal_admin_client.Client(
>> 'https://postal.example.com',
>> email='user@example.com',
>> password='myhopefullysecurepassword',
>> )
List/create/delete organization
>> client.list_organizations()
[{'name': 'Anansi Technologies', 'shortname': 'at'},
{'name': 'Council of Venice', 'shortname': 'cov'},
{'name': 'Orochi Group', 'shortname': 'og'}]
>> client.create_organization('Illuminati')
{'name': 'Illuminati', 'shortname': 'il'}
>> client.delete_organization('li')
List and create/invite users
>> client.list_users()
[{'name': 'Kirsten Geary', 'email': 'kirsten.geary@illuminati.test'},
{'name': 'Alex McCall', 'email': 'alex.mccall@illuminati.test'}]
>> client.create_user('il', 'nadia.shestova@illuminati.test', admin=False)
Supported Operations
- List organizations
- Create organization
- Delete organization
- List users in organization
- Invite user to organization
Dev Setup
Basic Setup
python -m virtualenv .venv
. .venv/bin/activate
python setup.py develop
Tests
pip install -r tests/requirements.txt
tox
Improvements
- Properly parse out validation errors. For example:
create_userraisesHTTPError(422)in three different cases and it would be useful for the user to easily be able to separate between them. - Add CLI support
- Support more operations
Logging
This package is using logging. You can configure logging behaviour
(handler, log level, propagation etc) by obtaining the logger for this package.
logger = logging.getLogger('postal_admin_client')
Contributing
Do not hesistate creating pull requests with completed or partial work or create issues. There are very likely many things to improve.
Metadata
Release files for postal-admin-client 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| postal_admin_client-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for postal_admin_client-0.1.1-py3-none-any.whl |
Release files / postal_admin_client-0.1.1-py3-none-any.whl
| Download URL | postal_admin_client-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04cab1d84f054c1886773310a71b2199f65b4681517e94f3500af1a7b653398d
|
|
BLAKE2b-256 checksum How to use checksums |
2b54d2e9e5f93bf194a25841abb0535ffa0ed40da43f30f33d97f18324701dec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Security for postal-admin-client 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.