Skip to content

Commit

Permalink
Add sepaxml stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
FestplattenSchnitzel committed Mar 15, 2024
1 parent 9eb88cf commit b40b759
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions stubs/sepaxml/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .debit import SepaDD as SepaDD
from .transfer import SepaTransfer as SepaTransfer

version: str
9 changes: 9 additions & 0 deletions stubs/sepaxml/debit.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from .shared import SepaPaymentInitn as SepaPaymentInitn
from .utils import ADDRESS_MAPPING as ADDRESS_MAPPING, int_to_decimal_str as int_to_decimal_str, make_id as make_id

class SepaDD(SepaPaymentInitn):
root_el: str
def __init__(self, config, schema: str = 'pain.008.003.02', clean: bool = True) -> None: ...
def check_config(self, config): ...
def check_payment(self, payment): ...
def add_payment(self, payment) -> None: ...
10 changes: 10 additions & 0 deletions stubs/sepaxml/shared.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from .utils import decimal_str_to_int as decimal_str_to_int, int_to_decimal_str as int_to_decimal_str, make_msg_id as make_msg_id
from .validation import try_valid_xml as try_valid_xml
from _typeshed import Incomplete

class SepaPaymentInitn:
schema: Incomplete
msg_id: Incomplete
clean: Incomplete
def __init__(self, config, schema, clean: bool = True) -> None: ...
def export(self, validate: bool = True, pretty_print: bool = False) -> bytes: ...
9 changes: 9 additions & 0 deletions stubs/sepaxml/transfer.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from .shared import SepaPaymentInitn as SepaPaymentInitn
from .utils import ADDRESS_MAPPING as ADDRESS_MAPPING, int_to_decimal_str as int_to_decimal_str, make_id as make_id

class SepaTransfer(SepaPaymentInitn):
root_el: str
def __init__(self, config, schema: str = 'pain.001.001.03', clean: bool = True) -> None: ...
def check_config(self, config): ...
def check_payment(self, payment): ...
def add_payment(self, payment) -> None: ...
11 changes: 11 additions & 0 deletions stubs/sepaxml/utils.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from _typeshed import Incomplete

using_sysrandom: bool

def get_rand_string(length: int = 12, allowed_chars: str = '0123456789abcdef'): ...
def make_msg_id(): ...
def make_id(name): ...
def int_to_decimal_str(integer): ...
def decimal_str_to_int(decimal_string): ...

ADDRESS_MAPPING: Incomplete
3 changes: 3 additions & 0 deletions stubs/sepaxml/validation.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class ValidationError(Exception): ...

def try_valid_xml(xmlout, schema) -> None: ...

0 comments on commit b40b759

Please sign in to comment.