build status
coverage status

brennivin

Brennivin is a series of utility libraries that were developed while working on EVE Online, by CCP Games. It includes all sorts of generally useful Python functionality that is useful in almost any domain. Rather than reinvent the wheel, or look all over the place for the right screw driver, Brennivin was created to have a single well tested and documented place for utilities.

This is an Open Source fork of that internal code. Less useful or Windows-specific portions have been stripped, and may be added as companion packages in the future.

Anyway, there’s no sort of framework here, just cohesive modules that will save you some work. Hopefully Brennivin has what you need.

logo

Brennivin’s modules

Brennivin includes a number of useful utility modules that augment the Python libraries with similar names. Others are just plain handy. Here’s a rundown of what’s included:

  • brennivin.dochelpers provides functions for creating prettier documentation,
  • brennivin.ioutils provides retry and timeout decorators,
  • brennivin.itertoolsext provides functions for working with iterables, like first, last, and all sorts of other useful things (it’s probably the most useful module in here).
  • brennivin.logutils has helpful formatters, and functions for working with and cleaning up timestamped log files,
  • brennivin.nicenum provides pretty number and memory formatting,
  • brennivin.osutils has functions that should be on os and os.path in the first place, such as a recursive file lister, and context manager to change the cwd, and more.
  • brennivin.platformutils has a few functions to tell you about the process and OS/hardware,
  • brennivin.preferences provides an object that will serialize preferences,
  • brennivin.pyobjcomparer allows the comparison of complex Python objects, such as when you need to compare floats with a tolerance, but those floats are in deeply nested data structures,
  • brennivin.testhelpers has gobs of useful assertion methods (numbers, sequences, folders, files), and other nice helpers,
  • brennivin.threadutils has a not-crap Thread class that can raise exceptions instead of swalling them, a restartable timer, and mechanisms for communication such as tokens and signals.
  • brennivin.traceback2 is like the traceback module but will include locals, and has more controls for formatting,
  • brennivin.yamlext contains some helpers for simplifying yaml reading/writing,
  • and brennivin.zipfileutils has useful functions for creating zip files that you wish were on the zipfile module.

There’s a lot more useful functionality in each of these modules than what’s listed above, so check them out!

And in a neater form:

About the name

You can learn about the Icelandic schnapps called “brennivin” on Wikipedia. It literally translates to “burnt wine.”

The reason for this library’s name is that CCP developed an Open Source framework named sake while working on Dust514 (the game was primarily developed in China). As EVE was developed in Iceland (remember brennivin is mostly utilities harvested from EVE), I thought “brennivin” was a fitting name for this library.

Indices and tables