python-opensource is an API Wrapper that allows you to query the Open Source License API with Python.
from opensource import licenses for license in licenses.tagged("copyleft"): print(license.name)
pip install opensource
Python bindings to the Open Source License API