omlish 0.0.0.dev210__py3-none-any.whl → 0.0.0.dev211__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of omlish might be problematic. Click here for more details.

omlish/__about__.py CHANGED
@@ -1,5 +1,5 @@
1
- __version__ = '0.0.0.dev210'
2
- __revision__ = '29187c4cc91a051a62ad46cd89206ced7ea76add'
1
+ __version__ = '0.0.0.dev211'
2
+ __revision__ = '429bd6e544b5a0e15db5196c05605127719166d9'
3
3
 
4
4
 
5
5
  #
@@ -6,4 +6,11 @@ TODO:
6
6
  - blosc?
7
7
  - python-lzo?
8
8
  - zfp -> fp8?
9
+
10
+ Compression choice:
11
+ - lzma if-available minimal-space
12
+ - lz4 if-available read-heavy
13
+ - zstd if-available
14
+ - bz2 read-heavy (but no parallel decompress)
15
+ - gz
9
16
  """
omlish/lang/strings.py CHANGED
@@ -52,8 +52,13 @@ def replace_many(
52
52
  ##
53
53
 
54
54
 
55
- def camel_case(name: str) -> str:
56
- return ''.join(map(str.capitalize, name.split('_'))) # noqa
55
+ def camel_case(name: str, *, lower: bool = False) -> str:
56
+ if not name:
57
+ return ''
58
+ s = ''.join(map(str.capitalize, name.split('_'))) # noqa
59
+ if lower:
60
+ s = s[0].lower() + s[1:]
61
+ return s
57
62
 
58
63
 
59
64
  def snake_case(name: str) -> str:
@@ -61,6 +66,9 @@ def snake_case(name: str) -> str:
61
66
  return '_'.join([name[l:r].lower() for l, r in zip([None, *uppers], [*uppers, None])]).strip('_')
62
67
 
63
68
 
69
+ ##
70
+
71
+
64
72
  def is_dunder(name: str) -> bool:
65
73
  return (
66
74
  name[:2] == name[-2:] == '__' and
omlish/lite/strings.py CHANGED
@@ -4,7 +4,7 @@ import typing as ta
4
4
  ##
5
5
 
6
6
 
7
- def camel_case(name: str, lower: bool = False) -> str:
7
+ def camel_case(name: str, *, lower: bool = False) -> str:
8
8
  if not name:
9
9
  return ''
10
10
  s = ''.join(map(str.capitalize, name.split('_'))) # noqa
@@ -21,6 +21,27 @@ def snake_case(name: str) -> str:
21
21
  ##
22
22
 
23
23
 
24
+ def is_dunder(name: str) -> bool:
25
+ return (
26
+ name[:2] == name[-2:] == '__' and
27
+ name[2:3] != '_' and
28
+ name[-3:-2] != '_' and
29
+ len(name) > 4
30
+ )
31
+
32
+
33
+ def is_sunder(name: str) -> bool:
34
+ return (
35
+ name[0] == name[-1] == '_' and
36
+ name[1:2] != '_' and
37
+ name[-2:-1] != '_' and
38
+ len(name) > 2
39
+ )
40
+
41
+
42
+ ##
43
+
44
+
24
45
  def strip_with_newline(s: str) -> str:
25
46
  if not s:
26
47
  return ''
@@ -52,27 +73,6 @@ def split_keep_delimiter(s, d):
52
73
  ##
53
74
 
54
75
 
55
- def is_dunder(name: str) -> bool:
56
- return (
57
- name[:2] == name[-2:] == '__' and
58
- name[2:3] != '_' and
59
- name[-3:-2] != '_' and
60
- len(name) > 4
61
- )
62
-
63
-
64
- def is_sunder(name: str) -> bool:
65
- return (
66
- name[0] == name[-1] == '_' and
67
- name[1:2] != '_' and
68
- name[-2:-1] != '_' and
69
- len(name) > 2
70
- )
71
-
72
-
73
- ##
74
-
75
-
76
76
  def attr_repr(obj: ta.Any, *attrs: str) -> str:
77
77
  return f'{type(obj).__name__}({", ".join(f"{attr}={getattr(obj, attr)!r}" for attr in attrs)})'
78
78
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: omlish
3
- Version: 0.0.0.dev210
3
+ Version: 0.0.0.dev211
4
4
  Summary: omlish
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -1,5 +1,5 @@
1
1
  omlish/.manifests.json,sha256=dyIpveH7Z8OnQp2pTn6NVv7LCDXVrozJWAzbk8PBavg,7950
2
- omlish/__about__.py,sha256=k-LReuWcQzDYGLPwBQIiwvv6bYv80UaqeQ2bGjZEhuY,3409
2
+ omlish/__about__.py,sha256=M0cCQiz1nNSIVpsNpftgCI4sNi-sYqMT_ZA_wP4FTWY,3409
3
3
  omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
4
4
  omlish/c3.py,sha256=ubu7lHwss5V4UznbejAI0qXhXahrU01MysuHOZI9C4U,8116
5
5
  omlish/cached.py,sha256=UI-XTFBwA6YXWJJJeBn-WkwBkfzDjLBBaZf4nIJA9y0,510
@@ -329,7 +329,7 @@ omlish/io/abc.py,sha256=Cxs8KB1B_69rxpUYxI-MTsilAmNooJJn3w07DKqYKkE,1255
329
329
  omlish/io/buffers.py,sha256=qo1hCqTfKvlbSmddneporqCtW0rZJ_Mv2GrQTI1Hbk0,5636
330
330
  omlish/io/pyio.py,sha256=q4RBFVpBE5PYjnGPGT-_4pcZb7dFJmLJ4LtI8OoDRQY,95433
331
331
  omlish/io/trampoline.py,sha256=oUKTQg1F5xQS1431Kt7MbK-NZpX509ubcXU-s86xJr8,7171
332
- omlish/io/compress/__init__.py,sha256=qV-aDfPWykTMYcoQmE8THZ4KFDRzqwN3QPPNEJVarXY,86
332
+ omlish/io/compress/__init__.py,sha256=fJFPT4ONfqxmsA4jR6qbMt2woIyyEgnc_qOWK9o1kII,247
333
333
  omlish/io/compress/abc.py,sha256=P9YoQX8XYoq2UfBsinKLUuwwqV1ODUIJzjTraRWGF1M,3090
334
334
  omlish/io/compress/adapters.py,sha256=LJHhjwMHXstoLyX_q0QhGoBAcqyYGWfzhzQbGBXHzHY,6148
335
335
  omlish/io/compress/base.py,sha256=zwPnicyrEY-zersxdhxGHXxn02ycl8ew2uZXEecJea4,615
@@ -373,7 +373,7 @@ omlish/lang/maybes.py,sha256=1RN7chX_x2XvgUwryZRz0W7hAX-be3eEFcFub5vvf6M,3417
373
373
  omlish/lang/objects.py,sha256=LOC3JvX1g5hPxJ7Sv2TK9kNkAo9c8J-Jw2NmClR_rkA,4576
374
374
  omlish/lang/resolving.py,sha256=OuN2mDTPNyBUbcrswtvFKtj4xgH4H4WglgqSKv3MTy0,1606
375
375
  omlish/lang/resources.py,sha256=N64KeVE-rYMxqBBRp91qzgVqpOVR2uX7k1WlS_bo5hM,2681
376
- omlish/lang/strings.py,sha256=BsciSYnckD4vGtC6kmtnugR9IN6CIHdcjO4nZu-pSAw,3898
376
+ omlish/lang/strings.py,sha256=qnKLDEkp6zrrjq3ClzY1qubi1I2Vjf8HZfSlSCbmvi8,4019
377
377
  omlish/lang/sys.py,sha256=UoZz_PJYVKLQAKqYxxn-LHz1okK_38I__maZgnXMcxU,406
378
378
  omlish/lang/timeouts.py,sha256=vECdWYhc_IZgcal1Ng1Y42wf2FV3KAx-i8As-MgGHIQ,1186
379
379
  omlish/lang/typing.py,sha256=Zdad9Zv0sa-hIaUXPrzPidT7sDVpRcussAI7D-j-I1c,3296
@@ -406,7 +406,7 @@ omlish/lite/reflect.py,sha256=pzOY2PPuHH0omdtglkN6DheXDrGopdL3PtTJnejyLFU,2189
406
406
  omlish/lite/resources.py,sha256=YNSmX1Ohck1aoWRs55a-o5ChVbFJIQhtbqE-XwF55Oc,326
407
407
  omlish/lite/runtime.py,sha256=XQo408zxTdJdppUZqOWHyeUR50VlCpNIExNGHz4U6O4,459
408
408
  omlish/lite/secrets.py,sha256=3Mz3V2jf__XU9qNHcH56sBSw95L3U2UPL24bjvobG0c,816
409
- omlish/lite/strings.py,sha256=nGWaOi9LzTjkc5kPN2IqsVN8PUw8m_2yllTGRUQU5PI,1983
409
+ omlish/lite/strings.py,sha256=QGxT1Yh4oI8ycsfeobxnjEhvDob_GiAKLeIhZwo1j24,1986
410
410
  omlish/lite/types.py,sha256=fP5EMyBdEp2LmDxcHjUDtwAMdR06ISr9lKOL7smWfHM,140
411
411
  omlish/lite/typing.py,sha256=U3-JaEnkDSYxK4tsu_MzUn3RP6qALBe5FXQXpD-licE,1090
412
412
  omlish/logs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -609,9 +609,9 @@ omlish/text/indent.py,sha256=YjtJEBYWuk8--b9JU_T6q4yxV85_TR7VEVr5ViRCFwk,1336
609
609
  omlish/text/minja.py,sha256=jZC-fp3Xuhx48ppqsf2Sf1pHbC0t8XBB7UpUUoOk2Qw,5751
610
610
  omlish/text/parts.py,sha256=7vPF1aTZdvLVYJ4EwBZVzRSy8XB3YqPd7JwEnNGGAOo,6495
611
611
  omlish/text/random.py,sha256=jNWpqiaKjKyTdMXC-pWAsSC10AAP-cmRRPVhm59ZWLk,194
612
- omlish-0.0.0.dev210.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
613
- omlish-0.0.0.dev210.dist-info/METADATA,sha256=aS3RF2o9QVbMbqBTFY99L9-OWMdcVv3KVcm3AlSy-vo,4264
614
- omlish-0.0.0.dev210.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
615
- omlish-0.0.0.dev210.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
616
- omlish-0.0.0.dev210.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
617
- omlish-0.0.0.dev210.dist-info/RECORD,,
612
+ omlish-0.0.0.dev211.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
613
+ omlish-0.0.0.dev211.dist-info/METADATA,sha256=5eXBkL9XUJsMuIZofsOEhTgJU-bOtX_KH188PXyq2aw,4264
614
+ omlish-0.0.0.dev211.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
615
+ omlish-0.0.0.dev211.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
616
+ omlish-0.0.0.dev211.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
617
+ omlish-0.0.0.dev211.dist-info/RECORD,,