-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented writing XML files with most profiles
This is currently missing support for a few fields and is completely untested.
- Loading branch information
Showing
8 changed files
with
1,664 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
""" | ||
XML Utilities for PyFactur-X | ||
""" | ||
|
||
URN_MINIMUM_PROFILE = "urn:factur-x.eu:1p0:minimum" | ||
URN_BASIC_WL_PROFILE = "urn:factur-x.eu:1p0:basicwl" | ||
URN_BASIC_PROFILE = ( | ||
"urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic" | ||
) | ||
URN_EN16931_PROFILE = "urn:cen.eu:en16931:2017" | ||
URN_EXTENDED_PROFILE = ( | ||
"urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended" | ||
) | ||
URN_XRECHNUNG_PROFILE = "urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.1" # noqa: E501 | ||
|
||
NS_CII = "urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" | ||
NS_RAM = "urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" # noqa: E501 | ||
NS_UDT = "urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import re | ||
|
||
|
||
def validate_iso_3166_1_alpha_2(code: str) -> bool: | ||
"""Validate an ISO 3166-1 country code in ALPHA-2 format.""" | ||
return re.match(r"^[A-Z]{2}$", code) is not None |
Oops, something went wrong.