From 8e6af58da94f26d81acb7a8757e0d267feaeea23 Mon Sep 17 00:00:00 2001 From: dtomlinson Date: Mon, 13 Jan 2020 22:05:04 +0000 Subject: [PATCH] updating documentation --- docs/source/modules/panaetius.rst | 12 ++++++++++++ src/panaetius/db.py | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/docs/source/modules/panaetius.rst b/docs/source/modules/panaetius.rst index b9db600..c19d7fb 100644 --- a/docs/source/modules/panaetius.rst +++ b/docs/source/modules/panaetius.rst @@ -7,3 +7,15 @@ panaetius :modname:`panaetius` :members: :undoc-members: :show-inheritance: + + +API +--- + +The following is availble by importing the module: + +.. code-block:: python + + import panaetius + +:func:`panaetius.library.set_config` diff --git a/src/panaetius/db.py b/src/panaetius/db.py index e4846a7..198b095 100644 --- a/src/panaetius/db.py +++ b/src/panaetius/db.py @@ -75,10 +75,34 @@ class Mask: @staticmethod def as_string(obj: bytes) -> str: + """Static method to return a string from a bytes object. + + Parameters + ---------- + obj : bytes + Bytes object to be converted to a string. + + Returns + ------- + str + The bytes object as a string. + """ return bytes.hex(obj) @staticmethod def fromhex(obj: str) -> bytes: + """Static method to create a bytes object from a string. + + Parameters + ---------- + obj : str + String object to be converted to bytes. + + Returns + ------- + bytes + The string object as bytes. + """ return bytes.fromhex(obj) @staticmethod