Skip to content

Add a Python API #53

@ssssam

Description

@ssssam

The primary API to Calliope is the commandline interface. It can be called from any programming language in the world and can also be used directly from Bash. Great.

As an optimization we could expose the underlying Python API as well. This is how I imagine it working:

  • each module inside calliope/ contains an api.py file, which defines the public API.
  • the API is documented using docstrings in the api.py files
  • sphinx-autodoc is used to generate reference documentation, and we use the existing CALLIOPE_DOCS_BUILD hook so that we don't require the full set of dependencies when building the docs
  • the cli.py file becomes a wrapper around the api.py files.

The only big downside here is that we'll have mostly duplicate documentation in cli.py and api.py. We may be able to use some clever string substitution to minimize duplication, or we may just have to live with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions