updating documentation

This commit is contained in:
2020-01-13 22:05:04 +00:00
parent 030405434d
commit 8e6af58da9
2 changed files with 36 additions and 0 deletions

View File

@@ -7,3 +7,15 @@ panaetius :modname:`panaetius`
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
API
---
The following is availble by importing the module:
.. code-block:: python
import panaetius
:func:`panaetius.library.set_config`

View File

@@ -75,10 +75,34 @@ class Mask:
@staticmethod @staticmethod
def as_string(obj: bytes) -> str: 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) return bytes.hex(obj)
@staticmethod @staticmethod
def fromhex(obj: str) -> bytes: 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) return bytes.fromhex(obj)
@staticmethod @staticmethod