tira-io / tira

The source code for the TIRA Shared Task Platform
https://www.tira.io/
MIT License
13 stars 9 forks source link

Separate private and public API in the package structure #645

Open TheMrSheldon opened 1 month ago

TheMrSheldon commented 1 month ago

This PR aims to better distinguish between the private and public API and properly hide implementation details.

Previously, the TiraClient abstract base class was only used for type hinting. With this change, the user only sees the methods RestClient(...) -> TiraClient and LocalClient(...) -> TiraClient instead of the concrete implementations to reduce cognitive load. This is a breaking API change since the imports must be updated to:

from tira.tira_client import RestClient, LocalClient

instead of

from tira.rest_api_client import Client as RestClient
from tira.local_client import Client as LocalClient

The new "private" submodule tira._internal can also be used for further implementation-details that should not be part of the public API (e.g., some of the utilities @mam10eks?).