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.
Files changed (145) hide show
  1. chadc00per_typeset/__init__.py +143 -0
  2. chadc00per_typeset/__init__.pyi +967 -0
  3. chadc00per_typeset/_data.py +20 -0
  4. chadc00per_typeset/_lib/__init__.py +1 -0
  5. chadc00per_typeset/_lib/base64.py +34 -0
  6. chadc00per_typeset/_lib/calendar.py +33 -0
  7. chadc00per_typeset/_lib/checksum.py +38 -0
  8. chadc00per_typeset/_lib/cldr.py +24 -0
  9. chadc00per_typeset/_lib/code.py +26 -0
  10. chadc00per_typeset/_lib/currencies.py +17 -0
  11. chadc00per_typeset/_lib/duration.py +61 -0
  12. chadc00per_typeset/_lib/errors.py +34 -0
  13. chadc00per_typeset/_lib/hostname.py +40 -0
  14. chadc00per_typeset/_lib/instant.py +91 -0
  15. chadc00per_typeset/_lib/ip.py +40 -0
  16. chadc00per_typeset/_lib/js.py +235 -0
  17. chadc00per_typeset/_lib/matrix.py +42 -0
  18. chadc00per_typeset/_lib/media.py +22 -0
  19. chadc00per_typeset/_lib/number.py +55 -0
  20. chadc00per_typeset/_lib/point.py +23 -0
  21. chadc00per_typeset/_lib/source.py +16 -0
  22. chadc00per_typeset/_lib/subtitles.py +49 -0
  23. chadc00per_typeset/_lib/tags.py +44 -0
  24. chadc00per_typeset/_lib/temperature.py +27 -0
  25. chadc00per_typeset/_lib/text.py +98 -0
  26. chadc00per_typeset/_parsers.LICENSES.txt +287 -0
  27. chadc00per_typeset/_parsers.js +28 -0
  28. chadc00per_typeset/_registry.py +677 -0
  29. chadc00per_typeset/_struct.py +134 -0
  30. chadc00per_typeset/_types/__init__.py +4 -0
  31. chadc00per_typeset/_types/angle.py +12 -0
  32. chadc00per_typeset/_types/asin.py +14 -0
  33. chadc00per_typeset/_types/barcode.py +15 -0
  34. chadc00per_typeset/_types/base64.py +11 -0
  35. chadc00per_typeset/_types/base64url.py +11 -0
  36. chadc00per_typeset/_types/bytes.py +33 -0
  37. chadc00per_typeset/_types/celsius.py +9 -0
  38. chadc00per_typeset/_types/color.py +79 -0
  39. chadc00per_typeset/_types/compassdirection.py +12 -0
  40. chadc00per_typeset/_types/contenttype.py +38 -0
  41. chadc00per_typeset/_types/continent.py +18 -0
  42. chadc00per_typeset/_types/country.py +13 -0
  43. chadc00per_typeset/_types/cron.py +77 -0
  44. chadc00per_typeset/_types/css.py +14 -0
  45. chadc00per_typeset/_types/currency.py +17 -0
  46. chadc00per_typeset/_types/datetimewindow.py +15 -0
  47. chadc00per_typeset/_types/day.py +9 -0
  48. chadc00per_typeset/_types/decimal.py +16 -0
  49. chadc00per_typeset/_types/domain.py +9 -0
  50. chadc00per_typeset/_types/email.py +117 -0
  51. chadc00per_typeset/_types/emoji.py +17 -0
  52. chadc00per_typeset/_types/etag.py +31 -0
  53. chadc00per_typeset/_types/expiry.py +42 -0
  54. chadc00per_typeset/_types/fahrenheit.py +9 -0
  55. chadc00per_typeset/_types/fiscalperiod.py +22 -0
  56. chadc00per_typeset/_types/font.py +43 -0
  57. chadc00per_typeset/_types/fraction.py +8 -0
  58. chadc00per_typeset/_types/function.py +38 -0
  59. chadc00per_typeset/_types/geo.py +14 -0
  60. chadc00per_typeset/_types/geohash.py +14 -0
  61. chadc00per_typeset/_types/geojson.py +271 -0
  62. chadc00per_typeset/_types/gtin.py +12 -0
  63. chadc00per_typeset/_types/hostname.py +9 -0
  64. chadc00per_typeset/_types/html.py +14 -0
  65. chadc00per_typeset/_types/imei.py +27 -0
  66. chadc00per_typeset/_types/int32.py +8 -0
  67. chadc00per_typeset/_types/integer.py +8 -0
  68. chadc00per_typeset/_types/interval.py +19 -0
  69. chadc00per_typeset/_types/ip.py +35 -0
  70. chadc00per_typeset/_types/ipaddress.py +10 -0
  71. chadc00per_typeset/_types/iprange.py +52 -0
  72. chadc00per_typeset/_types/isbn.py +19 -0
  73. chadc00per_typeset/_types/isoweek.py +26 -0
  74. chadc00per_typeset/_types/javascript.py +14 -0
  75. chadc00per_typeset/_types/kelvin.py +9 -0
  76. chadc00per_typeset/_types/language.py +22 -0
  77. chadc00per_typeset/_types/locale.py +638 -0
  78. chadc00per_typeset/_types/matrix.py +8 -0
  79. chadc00per_typeset/_types/mimetype.py +10 -0
  80. chadc00per_typeset/_types/money.py +94 -0
  81. chadc00per_typeset/_types/month.py +11 -0
  82. chadc00per_typeset/_types/monthday.py +19 -0
  83. chadc00per_typeset/_types/multiplier.py +12 -0
  84. chadc00per_typeset/_types/numberrange.py +23 -0
  85. chadc00per_typeset/_types/percentage.py +12 -0
  86. chadc00per_typeset/_types/phone.py +57 -0
  87. chadc00per_typeset/_types/place.py +13 -0
  88. chadc00per_typeset/_types/pluscode.py +30 -0
  89. chadc00per_typeset/_types/postalcode.py +18 -0
  90. chadc00per_typeset/_types/probability.py +8 -0
  91. chadc00per_typeset/_types/python.py +15 -0
  92. chadc00per_typeset/_types/ratio.py +28 -0
  93. chadc00per_typeset/_types/regex.py +239 -0
  94. chadc00per_typeset/_types/region.py +13 -0
  95. chadc00per_typeset/_types/resolution.py +23 -0
  96. chadc00per_typeset/_types/roman.py +14 -0
  97. chadc00per_typeset/_types/scopes.py +72 -0
  98. chadc00per_typeset/_types/semver.py +19 -0
  99. chadc00per_typeset/_types/semverrange.py +56 -0
  100. chadc00per_typeset/_types/smallint.py +8 -0
  101. chadc00per_typeset/_types/srt.py +8 -0
  102. chadc00per_typeset/_types/srtrange.py +8 -0
  103. chadc00per_typeset/_types/svg.py +14 -0
  104. chadc00per_typeset/_types/tag.py +8 -0
  105. chadc00per_typeset/_types/tagset.py +14 -0
  106. chadc00per_typeset/_types/time.py +17 -0
  107. chadc00per_typeset/_types/timecode.py +24 -0
  108. chadc00per_typeset/_types/timeprecision.py +12 -0
  109. chadc00per_typeset/_types/timezone.py +24 -0
  110. chadc00per_typeset/_types/transformmatrix.py +8 -0
  111. chadc00per_typeset/_types/ttl.py +8 -0
  112. chadc00per_typeset/_types/uint16.py +8 -0
  113. chadc00per_typeset/_types/uint32.py +8 -0
  114. chadc00per_typeset/_types/uint8.py +8 -0
  115. chadc00per_typeset/_types/ulid.py +15 -0
  116. chadc00per_typeset/_types/upc.py +12 -0
  117. chadc00per_typeset/_types/uri.py +91 -0
  118. chadc00per_typeset/_types/url.py +27 -0
  119. chadc00per_typeset/_types/uuid.py +20 -0
  120. chadc00per_typeset/_types/vatnumber.py +48 -0
  121. chadc00per_typeset/_types/vtt.py +8 -0
  122. chadc00per_typeset/_types/vttrange.py +8 -0
  123. chadc00per_typeset/_types/weekday.py +11 -0
  124. chadc00per_typeset/_types/xy.py +8 -0
  125. chadc00per_typeset/_types/xyz.py +8 -0
  126. chadc00per_typeset/_types/year.py +18 -0
  127. chadc00per_typeset/_types/yearmonth.py +17 -0
  128. chadc00per_typeset/data/UNICODE-LICENSE.txt +41 -0
  129. chadc00per_typeset/data/catalog.json +2793 -0
  130. chadc00per_typeset/data/currency.json +1 -0
  131. chadc00per_typeset/data/emoji.json +1 -0
  132. chadc00per_typeset/data/geography.json +1 -0
  133. chadc00per_typeset/data/languages.json +1 -0
  134. chadc00per_typeset/data/locales.json +1 -0
  135. chadc00per_typeset/data/timezones.json +1 -0
  136. chadc00per_typeset/data/tlds.json +1 -0
  137. chadc00per_typeset/py.typed +0 -0
  138. chadc00per_typeset-1.0.0.dist-info/METADATA +76 -0
  139. chadc00per_typeset-1.0.0.dist-info/RECORD +145 -0
  140. chadc00per_typeset-1.0.0.dist-info/WHEEL +4 -0
  141. chadc00per_typeset-1.0.0.dist-info/licenses/LICENSE +202 -0
  142. chadc00per_typeset-1.0.0.dist-info/licenses/NOTICE +14 -0
  143. chadc00per_typeset-1.0.0.dist-info/licenses/THIRD-PARTY-NOTICES.md +102 -0
  144. chadc00per_typeset-1.0.0.dist-info/licenses/data/UNICODE-LICENSE.txt +41 -0
  145. 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
+ ]