Skip to content

Commit

Permalink
v1.0.3 | Переименование методов
Browse files Browse the repository at this point in the history
  • Loading branch information
li0ard committed Apr 27, 2024
1 parent 1b12b58 commit 5dccf15
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 52 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,48 +46,6 @@ jobs:
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ pip install nechestniy_znak
from nechestniy_znak import Crpt, Egais

crpt = Crpt()
print(crpt.infoFromEAN13(46494139))
print(crpt.infoFromEAN13("46494139"))
print(crpt.infoFromDataMatrix("00000046209849Uon<TYfACyAJPHJ"))
print(crpt.infoFromQr("chek.markirovka.nalog.ru/kc/?kiz=RU-430302-AAA4050108"))
print(crpt.infoFromReceipt("t=20231203T2319&s=261.80&fn=7281440701309134&i=10027&fp=3516337491&n=1"))

egais = Egais()
print(egais.getInfoByMarkOld("22N00001543ZQO6QFMW37ZK80215021095854A4P1E4IHMW86GT5RTFHN5XXFABT9TZ9", "104-101355000854071217387105240265"))
print(egais.getInfoByMarkNew("171200031066131018001EWB6ECS6IGT6L2OH7XP6QFJMTYQMXCZ5WWVPNDLUU7BCE4FWLCBM7QDHQSESJCTOIXMEAHE2EZLXRZXJJT4UJ4OKEFEIO7RE7J7LQK2ISDFXIA34UAYOZ5ZRYFLTXI4TQ"))
print(egais.getInfoByAlcCode("0150320000003561384"))
print(egais.infoFromOldMark("22N00001543ZQO6QFMW37ZK80215021095854A4P1E4IHMW86GT5RTFHN5XXFABT9TZ9", "104-101355000854071217387105240265"))
print(egais.infoFromNewMark("171200031066131018001EWB6ECS6IGT6L2OH7XP6QFJMTYQMXCZ5WWVPNDLUU7BCE4FWLCBM7QDHQSESJCTOIXMEAHE2EZLXRZXJJT4UJ4OKEFEIO7RE7J7LQK2ISDFXIA34UAYOZ5ZRYFLTXI4TQ"))
print(egais.infoFromAlcCode("0150320000003561384"))
print(egais.getChains("171200031066131018001EWB6ECS6IGT6L2OH7XP6QFJMTYQMXCZ5WWVPNDLUU7BCE4FWLCBM7QDHQSESJCTOIXMEAHE2EZLXRZXJJT4UJ4OKEFEIO7RE7J7LQK2ISDFXIA34UAYOZ5ZRYFLTXI4TQ"))
```
2 changes: 1 addition & 1 deletion src/nechestniy_znak/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .crpt import *
from .egais import *

__version__ = "1.0.2"
__version__ = "1.0.3"
6 changes: 3 additions & 3 deletions src/nechestniy_znak/egais.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ def __init__(self):
def _get(self, url: str, params: str) -> 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]:
def infoFromOldMark(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]:
def infoFromNewMark(self, datamatrix: str) -> Union[list, dict]:
return self._get("marklong", f"Pdf417={datamatrix}")

def getInfoByAlcCode(self, alc_code: str) -> Union[list, dict]:
def infoFromAlcCode(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]:
Expand Down
4 changes: 2 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ def test_crptReceipt():
egais = Egais()

def test_egaisMarkOld():
assert egais.getInfoByMarkOld("22N00001543ZQO6QFMW37ZK80215021095854A4P1E4IHMW86GT5RTFHN5XXFABT9TZ9", "104-101355000854071217387105240265")["success"] == True
assert egais.infoFromOldMark("22N00001543ZQO6QFMW37ZK80215021095854A4P1E4IHMW86GT5RTFHN5XXFABT9TZ9", "104-101355000854071217387105240265")["success"] == True

def test_egaisMarkNew():
assert egais.getInfoByMarkNew("171200031066131018001EWB6ECS6IGT6L2OH7XP6QFJMTYQMXCZ5WWVPNDLUU7BCE4FWLCBM7QDHQSESJCTOIXMEAHE2EZLXRZXJJT4UJ4OKEFEIO7RE7J7LQK2ISDFXIA34UAYOZ5ZRYFLTXI4TQ")["success"] == True
assert egais.infoFromNewMark("171200031066131018001EWB6ECS6IGT6L2OH7XP6QFJMTYQMXCZ5WWVPNDLUU7BCE4FWLCBM7QDHQSESJCTOIXMEAHE2EZLXRZXJJT4UJ4OKEFEIO7RE7J7LQK2ISDFXIA34UAYOZ5ZRYFLTXI4TQ")["success"] == True

def test_egaisChains():
assert egais.getChains("171200031066131018001EWB6ECS6IGT6L2OH7XP6QFJMTYQMXCZ5WWVPNDLUU7BCE4FWLCBM7QDHQSESJCTOIXMEAHE2EZLXRZXJJT4UJ4OKEFEIO7RE7J7LQK2ISDFXIA34UAYOZ5ZRYFLTXI4TQ")["success"] == True

0 comments on commit 5dccf15

Please sign in to comment.