Anentropic

Projects on GitHub


(for Depop) github.com/depop/popget

popget

A simple no-bells-and-whistles REST-API client, optionally supporting async requests.

We use this at Depop for service-to-service calls in our heterogenous microservices environment.

Tested against Python 2.7 & 3.6, source is fully type-hinted and statically checked by mypy.

(for Depop) github.com/depop/python-automock

automock

Say you have API clients for various microservices which are used in many places throughout your project. These calls need to be mocked in unit tests, so you're going to end up with a big 'stack' of patch decorators on many tests.

Enter automock - basically we want some functions to be flexibly 'mocked by default' when running tests.

Tested against Python 2.7 & 3.6, source is fully type-hinted and statically checked by mypy.

(for Depop) github.com/depop/celery-message-consumer

celery-message-consumer

Tool for using the bin/celery worker to consume vanilla AMQP messages (i.e. not Celery tasks). We chose to re-use this battle-tested consumer rather than write one from scratch.

Used at Depop for event-driven messaging in our heterogenous microservices environment.

Tested against Python 2.7 & 3.6, source is fully type-hinted and statically checked by mypy.

(for Depop) github.com/depop/python-flexisettings

flexisettings

Partly inspired by Django's from django.conf import settings settings object.

The goal is to allow shared libraries to be configured by a settings file in the project which imports them (like how Django libraries can expect the Django settings object to exist).

Tested against Python 2.7 & 3.6, source is fully type-hinted and statically checked by mypy.

(used by popget, automock and celery-message-consumer)

(for Depop) github.com/depop/django-concurrent-test-helper

django-concurrent-test-helper

Helpers for executing Django app code concurrently within Django tests.

If you're using SQLite in your tests then this workaround is not needed. But at Depop we have a suite of integration tests running against Postgres and Mongo Docker containers, like in the production environment. This utility has helped us to reproduce various race conditions and confirm when successfully fixed.

Tested against Python 2 & 3 and a wide range of Django versions.

django-conditional-aggregates

Django aggregate functions which operate conditionally (i.e. generate SQL CASE statements) ...useful when combining aggregate functions with a GROUP BY clause. eg ConditionalSum.

For Django 1.5/1.6 only.
(From Django 1.8 onwards this feature is now provided by the Django ORM)

django-cas-cache

Django cache backends supporting CAS (compare-and-set) operation. Memcache, Redis and Dummy backends. CAS allows updating a value without risk of race condition bugs.

factoryboy-gaendb

Factoryboy base factories and helpers for Google App Engine ndb models. To help with unit testing projects using App Engine datastore.

django-exclusivebooleanfield

Provides an ExclusiveBooleanField which is a boolean (database) field where only one row in the table (or optionally, a subset of rows based on value of other fields) is True and all the other rows are False.

dirtyebay

An eBay API client which respects XSD schema and talks SOAP, but doesn't use Suds. With a clean and simple interface and low memory usage (unlike Suds+WSDL...).

django-tempocal

An extension of the Python stdlib's calendar.HTMLCalendar that makes use of Django templates to customise the output. After all, it's pretty lame having hard-coded HTML output.