Skip to content

TIL

Three Python libraries for/with a great user experience

I am working on a super-opinionated solution to assume AWS roles via STS, both programmatically and to log into AWS Console. While searching in the Python ecosystem utilities to build CLI and GUI with, I discovered three libraries that offer a great user experience both for the end users and the developers that build with them.

All you need is closure

Decorators are well known examples of Python syntactic sugar, which basically let you change the behaviour of a function without modifying its definition, thanks to a handy syntax based on the @ symbol followed by the decorator name, everything put just above your function definition.

Sometimes, however, you can't exploit this syntax, for example because you don't have the function definition at your disposal - let's think at the case in which the function you want to decorate lives in another codebase (the latter might be one of the libraries your project depends on).

Convert a markdown file to docx with pandoc

Today I rediscover an amazing tool: pandoc, which correctly presents itself as

your swiss-army knife to convert files from one markup format into another.

In these days I am working on the redaction of a complex tender notice, which must be delivered as an editable docx and then exported (with all the fancy stuff and theming) into pdf. Unfortunately, I find the user experience of writing documents with Microsoft Word really unsatisfying and cluttered.

Terminal User Interface

If you have an already up-and-running Typer app, you might want to extend it to some sort of GUI (Graphical User Interface).

While building a full GUI can be time-consuming, there is a really fast utility which can be adopted to get somewhere in between.

AWS CodeBuild local testing

Suppose you have a CodeBuild project triggered by a push on a given branch of a linked CodeCommit repo. If the build is particularly heavy, you might want to ensure its correctness before an actual commit to the related repo - for example, you might be interested in testing the build process specified in buildspec.yml locally.