Is there something like OpenAPI (hence an open specification) but instead of targeting HTTP APIs, focusing on software libraries in general?

Context: I'm evaluating documentation engines for Python that support narrative documentation + API reference. We basically have Sphinx (and JupyterBook), MkDocs, and pdoc.

However, what if I want to use modern static site generators like Hugo or Docusaurus, while adding a library reference as well? An API specification would be key here.