formatize 1.0.2__tar.gz → 1.0.4__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: formatize
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Literp Formatting Lib
5
5
  Home-page: https://github.com/asinerum/formatize
6
6
  Author: Asinerum Conlang Project
@@ -14,9 +14,12 @@ Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: bs4>=0.0.2
16
16
  Requires-Dist: dnspython>=2.8.0
17
+ Requires-Dist: numpy>=2.3.5
18
+ Requires-Dist: pandas>=2.3.3
17
19
  Requires-Dist: pillow>=12.0.0
18
20
  Requires-Dist: pydantic>=2.12.5
19
21
  Requires-Dist: pyyaml>=6.0.3
22
+ Requires-Dist: typing-extensions>=4.15.0
20
23
  Dynamic: license-file
21
24
 
22
25
  Detailed tips, tricks, and examples, can be found at project's repository
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = formatize
3
- version = 1.0.2
3
+ version = 1.0.4
4
4
  author = Asinerum Conlang Project
5
5
  author_email = asinerum.com@gmail.com
6
6
  description = Literp Formatting Lib
@@ -21,9 +21,12 @@ python_requires = >=3.7
21
21
  install_requires =
22
22
  bs4 >= 0.0.2
23
23
  dnspython >= 2.8.0
24
+ numpy >= 2.3.5
25
+ pandas >= 2.3.3
24
26
  pillow >= 12.0.0
25
27
  pydantic >= 2.12.5
26
28
  pyyaml >= 6.0.3
29
+ typing-extensions >= 4.15.0
27
30
 
28
31
  [options.packages.find]
29
32
  where = src
@@ -0,0 +1,4 @@
1
+ from .form import *
2
+ from .const import *
3
+
4
+ __version__ = "1.0.4"
@@ -0,0 +1,317 @@
1
+ from pydantic import BaseModel, ConfigDict, field_validator
2
+ from pydantic.functional_validators import BeforeValidator
3
+ from typing_extensions import Annotated
4
+ from typing import List, Dict, Optional
5
+
6
+ integer = lambda val: int(val) if str(val).isnumeric() else -1
7
+
8
+ nums_to_str = ConfigDict(coerce_numbers_to_str=True, extra='ignore')
9
+ int_or_none = Annotated[int, BeforeValidator(lambda x: integer(x))]
10
+ str_or_none = Annotated[str, BeforeValidator(lambda x: x or '')]
11
+
12
+ class DbItemRow(BaseModel):
13
+ sub: int_or_none=None
14
+ ref: int_or_none=None
15
+ uuid: Optional[str]=None
16
+ head: Optional[str]=None
17
+ info: Optional[str]=None
18
+ note: Optional[str]=None
19
+ dated: Optional[str]=None
20
+ creator: int_or_none=None
21
+ active: bool=True
22
+ model_config = nums_to_str
23
+
24
+ class DbTxRow(BaseModel):
25
+ uuid: Optional[str]=None
26
+ tx: Optional[str]=None
27
+ info: Optional[str]=None
28
+ note: Optional[str]=None
29
+ dated: Optional[str]=None
30
+ ref: int_or_none=None
31
+ account: int_or_none=None
32
+ sub: int_or_none=None
33
+ item: int_or_none=None
34
+ debit: float=0
35
+ credit: float=0
36
+ creator: int_or_none=None
37
+ model_config = nums_to_str
38
+
39
+ class DbTxs(BaseModel):
40
+ uuid: Optional[str]=None
41
+ dated: Optional[str]=None
42
+ creator: int_or_none=None
43
+ data: List[DbTxRow]=[DbTxRow()]
44
+ model_config = nums_to_str
45
+
46
+ class DbTx(BaseModel):
47
+ id: int_or_none=None
48
+ uuid: Optional[str]=None
49
+ tx: Optional[str]=None
50
+ info: Optional[str]=None
51
+ note: Optional[str]=None
52
+ dated: Optional[str]=None
53
+ datedfrom: Optional[str]=None
54
+ datedto: Optional[str]=None
55
+ ref: int_or_none=None
56
+ refcode: Optional[str]=None
57
+ account: int_or_none=None
58
+ accountcode: Optional[str]=None
59
+ sub: int_or_none=None
60
+ subcode: Optional[str]=None
61
+ item: int_or_none=None
62
+ itemuuid: Optional[str]=None
63
+ debit: float=0
64
+ credit: float=0
65
+ created: Optional[str]=None
66
+ createdfrom: Optional[str]=None
67
+ createdto: Optional[str]=None
68
+ creator: int_or_none=None
69
+ modified: Optional[str]=None
70
+ modifier: int_or_none=None
71
+ offset: int=0
72
+ limit: int=20
73
+ model_config = nums_to_str
74
+
75
+ class DbItem(BaseModel):
76
+ id: int_or_none=None
77
+ uuid: Optional[str]=None
78
+ sub: int_or_none=None
79
+ subcode: Optional[str]=None
80
+ account: int_or_none=None
81
+ accountcode: Optional[str]=None
82
+ ref: int_or_none=None
83
+ refcode: Optional[str]=None
84
+ head: Optional[str]=None
85
+ info: Optional[str]=None
86
+ note: Optional[str]=None
87
+ dated: Optional[str]=None
88
+ datedfrom: Optional[str]=None
89
+ datedto: Optional[str]=None
90
+ created: Optional[str]=None
91
+ createdfrom: Optional[str]=None
92
+ createdto: Optional[str]=None
93
+ modified: Optional[str]=None
94
+ creator: int_or_none=None
95
+ modifier: int_or_none=None
96
+ active: bool=True
97
+ cancel: bool=False
98
+ offset: int=0
99
+ limit: int=20
100
+ model_config = nums_to_str
101
+
102
+ class DbItems(BaseModel):
103
+ modifier: int_or_none=None
104
+ active: bool=True
105
+ cancel: bool=False
106
+ ids: list=[]
107
+ uuids: list=[]
108
+ model_config = nums_to_str
109
+
110
+ class DbSub(BaseModel):
111
+ id: int_or_none=None
112
+ name: Optional[str]=None
113
+ account: int_or_none=None
114
+ accountcode: Optional[str]=None
115
+ code: Optional[str]=None
116
+ info: Optional[str]=None
117
+ note: Optional[str]=None
118
+ created: Optional[str]=None
119
+ createdfrom: Optional[str]=None
120
+ createdto: Optional[str]=None
121
+ modified: Optional[str]=None
122
+ creator: int_or_none=None
123
+ modifier: int_or_none=None
124
+ active: bool=True
125
+ offset: int=0
126
+ limit: int=20
127
+ model_config = nums_to_str
128
+
129
+ class DbAccount(BaseModel):
130
+ id: int_or_none=None
131
+ name: Optional[str]=None
132
+ root: int_or_none=None
133
+ rootcode: Optional[str]=None
134
+ code: Optional[str]=None
135
+ note: Optional[str]=None
136
+ created: Optional[str]=None
137
+ active: bool=True
138
+ offset: int=0
139
+ limit: int=20
140
+ model_config = nums_to_str
141
+
142
+ class DbRoot(BaseModel):
143
+ id: int_or_none=None
144
+ name: Optional[str]=None
145
+ grup: int_or_none=None
146
+ grupcode: Optional[str]=None
147
+ code: Optional[str]=None
148
+ note: Optional[str]=None
149
+ created: Optional[str]=None
150
+ active: bool=True
151
+ offset: int=0
152
+ limit: int=20
153
+ model_config = nums_to_str
154
+
155
+ class DbGroup(BaseModel):
156
+ id: int_or_none=None
157
+ name: Optional[str]=None
158
+ code: Optional[str]=None
159
+ note: Optional[str]=None
160
+ created: Optional[str]=None
161
+ active: bool=True
162
+ offset: int=0
163
+ limit: int=20
164
+ model_config = nums_to_str
165
+
166
+ class DbUserrole(BaseModel):
167
+ name: Optional[str]=None
168
+ user: int_or_none=None
169
+ role: int_or_none=None
170
+ offset: int=0
171
+ limit: int=20
172
+ model_config = nums_to_str
173
+
174
+ class DbUserroles(BaseModel):
175
+ name: Optional[str]=None
176
+ user: int_or_none=None
177
+ roles: list=[]
178
+ model_config = nums_to_str
179
+
180
+ class DbUserspec(BaseModel):
181
+ name: Optional[str]=None
182
+ user: int_or_none=None
183
+ spec: int_or_none=None
184
+ offset: int=0
185
+ limit: int=20
186
+ model_config = nums_to_str
187
+
188
+ class DbUserspecs(BaseModel):
189
+ name: Optional[str]=None
190
+ user: int_or_none=None
191
+ specs: list=[]
192
+ model_config = nums_to_str
193
+
194
+ class DbSpecrole(BaseModel):
195
+ spec: int_or_none=None
196
+ role: int_or_none=None
197
+ offset: int=0
198
+ limit: int=20
199
+ model_config = nums_to_str
200
+
201
+ class DbSpecroles(BaseModel):
202
+ spec: int_or_none=None
203
+ roles: list=[]
204
+ model_config = nums_to_str
205
+
206
+ class DbSpec(BaseModel):
207
+ id: int_or_none=None
208
+ name: Optional[str]=None
209
+ note: Optional[str]=None
210
+ created: Optional[str]=None
211
+ active: bool=True
212
+ offset: int=0
213
+ limit: int=20
214
+ model_config = nums_to_str
215
+
216
+ class DbRole(BaseModel):
217
+ id: int_or_none=None
218
+ name: Optional[str]=None
219
+ note: Optional[str]=None
220
+ created: Optional[str]=None
221
+ active: bool=True
222
+ offset: int=0
223
+ limit: int=20
224
+ model_config = nums_to_str
225
+
226
+ class DbUser(BaseModel):
227
+ id: int_or_none=None
228
+ name: Optional[str]=None
229
+ zone: int_or_none=None
230
+ zoneidn: Optional[str]=None
231
+ useridn: Optional[str]=None
232
+ conuser: Optional[str]=None
233
+ hpwd: Optional[str]=None
234
+ mail: Optional[str]=None
235
+ info: Optional[str]=None
236
+ note: Optional[str]=None
237
+ created: Optional[str]=None
238
+ modified: Optional[str]=None
239
+ creator: Optional[int]=1
240
+ modifier: int_or_none=None
241
+ workbegin: Optional[str]=None
242
+ workend: Optional[str]=None
243
+ active: bool=False
244
+ zadmin: bool=False
245
+ worktime: Optional[str]=None
246
+ newpass: Optional[str]=None
247
+ oldpass: Optional[str]=None
248
+ offset: int=0
249
+ limit: int=20
250
+ model_config = nums_to_str
251
+
252
+ class DbZone(BaseModel):
253
+ id: int_or_none=None
254
+ name: Optional[str]=None
255
+ zoneidn: Optional[str]=None
256
+ useridn: Optional[str]=None
257
+ info: Optional[str]=None
258
+ note: Optional[str]=None
259
+ created: Optional[str]=None
260
+ modified: Optional[str]=None
261
+ creator: int=1
262
+ modifier: int_or_none=None
263
+ active: bool=False
264
+ offset: int=0
265
+ limit: int=20
266
+ model_config = nums_to_str
267
+
268
+ class Token(BaseModel):
269
+ user: Optional[str]=None
270
+ id: int_or_none=None
271
+ zone: int_or_none=None
272
+ zadmin: bool=False
273
+ access_token: Optional[str]=None
274
+ token_type: Optional[str]=None
275
+ model_config = nums_to_str
276
+
277
+ class User(BaseModel):
278
+ id: int_or_none=None
279
+ name: Optional[str]=None
280
+ zone: int_or_none=None
281
+ mail: Optional[str]=None
282
+ zadmin: bool=False
283
+ active: bool=False
284
+ found: bool=False
285
+ zoneidn: Optional[str]=None
286
+ useridn: Optional[str]=None
287
+ conuser: Optional[str]=None
288
+ model_config = nums_to_str
289
+
290
+ token_crypto_algorithm = 'HS256'
291
+ token_expire_minutes = 30
292
+
293
+ host_for_admin = '0.0.0.0'
294
+ host_for_api = '0.0.0.0'
295
+
296
+ port_for_admin = 900
297
+ port_for_api = 911
298
+ port_http = 80
299
+ port_httpa = 8080
300
+ port_https = 443
301
+
302
+ port_allowed = 65535
303
+ client_port_not_allowed = lambda port: (port:=int(port)) in [port_for_admin,port_for_api] or port>port_allowed or port<0
304
+
305
+ cors_base_url = 'http://localhost'
306
+ local_common_url = 'http://localhost'
307
+ local_secure_url = 'https://localhost'
308
+
309
+ cors_allowed_origins = lambda baseurl=cors_base_url: [
310
+ f"{local_common_url}",
311
+ f"{local_secure_url}",
312
+ f"{baseurl}:{port_for_api}",
313
+ f"{baseurl}:{port_for_admin}",
314
+ f"{baseurl}:{port_http}",
315
+ f"{baseurl}:{port_httpa}",
316
+ f"{baseurl}:{port_https}",
317
+ ]
@@ -74,6 +74,13 @@ def caller ():
74
74
  def extract (s, sep='.'):
75
75
  return s.split(sep)
76
76
 
77
+ def extract_input(s: str, sep: str=',', col: str=':') -> dict: ## <1.0.4>
78
+ try:
79
+ args = ''.join(s.split()).split(sep)
80
+ return {item.split(col)[0].lower(): item.split(col)[1] for item in args}
81
+ except:
82
+ return None
83
+
77
84
  def add_zero (n, zeros=2):
78
85
  return str(n).zfill(zeros)
79
86
 
@@ -337,7 +344,7 @@ def parse_doc_date(time: any=None) -> str:
337
344
  if not (time:=parse_time(time)): return None ## For DATE()
338
345
  return time[:10]
339
346
 
340
- def parse_date (datestr: str, dateform: str='%d/%m/%Y') -> str:
347
+ def parse_date (datestr: str, dateform: str='%d/%m/%Y') -> str: ## <1.0.3>
341
348
  try:
342
349
  date = datetime.datetime.strptime(datestr, dateform)
343
350
  except:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: formatize
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Literp Formatting Lib
5
5
  Home-page: https://github.com/asinerum/formatize
6
6
  Author: Asinerum Conlang Project
@@ -14,9 +14,12 @@ Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: bs4>=0.0.2
16
16
  Requires-Dist: dnspython>=2.8.0
17
+ Requires-Dist: numpy>=2.3.5
18
+ Requires-Dist: pandas>=2.3.3
17
19
  Requires-Dist: pillow>=12.0.0
18
20
  Requires-Dist: pydantic>=2.12.5
19
21
  Requires-Dist: pyyaml>=6.0.3
22
+ Requires-Dist: typing-extensions>=4.15.0
20
23
  Dynamic: license-file
21
24
 
22
25
  Detailed tips, tricks, and examples, can be found at project's repository
@@ -3,6 +3,7 @@ README.md
3
3
  pyproject.toml
4
4
  setup.cfg
5
5
  src/formatize/__init__.py
6
+ src/formatize/const.py
6
7
  src/formatize/form.py
7
8
  src/formatize.egg-info/PKG-INFO
8
9
  src/formatize.egg-info/SOURCES.txt
@@ -1,5 +1,8 @@
1
1
  bs4>=0.0.2
2
2
  dnspython>=2.8.0
3
+ numpy>=2.3.5
4
+ pandas>=2.3.3
3
5
  pillow>=12.0.0
4
6
  pydantic>=2.12.5
5
7
  pyyaml>=6.0.3
8
+ typing-extensions>=4.15.0
@@ -1,3 +0,0 @@
1
- from .form import *
2
-
3
- __version__ = "1.0.2"
File without changes
File without changes
File without changes