diff --git a/README.md b/README.md index 5b057cf..7293505 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,34 @@ - +

+ +

+

+    +

-[Github](https://github.com/li0ard/nechestniy_znak) +Библеотека обертка для API ГИС МТ "Честный Знак" и API ЕГАИС + +[Документация](https://li0ard.gitbook.io/nechestniy_znak/) -Библеотека обертка для API ГИС МТ "Честный Знак" ### Установка + +**Требуется Python версии 3.8 или выше** ``` pip install nechestniy_znak ``` ### Пример ```py -from nechestniy_znak import Lib +from nechestniy_znak import Crpt, Egais + +crpt = Crpt() +print(crpt.infoFromEAN13(46494139)) +print(crpt.infoFromDataMatrix("00000046209849Uon Union[list, dict]: + return requests.get(f"http://mobapi.fsrar.ru/api3/{url}?{params}", verify=False).json() + + def getInfoByMarkOld(self, pdf417: str, datamatrix: str) -> Union[list, dict]: + return self._get("mark", f"DataMatrix={datamatrix}&Pdf417={pdf417}") + + def getInfoByMarkNew(self, datamatrix: str) -> Union[list, dict]: + return self._get("marklong", f"Pdf417={datamatrix}") + + def getInfoByAlcCode(self, alc_code: str) -> Union[list, dict]: + return self._get("product_info", f"alc_code={alc_code}") + + def getChains(self, datamatrix: str) -> Union[list, dict]: + return self._get("chain", f"barcode={datamatrix}") \ No newline at end of file diff --git a/test.py b/test.py index 59e1002..953a4b7 100644 --- a/test.py +++ b/test.py @@ -1,7 +1,27 @@ -from nechestniy_znak import Lib +import pytest +from src.nechestniy_znak import Crpt, Egais -lib = Lib() -print(lib.infoFromEAN13(46494139)) -print(lib.infoFromDataMatrix("00000046209849Uon