chadc00per-typeset 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chadc00per_typeset/__init__.py +143 -0
- chadc00per_typeset/__init__.pyi +967 -0
- chadc00per_typeset/_data.py +20 -0
- chadc00per_typeset/_lib/__init__.py +1 -0
- chadc00per_typeset/_lib/base64.py +34 -0
- chadc00per_typeset/_lib/calendar.py +33 -0
- chadc00per_typeset/_lib/checksum.py +38 -0
- chadc00per_typeset/_lib/cldr.py +24 -0
- chadc00per_typeset/_lib/code.py +26 -0
- chadc00per_typeset/_lib/currencies.py +17 -0
- chadc00per_typeset/_lib/duration.py +61 -0
- chadc00per_typeset/_lib/errors.py +34 -0
- chadc00per_typeset/_lib/hostname.py +40 -0
- chadc00per_typeset/_lib/instant.py +91 -0
- chadc00per_typeset/_lib/ip.py +40 -0
- chadc00per_typeset/_lib/js.py +235 -0
- chadc00per_typeset/_lib/matrix.py +42 -0
- chadc00per_typeset/_lib/media.py +22 -0
- chadc00per_typeset/_lib/number.py +55 -0
- chadc00per_typeset/_lib/point.py +23 -0
- chadc00per_typeset/_lib/source.py +16 -0
- chadc00per_typeset/_lib/subtitles.py +49 -0
- chadc00per_typeset/_lib/tags.py +44 -0
- chadc00per_typeset/_lib/temperature.py +27 -0
- chadc00per_typeset/_lib/text.py +98 -0
- chadc00per_typeset/_parsers.LICENSES.txt +287 -0
- chadc00per_typeset/_parsers.js +28 -0
- chadc00per_typeset/_registry.py +677 -0
- chadc00per_typeset/_struct.py +134 -0
- chadc00per_typeset/_types/__init__.py +4 -0
- chadc00per_typeset/_types/angle.py +12 -0
- chadc00per_typeset/_types/asin.py +14 -0
- chadc00per_typeset/_types/barcode.py +15 -0
- chadc00per_typeset/_types/base64.py +11 -0
- chadc00per_typeset/_types/base64url.py +11 -0
- chadc00per_typeset/_types/bytes.py +33 -0
- chadc00per_typeset/_types/celsius.py +9 -0
- chadc00per_typeset/_types/color.py +79 -0
- chadc00per_typeset/_types/compassdirection.py +12 -0
- chadc00per_typeset/_types/contenttype.py +38 -0
- chadc00per_typeset/_types/continent.py +18 -0
- chadc00per_typeset/_types/country.py +13 -0
- chadc00per_typeset/_types/cron.py +77 -0
- chadc00per_typeset/_types/css.py +14 -0
- chadc00per_typeset/_types/currency.py +17 -0
- chadc00per_typeset/_types/datetimewindow.py +15 -0
- chadc00per_typeset/_types/day.py +9 -0
- chadc00per_typeset/_types/decimal.py +16 -0
- chadc00per_typeset/_types/domain.py +9 -0
- chadc00per_typeset/_types/email.py +117 -0
- chadc00per_typeset/_types/emoji.py +17 -0
- chadc00per_typeset/_types/etag.py +31 -0
- chadc00per_typeset/_types/expiry.py +42 -0
- chadc00per_typeset/_types/fahrenheit.py +9 -0
- chadc00per_typeset/_types/fiscalperiod.py +22 -0
- chadc00per_typeset/_types/font.py +43 -0
- chadc00per_typeset/_types/fraction.py +8 -0
- chadc00per_typeset/_types/function.py +38 -0
- chadc00per_typeset/_types/geo.py +14 -0
- chadc00per_typeset/_types/geohash.py +14 -0
- chadc00per_typeset/_types/geojson.py +271 -0
- chadc00per_typeset/_types/gtin.py +12 -0
- chadc00per_typeset/_types/hostname.py +9 -0
- chadc00per_typeset/_types/html.py +14 -0
- chadc00per_typeset/_types/imei.py +27 -0
- chadc00per_typeset/_types/int32.py +8 -0
- chadc00per_typeset/_types/integer.py +8 -0
- chadc00per_typeset/_types/interval.py +19 -0
- chadc00per_typeset/_types/ip.py +35 -0
- chadc00per_typeset/_types/ipaddress.py +10 -0
- chadc00per_typeset/_types/iprange.py +52 -0
- chadc00per_typeset/_types/isbn.py +19 -0
- chadc00per_typeset/_types/isoweek.py +26 -0
- chadc00per_typeset/_types/javascript.py +14 -0
- chadc00per_typeset/_types/kelvin.py +9 -0
- chadc00per_typeset/_types/language.py +22 -0
- chadc00per_typeset/_types/locale.py +638 -0
- chadc00per_typeset/_types/matrix.py +8 -0
- chadc00per_typeset/_types/mimetype.py +10 -0
- chadc00per_typeset/_types/money.py +94 -0
- chadc00per_typeset/_types/month.py +11 -0
- chadc00per_typeset/_types/monthday.py +19 -0
- chadc00per_typeset/_types/multiplier.py +12 -0
- chadc00per_typeset/_types/numberrange.py +23 -0
- chadc00per_typeset/_types/percentage.py +12 -0
- chadc00per_typeset/_types/phone.py +57 -0
- chadc00per_typeset/_types/place.py +13 -0
- chadc00per_typeset/_types/pluscode.py +30 -0
- chadc00per_typeset/_types/postalcode.py +18 -0
- chadc00per_typeset/_types/probability.py +8 -0
- chadc00per_typeset/_types/python.py +15 -0
- chadc00per_typeset/_types/ratio.py +28 -0
- chadc00per_typeset/_types/regex.py +239 -0
- chadc00per_typeset/_types/region.py +13 -0
- chadc00per_typeset/_types/resolution.py +23 -0
- chadc00per_typeset/_types/roman.py +14 -0
- chadc00per_typeset/_types/scopes.py +72 -0
- chadc00per_typeset/_types/semver.py +19 -0
- chadc00per_typeset/_types/semverrange.py +56 -0
- chadc00per_typeset/_types/smallint.py +8 -0
- chadc00per_typeset/_types/srt.py +8 -0
- chadc00per_typeset/_types/srtrange.py +8 -0
- chadc00per_typeset/_types/svg.py +14 -0
- chadc00per_typeset/_types/tag.py +8 -0
- chadc00per_typeset/_types/tagset.py +14 -0
- chadc00per_typeset/_types/time.py +17 -0
- chadc00per_typeset/_types/timecode.py +24 -0
- chadc00per_typeset/_types/timeprecision.py +12 -0
- chadc00per_typeset/_types/timezone.py +24 -0
- chadc00per_typeset/_types/transformmatrix.py +8 -0
- chadc00per_typeset/_types/ttl.py +8 -0
- chadc00per_typeset/_types/uint16.py +8 -0
- chadc00per_typeset/_types/uint32.py +8 -0
- chadc00per_typeset/_types/uint8.py +8 -0
- chadc00per_typeset/_types/ulid.py +15 -0
- chadc00per_typeset/_types/upc.py +12 -0
- chadc00per_typeset/_types/uri.py +91 -0
- chadc00per_typeset/_types/url.py +27 -0
- chadc00per_typeset/_types/uuid.py +20 -0
- chadc00per_typeset/_types/vatnumber.py +48 -0
- chadc00per_typeset/_types/vtt.py +8 -0
- chadc00per_typeset/_types/vttrange.py +8 -0
- chadc00per_typeset/_types/weekday.py +11 -0
- chadc00per_typeset/_types/xy.py +8 -0
- chadc00per_typeset/_types/xyz.py +8 -0
- chadc00per_typeset/_types/year.py +18 -0
- chadc00per_typeset/_types/yearmonth.py +17 -0
- chadc00per_typeset/data/UNICODE-LICENSE.txt +41 -0
- chadc00per_typeset/data/catalog.json +2793 -0
- chadc00per_typeset/data/currency.json +1 -0
- chadc00per_typeset/data/emoji.json +1 -0
- chadc00per_typeset/data/geography.json +1 -0
- chadc00per_typeset/data/languages.json +1 -0
- chadc00per_typeset/data/locales.json +1 -0
- chadc00per_typeset/data/timezones.json +1 -0
- chadc00per_typeset/data/tlds.json +1 -0
- chadc00per_typeset/py.typed +0 -0
- chadc00per_typeset-1.0.0.dist-info/METADATA +76 -0
- chadc00per_typeset-1.0.0.dist-info/RECORD +145 -0
- chadc00per_typeset-1.0.0.dist-info/WHEEL +4 -0
- chadc00per_typeset-1.0.0.dist-info/licenses/LICENSE +202 -0
- chadc00per_typeset-1.0.0.dist-info/licenses/NOTICE +14 -0
- chadc00per_typeset-1.0.0.dist-info/licenses/THIRD-PARTY-NOTICES.md +102 -0
- chadc00per_typeset-1.0.0.dist-info/licenses/data/UNICODE-LICENSE.txt +41 -0
- chadc00per_typeset-1.0.0.dist-info/licenses/python/chadc00per_typeset/_parsers.LICENSES.txt +287 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"""Semantic field types: canonical normalize/validate, a class per type, and
|
|
2
|
+
picker metadata. The Python twin of the @chadc00per/typeset npm package: the
|
|
3
|
+
same types, the same canonical values and the same refusal messages, checked
|
|
4
|
+
against the shared conformance vectors in conformance/.
|
|
5
|
+
|
|
6
|
+
>>> from chadc00per_typeset import Email, Phone, Currency
|
|
7
|
+
>>> Email(' Ada@Example.COM ')
|
|
8
|
+
Email('ada@example.com')
|
|
9
|
+
>>> Phone.normalize('(212) 555-0123')
|
|
10
|
+
'+12125550123'
|
|
11
|
+
>>> Currency.is_('XYZ')
|
|
12
|
+
False
|
|
13
|
+
"""
|
|
14
|
+
from ._registry import FrozenDict, Value, extend, type_of, types
|
|
15
|
+
from ._lib.errors import ValidationError
|
|
16
|
+
from ._struct import Struct, struct
|
|
17
|
+
|
|
18
|
+
__version__ = '1.0.0'
|
|
19
|
+
|
|
20
|
+
names = types.names
|
|
21
|
+
# ``all`` mirrors the JavaScript export; import it as ``chadc00per_typeset.all`` (it is
|
|
22
|
+
# left out of __all__ so ``from chadc00per_typeset import *`` never shadows the builtin).
|
|
23
|
+
all = types.all
|
|
24
|
+
aliases = types.aliases
|
|
25
|
+
get = types.get
|
|
26
|
+
describe = types.describe
|
|
27
|
+
to_json_schema = types.to_json_schema
|
|
28
|
+
|
|
29
|
+
# Kept by hand, like js/src/index.js; python/tests/test_registry.py checks it
|
|
30
|
+
# against the catalog.
|
|
31
|
+
Email = types.get('email')
|
|
32
|
+
Phone = types.get('phone')
|
|
33
|
+
Url = types.get('url')
|
|
34
|
+
Uri = types.get('uri')
|
|
35
|
+
Domain = types.get('domain')
|
|
36
|
+
Hostname = types.get('hostname')
|
|
37
|
+
Ip = types.get('ip')
|
|
38
|
+
IpAddress = types.get('ipaddress')
|
|
39
|
+
IpRange = types.get('iprange')
|
|
40
|
+
MimeType = types.get('mimetype')
|
|
41
|
+
ContentType = types.get('contenttype')
|
|
42
|
+
Place = types.get('place')
|
|
43
|
+
PostalCode = types.get('postalcode')
|
|
44
|
+
Language = types.get('language')
|
|
45
|
+
Country = types.get('country')
|
|
46
|
+
Region = types.get('region')
|
|
47
|
+
Locale = types.get('locale')
|
|
48
|
+
Continent = types.get('continent')
|
|
49
|
+
Ratio = types.get('ratio')
|
|
50
|
+
TimeZone = types.get('timezone')
|
|
51
|
+
Weekday = types.get('weekday')
|
|
52
|
+
Month = types.get('month')
|
|
53
|
+
Roman = types.get('roman')
|
|
54
|
+
Barcode = types.get('barcode')
|
|
55
|
+
Isbn = types.get('isbn')
|
|
56
|
+
Upc = types.get('upc')
|
|
57
|
+
Gtin = types.get('gtin')
|
|
58
|
+
Asin = types.get('asin')
|
|
59
|
+
Imei = types.get('imei')
|
|
60
|
+
VatNumber = types.get('vatnumber')
|
|
61
|
+
Integer = types.get('integer')
|
|
62
|
+
Int32 = types.get('int32')
|
|
63
|
+
SmallInt = types.get('smallint')
|
|
64
|
+
UInt8 = types.get('uint8')
|
|
65
|
+
UInt16 = types.get('uint16')
|
|
66
|
+
UInt32 = types.get('uint32')
|
|
67
|
+
Decimal = types.get('decimal')
|
|
68
|
+
Percentage = types.get('percentage')
|
|
69
|
+
Fraction = types.get('fraction')
|
|
70
|
+
Angle = types.get('angle')
|
|
71
|
+
Probability = types.get('probability')
|
|
72
|
+
Multiplier = types.get('multiplier')
|
|
73
|
+
DateTimeWindow = types.get('datetimewindow')
|
|
74
|
+
Expiry = types.get('expiry')
|
|
75
|
+
Ttl = types.get('ttl')
|
|
76
|
+
Bytes = types.get('bytes')
|
|
77
|
+
Interval = types.get('interval')
|
|
78
|
+
Day = types.get('day')
|
|
79
|
+
Time = types.get('time')
|
|
80
|
+
Year = types.get('year')
|
|
81
|
+
YearMonth = types.get('yearmonth')
|
|
82
|
+
IsoWeek = types.get('isoweek')
|
|
83
|
+
MonthDay = types.get('monthday')
|
|
84
|
+
Resolution = types.get('resolution')
|
|
85
|
+
NumberRange = types.get('numberrange')
|
|
86
|
+
Vtt = types.get('vtt')
|
|
87
|
+
VttRange = types.get('vttrange')
|
|
88
|
+
Srt = types.get('srt')
|
|
89
|
+
SrtRange = types.get('srtrange')
|
|
90
|
+
Timecode = types.get('timecode')
|
|
91
|
+
TimePrecision = types.get('timeprecision')
|
|
92
|
+
CompassDirection = types.get('compassdirection')
|
|
93
|
+
Semver = types.get('semver')
|
|
94
|
+
SemverRange = types.get('semverrange')
|
|
95
|
+
Etag = types.get('etag')
|
|
96
|
+
Celsius = types.get('celsius')
|
|
97
|
+
Fahrenheit = types.get('fahrenheit')
|
|
98
|
+
Kelvin = types.get('kelvin')
|
|
99
|
+
Matrix = types.get('matrix')
|
|
100
|
+
TransformMatrix = types.get('transformmatrix')
|
|
101
|
+
Cron = types.get('cron')
|
|
102
|
+
FiscalPeriod = types.get('fiscalperiod')
|
|
103
|
+
Color = types.get('color')
|
|
104
|
+
Emoji = types.get('emoji')
|
|
105
|
+
Font = types.get('font')
|
|
106
|
+
Base64 = types.get('base64')
|
|
107
|
+
Base64Url = types.get('base64url')
|
|
108
|
+
Uuid = types.get('uuid')
|
|
109
|
+
Ulid = types.get('ulid')
|
|
110
|
+
Regex = types.get('regex')
|
|
111
|
+
Fn = types.get('function')
|
|
112
|
+
JavaScript = types.get('javascript')
|
|
113
|
+
Python = types.get('python')
|
|
114
|
+
Html = types.get('html')
|
|
115
|
+
Css = types.get('css')
|
|
116
|
+
Svg = types.get('svg')
|
|
117
|
+
Tag = types.get('tag')
|
|
118
|
+
TagSet = types.get('tagset')
|
|
119
|
+
Scopes = types.get('scopes')
|
|
120
|
+
Currency = types.get('currency')
|
|
121
|
+
Money = types.get('money')
|
|
122
|
+
Geo = types.get('geo')
|
|
123
|
+
Geohash = types.get('geohash')
|
|
124
|
+
PlusCode = types.get('pluscode')
|
|
125
|
+
GeoJson = types.get('geojson')
|
|
126
|
+
XY = types.get('xy')
|
|
127
|
+
XYZ = types.get('xyz')
|
|
128
|
+
|
|
129
|
+
__all__ = [
|
|
130
|
+
'ValidationError', 'FrozenDict', 'Value', 'Struct', 'struct', 'names', 'get', 'describe', 'aliases', 'extend',
|
|
131
|
+
'to_json_schema', 'type_of', 'types', 'Email', 'Phone', 'Url', 'Uri', 'Domain', 'Hostname', 'Ip', 'IpAddress',
|
|
132
|
+
'IpRange', 'MimeType', 'ContentType', 'Place', 'PostalCode', 'Language', 'Country',
|
|
133
|
+
'Region', 'Locale', 'Continent', 'Ratio', 'TimeZone', 'Weekday', 'Month', 'Roman',
|
|
134
|
+
'Barcode', 'Isbn', 'Upc', 'Gtin', 'Asin', 'Imei', 'VatNumber', 'Integer', 'Int32',
|
|
135
|
+
'SmallInt', 'UInt8', 'UInt16', 'UInt32', 'Decimal', 'Percentage', 'Fraction', 'Angle',
|
|
136
|
+
'Probability', 'Multiplier', 'DateTimeWindow', 'Expiry', 'Ttl', 'Bytes', 'Interval', 'Day',
|
|
137
|
+
'Time', 'Year', 'YearMonth', 'IsoWeek', 'MonthDay', 'Resolution', 'NumberRange', 'Vtt',
|
|
138
|
+
'VttRange', 'Srt', 'SrtRange', 'Timecode', 'TimePrecision', 'CompassDirection', 'Semver',
|
|
139
|
+
'SemverRange', 'Etag', 'Celsius', 'Fahrenheit', 'Kelvin', 'Matrix', 'TransformMatrix',
|
|
140
|
+
'Cron', 'FiscalPeriod', 'Color', 'Emoji', 'Font', 'Base64', 'Base64Url', 'Uuid', 'Ulid',
|
|
141
|
+
'Regex', 'Fn', 'JavaScript', 'Python', 'Html', 'Css', 'Svg', 'Tag', 'TagSet', 'Scopes', 'Currency', 'Money', 'Geo', 'Geohash', 'PlusCode',
|
|
142
|
+
'GeoJson', 'XY', 'XYZ'
|
|
143
|
+
]
|