Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

Python admin client for the open source mail delivery platform Postal

Project description

pypi travis


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


Initalize client

>> import postal_admin_client
>> client = postal_admin_client.Client(
>>     '',
>>     email='',
>>     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 develop


pip install -r tests/requirements.txt


  • Properly parse out validation errors. For example: create_user raises HTTPError(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


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')


Do not hesistate creating pull requests with completed or partial work or create issues. There are very likely many things to improve.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for postal-admin-client, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size postal_admin_client-0.1.1-py3-none-any.whl (7.3 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page