5 Upcoming Python Open Source Libraries Q1 2020 Edition

Neeran Gul
4 min readMar 22, 2020
Image by Free-Photos from Pixabay

The world is in the midst of the coronavirus pandemic but the spark that allows humans to innovate never stops. We have the ability to adapt to our surroundings and produce inventions to fight anything that stands in our way. Welcome to the Q1 2020 Edition of Python Upcoming Open Source Libraries. The focus here is specifically on libraries that are not fully mature yet and to encourage readers to contribute to them. I highly encourage readers to support the authors in anyway they can whether it is donating, extending functionality or simply using them. Let’s get started.

1. PresidioPY

Microsoft Presidio is an anonymization service for text and images. PresidioPY is a wrapper around the Presidio API that allows you to make API calls and generate results using Python. This service can be used to anonymise documents before they are sent to stakeholders and great for anonymising data for machines learning purposes.

from presidiopy import PresidioPyapi = PresidioPy("127.0.0.1", "presidiopy")output = api.analyze('text', template = 'template_id')

Check it out here: https://github.com/querylayer/presidiopy

2. timetester

Ever wanted to find out the average time of a method or function? timetester takes a method or function and runs tests to find out and graph the times for you. This is great for spotting regressions before they make it to production and a perfect place to put this step is in a CI build or as an automated report.

import timetester

def foo(arg):
print(arg)
pass

k = timetester.timeTester(foo)
# NOT NECESSARY. Only use if you encountered an error and reloaded the object
k.initialise()
# Run tests
k.runtests(*args,**kwargs)
# Graph the average time taken
k.graph()
# Print a report of how the function did
k.report()

Check it out here: https://github.com/feimaomiao/timetester

3. vault-aws-login

Vault by HashiCorp is a great tool for storing secrets, passwords and sensitive data. AWS CLI is the non-GUI alternative for humans and machines to carry out operations on various AWS services. If you have a scenario where you generate temporary credentials or have your credentials stored in Vault then vault-aws-login will authenticate a user on the AWS CLI by pulling the credentials from Vault. This is meant to run as a background daemon to keep the user authenticated. Requires consul-template.

# create or update ~/.vault-aws/config with the below:[default]
vault_addr = https://vault.engineering.armory.io
# (overrides your current VAULT_ADDR env var.)
# (leave it empty if you dont want such thing to happen)
vault_login_method = <your auth type to vault>
# Type of authentication to use such as "userpass" or "ldap". Note this
# corresponds to the TYPE, not the enabled path. Use -path to specify the
# path where the authentication is enabled. The default is token.
# (leave it empty if you dont want this parameter)
# (use extra_vl_flags = ["-path", "/your/path"] fort the given example above)
vault_login_username = <your vault username>
# The -method flag allows using other auth methods, such as userpass, github, or
# cert. For these, additional "K=V" pairs may be required. For example, to
# authenticate to the userpass auth method:
# $ vault login -method=userpass username=my-username
# (vault_login_<K> = <V> is also valid for K=V pairs other than username)
Then run:vault-aws-login -l dev &

Check it out here: https://github.com/feimaomiao/timetester

4. YouConfigMe

Configuration files are great for creating applications that can be deployed to different environments and support turning functionality on or off. Loading configurations can very often require extra bootstrapping code. YouConfigMe is a great way to abstract way that functionality and load code in configurable objects.

# sample .ini file
[a]
key1=1
key2=2

[b]
key3=3
key4=4
# load the file and values
from youconfigme import AutoConfig, ConfigItemNotFound
import os

os.environ["A_KEY4"] = "key4value"
config = AutoConfig()

print(config.a.key1(cast=int)) # returns 1
print(config.a.key2()) # returns '2'
print(config.a.key3()) # raises ConfigItemNotFound
print(config.a.key3(default='key3value')) # return 'key3value'
print(config.a.key4()) # returns 'key4value'

Check it out here: https://github.com/crossnox/YouConfigMe

5. terminus-client-python

TerminusDB is an open source model driven graph database for knowledge graph representation designed specifically for the web-age using JSON-LD. Knowledge graphs play a large part in AI and scientific discoveries and JSON-LD helps to connect payloads in JSON format. Terminus server now has a powerful Python client to give power to automate batch jobs and extract report data, the sky’s the limit.

>>> woql.WOQLClient().connect(serverUrl, key)
>>> woql.WOQLClient(server=”http://localhost:6363”).createDatabase(“someDB”, “Database Label”, “password”)

Check it out here: https://github.com/terminusdb/terminus-client-python

Wrapping up

Thank you for reading through the list. I will be planning on posting at least 5 upcoming libraries every quarter. If you are working on a new library for Python (or any other programming language) please reach out and I will add it to the next edition or feel free to reach out and have your story added to the Upcoming Open Source Publication.

Checkout out Q4 2019 Edition here.

--

--

Neeran Gul

Industry veteran providing strong mentorship and sharing experiences.