Add libby client library#17
Open
mikelangmayr wants to merge 4 commits into
Open
Conversation
Collaborator
mikelangmayr
commented
Jun 1, 2026
- consolidate config file loading
- extract shared core modules and use them across cli and client lib
- use custom errors
- add documentations
prkrtg
reviewed
Jun 2, 2026
|
|
||
| def config_peer_id(self) -> str: return self.peer_id or self._must("peer_id") | ||
| def config_bind(self) -> str: return self.bind or self._must("bind") | ||
| def config_address_book(self) -> Dict[str, str]: return self.address_book or self._must("address_book") |
Collaborator
There was a problem hiding this comment.
Just saw we define config_address_book twice
| self.topics: Dict[str, EvtHandler] = dict(getattr(type(self), "topics", {})) | ||
|
|
||
| @classmethod | ||
| def from_config(cls, cfg: Dict[str, Any]) -> "LibbyDaemon": |
Collaborator
There was a problem hiding this comment.
Should this also include transport and group id?
|
|
||
| def peer_id(group: str, scope: str) -> str: | ||
| """Map a keyword's group/scope to the daemon peer id.""" | ||
| return f"{group}_{scope}" |
| """ | ||
| if value == "": | ||
| return None | ||
| low = value.strip().lower() |
Collaborator
There was a problem hiding this comment.
Should we start a lookup table for fixed string values as this grows?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.