choicelib - choose requirement from list Simple example: from choicelib import choice_in_order json = choice_in_order(["json", "ujson", "hyperjson", "orjson"]) json # "json" After installing ujson: pip install ujson json # "ujson"