Privex Python Helpers’s documentation

Privex Logo

Welcome to the documentation for Privex’s Python Helpers - a small, open source Python 3 package containing a variety of functions, classes, exceptions, decorators and more - each of which would otherwise be too small to maintain in an individual package.

This documentation is automatically kept up to date by ReadTheDocs, as it is automatically re-built each time a new commit is pushed to the Github Project

Quick install

Installing with Pipenv (recommended)

pipenv install privex-helpers

Installing with standard pip3

pip3 install privex-helpers

Python Module Overview

Privex’s Python Helpers is organised into various sub-modules to make it easier to find the functions/classes you want to use, and to avoid having to load the entire module (though it’s lightweight).

With the exception of privex.helpers.django (Django gets upset if certain django modules are imported before it’s initialised), all functions/classes are imported within the __init__ file, allowing you to simply type:

from privex.helpers import empty, run_sync, asn_to_name

Instead of having to import the functions from each individual module:

from privex.helpers.common import empty
from privex.helpers.asyncx import run_sync
from import asn_to_name

Below is a listing of the sub-modules available in privex-helpers with a short description of what each module contains.


Functions and classes related to working with Python’s native asyncio support


This module contains somewhat risky code that uses app introspection e.g.


Helper functions/classes related to caching.


Common functions and classes that don’t fit into a specific category


Functions, classes and/or types which either are, or are related to Python variable storage types (dict, tuple, list, set etc.)


Various functions/classes which convert/parse objects from one type into another.


Cryptography related helper classes/functions


Class Method / Function decorators


This module file contains Django-specific helper functions, to help save time when developing with the Django framework.


Exception classes used either by our helpers, or just generic exception names which are missing from the standard base exceptions in Python, and are commonly used across our projects.


Various helper functions/classes which depend on a certain package being installed.


Various helper functions for use with Maxmind’s GeoIP2 Library

Network related helper code


This module handles connection objects for databases, APIs etc.


Configuration options for helpers, and services they depend on, such as Redis.


Helpers for, e.g.


Helper functions and classes to ease the use Thread’s with python’s threading library


All Documentation

Code Documentation:

Unit Testing