omcore-cext 0.0.28__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.
@@ -0,0 +1,21 @@
1
+ Copyright 2023- wrmsr
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
4
+ following conditions are met:
5
+
6
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
7
+ disclaimer.
8
+
9
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
10
+ disclaimer in the documentation and/or other materials provided with the distribution.
11
+
12
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
13
+ derived from this software without specific prior written permission.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
21
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,212 @@
1
+ Metadata-Version: 2.4
2
+ Name: omcore-cext
3
+ Version: 0.0.28
4
+ Summary: omcore
5
+ Author: wrmsr
6
+ License-Expression: BSD-3-Clause
7
+ Project-URL: source, https://github.com/wrmsr/omcore
8
+ Classifier: Development Status :: 2 - Pre-Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Operating System :: POSIX
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.14
14
+ Requires-Python: >=3.14
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: omcore==0.0.28
18
+ Dynamic: license-file
19
+
20
+ # Overview
21
+
22
+ Core utilities and foundational code. It's relatively large but completely self-contained, and has **no required
23
+ dependencies of any kind**.
24
+
25
+ # Notable packages
26
+
27
+ - **[lang](https://github.com/wrmsr/omlish/blob/master/omcore/lang)** - The standard library of this standard library.
28
+ Usually imported as a whole (`from omcore import lang`), it contains an array of general purpose utilities used
29
+ practically everywhere. It is kept relatively lightweight: its heaviest import is stdlib dataclasses and its
30
+ transitives. Some of its contents include:
31
+
32
+ - **[cached](https://github.com/wrmsr/omlish/blob/master/omcore/lang/cached)** - The standard `cached_function` /
33
+ `cached_property` tools, which are more capable than
34
+ [`functools.lru_cache`](https://docs.python.org/3/library/functools.html#functools.lru_cache).
35
+ - **[imports](https://github.com/wrmsr/omlish/blob/master/omcore/lang/imports.py)** - Import tools like:
36
+ - `proxy_import` - For late-loaded imports.
37
+ - `proxy_init` - For late-loaded module globals.
38
+ - `auto_proxy_init` - For automatic late-loaded package exports.
39
+ - **[classes](https://github.com/wrmsr/omlish/blob/master/omcore/lang/classes)** - Class tools and bases, such as
40
+ `Abstract` (which checks at subclass definition not instantiation), `Sealed` / `PackageSealed`, and `Final`.
41
+ - **[maybes](https://github.com/wrmsr/omlish/blob/master/omcore/lite/maybes.py)** - A simple, nestable formalization
42
+ of the presence or absence of an object, as in [many](https://en.cppreference.com/w/cpp/utility/optional)
43
+ [other](https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html)
44
+ [languages](https://doc.rust-lang.org/std/option/).
45
+
46
+ - **[bootstrap](https://github.com/wrmsr/omlish/blob/master/omcore/bootstrap)** - A centralized, configurable,
47
+ all-in-one collection of various process-initialization minutiae like resource limiting, profiling, remote debugging,
48
+ log configuration, environment variables, et cetera. Usable as a context manager or via its
49
+ [cli](https://github.com/wrmsr/omlish/blob/master/omcore/bootstrap/main.py).
50
+
51
+ - **[collections](https://github.com/wrmsr/omlish/blob/master/omcore/collections)** - A handful of collection utilities
52
+ and simple implementations, including:
53
+
54
+ - **[cache](https://github.com/wrmsr/omlish/blob/master/omcore/collections/cache)** - A configurable LRU / LFU cache
55
+ with options like ttl and max size / weight.
56
+ - **[hasheq](https://github.com/wrmsr/omlish/blob/master/omcore/collections/hasheq.py)** - A dict taking an external
57
+ `__hash__` / `__eq__` implementation.
58
+ - **[identity](https://github.com/wrmsr/omlish/blob/master/omcore/collections/identity.py)** - Identity-keyed
59
+ collections.
60
+ - **[sorted](https://github.com/wrmsr/omlish/blob/master/omcore/collections/sorted)** - Interfaces for value-sorted
61
+ collections and key-sorted mappings, and a simple but correct skiplist-backed implementation.
62
+ - **[persistent](https://github.com/wrmsr/omlish/blob/master/omcore/collections/persistent)** - Interfaces for
63
+ [persistent](https://en.wikipedia.org/wiki/Persistent_data_structure) maps, and a simple but correct treap-backed
64
+ implementation.
65
+
66
+ - **[dataclasses](https://github.com/wrmsr/omlish/blob/master/omcore/dataclasses)** - A fully-compatible
67
+ reimplementation of stdlib [dataclasses](https://docs.python.org/3/library/dataclasses.html) with numerous
68
+ enhancements and additional features. The
69
+ [full stdlib test suite](https://github.com/wrmsr/omlish/blob/master/omcore/dataclasses/tests/cpython) is run against
70
+ it ensuring compatibility - they *are* dataclasses. Current enhancements include:
71
+
72
+ - Simple field coercion and validation.
73
+ - Any number of `@dc.init` or `@dc.validate` methods, not just a central `__post_init__`.
74
+ - Optional generic type parameter substitution in generated `__init__` methods, enabling accurate reflection.
75
+ - An optional [metaclass](https://github.com/wrmsr/omlish/blob/master/omcore/dataclasses/metaclass) which removes the
76
+ need for re-decorating subclasses (with support for inheritance of dataclass parameters like `frozen`), and some
77
+ basic [base classes](https://github.com/wrmsr/omlish/blob/master/omcore/dataclasses/metaclass/bases.py).
78
+ - Support for ahead-of-time / build-time code generation, significantly reducing import times.
79
+
80
+ The stdlib-equivalent api is exported in such a way as to appear to be direct aliases for the stdlib api itself,
81
+ simplifying tool support.
82
+
83
+ - **[dispatch](https://github.com/wrmsr/omlish/blob/master/omcore/dispatch)** - A beefed-up version of
84
+ [functools.singledispatch](https://docs.python.org/3/library/functools.html#functools.singledispatch), most notably
85
+ supporting MRO-honoring method impl dispatch.
86
+
87
+ - **[formats](https://github.com/wrmsr/omlish/blob/master/omcore/formats)** - Tools for various data formats, including:
88
+
89
+ - **[json](https://github.com/wrmsr/omlish/blob/master/omcore/formats/json)** - Tools for json, including abstraction
90
+ over various backends and a self-contained streaming / incremental parser.
91
+ - **[json5](https://github.com/wrmsr/omlish/blob/master/omcore/formats/json5)** - A self-contained and tested
92
+ [Json5](https://json5.org/) parser.
93
+ - **[toml](https://github.com/wrmsr/omlish/blob/master/omcore/formats/toml)** - Toml tools, including a
94
+ [lite](#lite-code) version of the stdlib parser (for use in older pythons).
95
+ - **[goyaml](https://github.com/wrmsr/omlish/blob/master/omcore/formats/yaml/goyaml)** - A **manual**, near-direct,
96
+ 'lite'-compatible translation of [go-yaml](https://github.com/goccy/go-yaml/).
97
+
98
+ https://github.com/goccy/go-yaml/tree/8dd51ebb7f36f616b85f7b0e54539afa4341f22a
99
+
100
+ - **[http](https://github.com/wrmsr/omlish/blob/master/omcore/http)** - HTTP code, including:
101
+
102
+ - **[clients](https://github.com/wrmsr/omlish/blob/master/omcore/http/clients)** - An abstraction over HTTP clients,
103
+ with urllib and httpx implementations.
104
+
105
+ - **[inject](https://github.com/wrmsr/omlish/blob/master/omcore/inject)** - A
106
+ [guice](https://github.com/google/guice)-style dependency injector.
107
+
108
+ - **[io](https://github.com/wrmsr/omlish/blob/master/omcore/io)** - IO tools, including:
109
+
110
+ - **[compress](https://github.com/wrmsr/omlish/blob/master/omcore/io/compress)** - Abstraction over various
111
+ compression schemes, with particular attention to incremental operation. For example it includes
112
+ [an incremental reformulation of stdlib's gzip](https://github.com/wrmsr/omlish/blob/master/omcore/io/compress/gzip.py).
113
+ - **[fdio](https://github.com/wrmsr/omlish/blob/master/omcore/io/fdio)** - An implementation of classic
114
+ [selector](https://docs.python.org/3/library/selectors.html)-style IO dispatch, akin to the deprecated
115
+ [asyncore](https://docs.python.org/3.11/library/asyncore.html). While more modern asyncio style code is generally
116
+ preferred, it nearly always involves
117
+ [background threads](https://github.com/python/cpython/blob/95d9dea1c4ed1b1de80074b74301cee0b38d5541/Lib/asyncio/unix_events.py#L1349)
118
+ making it [unsuitable for forking processes](https://rachelbythebay.com/w/2011/06/07/forked/).
119
+
120
+ - **[jmespath](https://github.com/wrmsr/omlish/blob/master/omcore/specs/jmespath)** - A vendoring of
121
+ [jmespath community edition](https://github.com/jmespath-community/python-jmespath), modernized and adapted to this
122
+ codebase.
123
+
124
+ - **[marshal](https://github.com/wrmsr/omlish/blob/master/omcore/marshal)** - A
125
+ [jackson](https://github.com/FasterXML/jackson)-style serde system.
126
+
127
+ - **[manifests](https://github.com/wrmsr/omlish/blob/master/omcore/manifests)** - A system for sharing lightweight
128
+ metadata within / across codebases.
129
+
130
+ - **[reflect](https://github.com/wrmsr/omlish/blob/master/omcore/reflect)** - Reflection utilities, including primarily
131
+ a formalization of stdlib type annotations for use at runtime, decoupled from stdlib impl detail. Keeping this working
132
+ is notoriously difficult across python versions (one of the primary reasons for only supporting 3.14+).
133
+
134
+ - **[sql](https://github.com/wrmsr/omlish/blob/master/omcore/sql)** - A collection of SQL utilities, including:
135
+
136
+ - **[api](https://github.com/wrmsr/omlish/blob/master/omcore/sql/api)** - An abstracted api for SQL interaction, with
137
+ support for dbapi compatible drivers (and a SQLAlchemy adapter).
138
+ - **[queries](https://github.com/wrmsr/omlish/blob/master/omcore/sql/queries)** - A SQL query builder with a fluent
139
+ interface.
140
+ - **[alchemy](https://github.com/wrmsr/omlish/blob/master/omcore/sql/alchemy)** - SQLAlchemy utilities. The codebase
141
+ has moved away from SQLAlchemy in favor of its own internal SQL api, but it will likely still remain as an optional
142
+ dep for the api adapter.
143
+
144
+ - **[testing](https://github.com/wrmsr/omlish/blob/master/omcore/testing)** - Test - primarily pytest - helpers,
145
+ including:
146
+
147
+ - **['harness'](https://github.com/wrmsr/omlish/blob/master/omcore/testing/pytest/inject/harness.py)** - An all-in-one
148
+ fixture marrying it to the codebase's dependency injector.
149
+ - **[plugins/async](https://github.com/wrmsr/omlish/blob/master/omcore/testing/pytest/plugins/asyncs)** - An in-house
150
+ async-backend abstraction plugin, capable of handling all of asyncio / trio / trio-asyncio /
151
+ *any-future-event-loop-impl* without having multiple fighting plugins (*[I know, I know](https://xkcd.com/927/)*).
152
+ - **[plugins](https://github.com/wrmsr/omlish/blob/master/omcore/testing/pytest/plugins)** - Various other plugins.
153
+
154
+ - **[typedvalues](https://github.com/wrmsr/omlish/blob/master/omcore/typedvalues)** - A little toolkit around 'boxed'
155
+ values, whose 'box' types convey more information than the bare values themselves. A rebellion against kwargs / env
156
+ vars / giant config objects: instead of `foo(bar=1, baz=2)`, you do `foo(Bar(1), Baz(2))`.
157
+
158
+ - **[lite](https://github.com/wrmsr/omlish/blob/master/omcore/lite)** - The standard library of 'lite' code. This is the
159
+ only package beneath `lang`, and parts of it are re-exported by it for deduplication. On top of miscellaneous
160
+ utilities it contains a handful of independent, self-contained, significantly simplified 'lite' equivalents of some
161
+ major core packages:
162
+
163
+ - **[lite/inject.py](https://github.com/wrmsr/omlish/blob/master/omcore/lite/inject.py)** - The lite injector, which
164
+ is more conservative with features and reflection than the core injector. The codebase's
165
+ [MiniGuice](https://github.com/google/guice/commit/70248eafa90cd70a68b293763e53f6aec656e73c).
166
+ - **[lite/marshal.py](https://github.com/wrmsr/omlish/blob/master/omcore/lite/marshal.py)** - The lite marshalling
167
+ system, which is a classic canned setup of simple type-specific 2-method classes and limited generic handling.
168
+
169
+ # Lite code
170
+
171
+ A subset of this codebase is written in a 'lite' style (non-'lite' code is referred to as *standard* code). While
172
+ standard code is written for python 3.14+, 'lite' code is written for 3.8+, and is written in a style conducive to
173
+ [amalgamation](https://github.com/wrmsr/omlish/blob/master/omdev#amalgamation) in which multiple python source files are
174
+ stitched together into one single self-contained python script.
175
+
176
+ Code written in this style has notable differences from standard code, including (but not limited to):
177
+
178
+ - No name mangling is done in amalgamation, which means (among other things) that code must be written expecting to be
179
+ all dumped into the same giant namespace. Where a standard class might be
180
+ [`omcore.inject.keys.Key`](https://github.com/wrmsr/omlish/blob/master/omcore/inject/keys.py), a lite equivalent might
181
+ be [`omcore.lite.inject.InjectorKey`](https://github.com/wrmsr/omlish/blob/master/omcore/lite/inject.py).
182
+ - All internal imports `import` each individual item out of modules rather than importing the modules and referencing
183
+ their contents. Where standard code would `from .. import x; x.y`, lite code would `from ..x import y; y`. As a result
184
+ there are frequently 'api' non-instantiated namespace classes serving the purpose of modules - just handy bags of
185
+ stuff with shortened names.
186
+ - As lite code is tested in 3.8+ but core code requires 3.14+, packages containing lite code can't import anything
187
+ standard in their (and their ancestors') `__init__.py`'s. Furthermore, `__init__.py` files are omitted outright in
188
+ amalgamation, so they effectively must be empty in any package containing any lite code. As a result there are
189
+ frequently [`all.py`](https://github.com/wrmsr/omlish/blob/master/omcore/configs/all.py) files in mixed-lite packages
190
+ which serve the purpose of `__init__.py` for standard usage - where importing standard packages from standard code
191
+ would be done via `from .. import lang`, importing mixed-lite packages from standard code would be done via
192
+ `from ..configs import all as cfgs`.
193
+
194
+ # Dependencies
195
+
196
+ This library has no required dependencies of any kind, but there are some optional integrations - see
197
+ [`__about__.py`](https://github.com/wrmsr/omlish/blob/master/omcore/__about__.py) for a full list, but some specific
198
+ examples are:
199
+
200
+ - **asttokens / executing** - For getting runtime source representations of function call arguments, an optional
201
+ capability of [check](https://github.com/wrmsr/omlish/blob/master/omcore/check.py).
202
+ - **pytest** - What is used for all standard testing - as lite code has no dependencies of any kind its testing uses
203
+ stdlib's [unittest](https://docs.python.org/3/library/unittest.html).
204
+ - **anyio** - While lite code must use only asyncio, some async standard code sometimes is written to anyio.
205
+ - **sqlalchemy** - The codebase has migrated away from SQLAlchemy in favor of the internal api but it retains it as an
206
+ optional dep to support adapting the internal api to it.
207
+
208
+ Additionally, some catchall dep categories include:
209
+
210
+ - **compression** - Various preferred compression backends like lz4, python-snappy, and brotli.
211
+ - **formats** - Various preferred data format backends like orjson/ujson, pyyaml, cbor2, and cloudpickle.
212
+ - **sql drivers** - Various preferred and tested sql drivers.
@@ -0,0 +1,193 @@
1
+ # Overview
2
+
3
+ Core utilities and foundational code. It's relatively large but completely self-contained, and has **no required
4
+ dependencies of any kind**.
5
+
6
+ # Notable packages
7
+
8
+ - **[lang](https://github.com/wrmsr/omlish/blob/master/omcore/lang)** - The standard library of this standard library.
9
+ Usually imported as a whole (`from omcore import lang`), it contains an array of general purpose utilities used
10
+ practically everywhere. It is kept relatively lightweight: its heaviest import is stdlib dataclasses and its
11
+ transitives. Some of its contents include:
12
+
13
+ - **[cached](https://github.com/wrmsr/omlish/blob/master/omcore/lang/cached)** - The standard `cached_function` /
14
+ `cached_property` tools, which are more capable than
15
+ [`functools.lru_cache`](https://docs.python.org/3/library/functools.html#functools.lru_cache).
16
+ - **[imports](https://github.com/wrmsr/omlish/blob/master/omcore/lang/imports.py)** - Import tools like:
17
+ - `proxy_import` - For late-loaded imports.
18
+ - `proxy_init` - For late-loaded module globals.
19
+ - `auto_proxy_init` - For automatic late-loaded package exports.
20
+ - **[classes](https://github.com/wrmsr/omlish/blob/master/omcore/lang/classes)** - Class tools and bases, such as
21
+ `Abstract` (which checks at subclass definition not instantiation), `Sealed` / `PackageSealed`, and `Final`.
22
+ - **[maybes](https://github.com/wrmsr/omlish/blob/master/omcore/lite/maybes.py)** - A simple, nestable formalization
23
+ of the presence or absence of an object, as in [many](https://en.cppreference.com/w/cpp/utility/optional)
24
+ [other](https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html)
25
+ [languages](https://doc.rust-lang.org/std/option/).
26
+
27
+ - **[bootstrap](https://github.com/wrmsr/omlish/blob/master/omcore/bootstrap)** - A centralized, configurable,
28
+ all-in-one collection of various process-initialization minutiae like resource limiting, profiling, remote debugging,
29
+ log configuration, environment variables, et cetera. Usable as a context manager or via its
30
+ [cli](https://github.com/wrmsr/omlish/blob/master/omcore/bootstrap/main.py).
31
+
32
+ - **[collections](https://github.com/wrmsr/omlish/blob/master/omcore/collections)** - A handful of collection utilities
33
+ and simple implementations, including:
34
+
35
+ - **[cache](https://github.com/wrmsr/omlish/blob/master/omcore/collections/cache)** - A configurable LRU / LFU cache
36
+ with options like ttl and max size / weight.
37
+ - **[hasheq](https://github.com/wrmsr/omlish/blob/master/omcore/collections/hasheq.py)** - A dict taking an external
38
+ `__hash__` / `__eq__` implementation.
39
+ - **[identity](https://github.com/wrmsr/omlish/blob/master/omcore/collections/identity.py)** - Identity-keyed
40
+ collections.
41
+ - **[sorted](https://github.com/wrmsr/omlish/blob/master/omcore/collections/sorted)** - Interfaces for value-sorted
42
+ collections and key-sorted mappings, and a simple but correct skiplist-backed implementation.
43
+ - **[persistent](https://github.com/wrmsr/omlish/blob/master/omcore/collections/persistent)** - Interfaces for
44
+ [persistent](https://en.wikipedia.org/wiki/Persistent_data_structure) maps, and a simple but correct treap-backed
45
+ implementation.
46
+
47
+ - **[dataclasses](https://github.com/wrmsr/omlish/blob/master/omcore/dataclasses)** - A fully-compatible
48
+ reimplementation of stdlib [dataclasses](https://docs.python.org/3/library/dataclasses.html) with numerous
49
+ enhancements and additional features. The
50
+ [full stdlib test suite](https://github.com/wrmsr/omlish/blob/master/omcore/dataclasses/tests/cpython) is run against
51
+ it ensuring compatibility - they *are* dataclasses. Current enhancements include:
52
+
53
+ - Simple field coercion and validation.
54
+ - Any number of `@dc.init` or `@dc.validate` methods, not just a central `__post_init__`.
55
+ - Optional generic type parameter substitution in generated `__init__` methods, enabling accurate reflection.
56
+ - An optional [metaclass](https://github.com/wrmsr/omlish/blob/master/omcore/dataclasses/metaclass) which removes the
57
+ need for re-decorating subclasses (with support for inheritance of dataclass parameters like `frozen`), and some
58
+ basic [base classes](https://github.com/wrmsr/omlish/blob/master/omcore/dataclasses/metaclass/bases.py).
59
+ - Support for ahead-of-time / build-time code generation, significantly reducing import times.
60
+
61
+ The stdlib-equivalent api is exported in such a way as to appear to be direct aliases for the stdlib api itself,
62
+ simplifying tool support.
63
+
64
+ - **[dispatch](https://github.com/wrmsr/omlish/blob/master/omcore/dispatch)** - A beefed-up version of
65
+ [functools.singledispatch](https://docs.python.org/3/library/functools.html#functools.singledispatch), most notably
66
+ supporting MRO-honoring method impl dispatch.
67
+
68
+ - **[formats](https://github.com/wrmsr/omlish/blob/master/omcore/formats)** - Tools for various data formats, including:
69
+
70
+ - **[json](https://github.com/wrmsr/omlish/blob/master/omcore/formats/json)** - Tools for json, including abstraction
71
+ over various backends and a self-contained streaming / incremental parser.
72
+ - **[json5](https://github.com/wrmsr/omlish/blob/master/omcore/formats/json5)** - A self-contained and tested
73
+ [Json5](https://json5.org/) parser.
74
+ - **[toml](https://github.com/wrmsr/omlish/blob/master/omcore/formats/toml)** - Toml tools, including a
75
+ [lite](#lite-code) version of the stdlib parser (for use in older pythons).
76
+ - **[goyaml](https://github.com/wrmsr/omlish/blob/master/omcore/formats/yaml/goyaml)** - A **manual**, near-direct,
77
+ 'lite'-compatible translation of [go-yaml](https://github.com/goccy/go-yaml/).
78
+
79
+ https://github.com/goccy/go-yaml/tree/8dd51ebb7f36f616b85f7b0e54539afa4341f22a
80
+
81
+ - **[http](https://github.com/wrmsr/omlish/blob/master/omcore/http)** - HTTP code, including:
82
+
83
+ - **[clients](https://github.com/wrmsr/omlish/blob/master/omcore/http/clients)** - An abstraction over HTTP clients,
84
+ with urllib and httpx implementations.
85
+
86
+ - **[inject](https://github.com/wrmsr/omlish/blob/master/omcore/inject)** - A
87
+ [guice](https://github.com/google/guice)-style dependency injector.
88
+
89
+ - **[io](https://github.com/wrmsr/omlish/blob/master/omcore/io)** - IO tools, including:
90
+
91
+ - **[compress](https://github.com/wrmsr/omlish/blob/master/omcore/io/compress)** - Abstraction over various
92
+ compression schemes, with particular attention to incremental operation. For example it includes
93
+ [an incremental reformulation of stdlib's gzip](https://github.com/wrmsr/omlish/blob/master/omcore/io/compress/gzip.py).
94
+ - **[fdio](https://github.com/wrmsr/omlish/blob/master/omcore/io/fdio)** - An implementation of classic
95
+ [selector](https://docs.python.org/3/library/selectors.html)-style IO dispatch, akin to the deprecated
96
+ [asyncore](https://docs.python.org/3.11/library/asyncore.html). While more modern asyncio style code is generally
97
+ preferred, it nearly always involves
98
+ [background threads](https://github.com/python/cpython/blob/95d9dea1c4ed1b1de80074b74301cee0b38d5541/Lib/asyncio/unix_events.py#L1349)
99
+ making it [unsuitable for forking processes](https://rachelbythebay.com/w/2011/06/07/forked/).
100
+
101
+ - **[jmespath](https://github.com/wrmsr/omlish/blob/master/omcore/specs/jmespath)** - A vendoring of
102
+ [jmespath community edition](https://github.com/jmespath-community/python-jmespath), modernized and adapted to this
103
+ codebase.
104
+
105
+ - **[marshal](https://github.com/wrmsr/omlish/blob/master/omcore/marshal)** - A
106
+ [jackson](https://github.com/FasterXML/jackson)-style serde system.
107
+
108
+ - **[manifests](https://github.com/wrmsr/omlish/blob/master/omcore/manifests)** - A system for sharing lightweight
109
+ metadata within / across codebases.
110
+
111
+ - **[reflect](https://github.com/wrmsr/omlish/blob/master/omcore/reflect)** - Reflection utilities, including primarily
112
+ a formalization of stdlib type annotations for use at runtime, decoupled from stdlib impl detail. Keeping this working
113
+ is notoriously difficult across python versions (one of the primary reasons for only supporting 3.14+).
114
+
115
+ - **[sql](https://github.com/wrmsr/omlish/blob/master/omcore/sql)** - A collection of SQL utilities, including:
116
+
117
+ - **[api](https://github.com/wrmsr/omlish/blob/master/omcore/sql/api)** - An abstracted api for SQL interaction, with
118
+ support for dbapi compatible drivers (and a SQLAlchemy adapter).
119
+ - **[queries](https://github.com/wrmsr/omlish/blob/master/omcore/sql/queries)** - A SQL query builder with a fluent
120
+ interface.
121
+ - **[alchemy](https://github.com/wrmsr/omlish/blob/master/omcore/sql/alchemy)** - SQLAlchemy utilities. The codebase
122
+ has moved away from SQLAlchemy in favor of its own internal SQL api, but it will likely still remain as an optional
123
+ dep for the api adapter.
124
+
125
+ - **[testing](https://github.com/wrmsr/omlish/blob/master/omcore/testing)** - Test - primarily pytest - helpers,
126
+ including:
127
+
128
+ - **['harness'](https://github.com/wrmsr/omlish/blob/master/omcore/testing/pytest/inject/harness.py)** - An all-in-one
129
+ fixture marrying it to the codebase's dependency injector.
130
+ - **[plugins/async](https://github.com/wrmsr/omlish/blob/master/omcore/testing/pytest/plugins/asyncs)** - An in-house
131
+ async-backend abstraction plugin, capable of handling all of asyncio / trio / trio-asyncio /
132
+ *any-future-event-loop-impl* without having multiple fighting plugins (*[I know, I know](https://xkcd.com/927/)*).
133
+ - **[plugins](https://github.com/wrmsr/omlish/blob/master/omcore/testing/pytest/plugins)** - Various other plugins.
134
+
135
+ - **[typedvalues](https://github.com/wrmsr/omlish/blob/master/omcore/typedvalues)** - A little toolkit around 'boxed'
136
+ values, whose 'box' types convey more information than the bare values themselves. A rebellion against kwargs / env
137
+ vars / giant config objects: instead of `foo(bar=1, baz=2)`, you do `foo(Bar(1), Baz(2))`.
138
+
139
+ - **[lite](https://github.com/wrmsr/omlish/blob/master/omcore/lite)** - The standard library of 'lite' code. This is the
140
+ only package beneath `lang`, and parts of it are re-exported by it for deduplication. On top of miscellaneous
141
+ utilities it contains a handful of independent, self-contained, significantly simplified 'lite' equivalents of some
142
+ major core packages:
143
+
144
+ - **[lite/inject.py](https://github.com/wrmsr/omlish/blob/master/omcore/lite/inject.py)** - The lite injector, which
145
+ is more conservative with features and reflection than the core injector. The codebase's
146
+ [MiniGuice](https://github.com/google/guice/commit/70248eafa90cd70a68b293763e53f6aec656e73c).
147
+ - **[lite/marshal.py](https://github.com/wrmsr/omlish/blob/master/omcore/lite/marshal.py)** - The lite marshalling
148
+ system, which is a classic canned setup of simple type-specific 2-method classes and limited generic handling.
149
+
150
+ # Lite code
151
+
152
+ A subset of this codebase is written in a 'lite' style (non-'lite' code is referred to as *standard* code). While
153
+ standard code is written for python 3.14+, 'lite' code is written for 3.8+, and is written in a style conducive to
154
+ [amalgamation](https://github.com/wrmsr/omlish/blob/master/omdev#amalgamation) in which multiple python source files are
155
+ stitched together into one single self-contained python script.
156
+
157
+ Code written in this style has notable differences from standard code, including (but not limited to):
158
+
159
+ - No name mangling is done in amalgamation, which means (among other things) that code must be written expecting to be
160
+ all dumped into the same giant namespace. Where a standard class might be
161
+ [`omcore.inject.keys.Key`](https://github.com/wrmsr/omlish/blob/master/omcore/inject/keys.py), a lite equivalent might
162
+ be [`omcore.lite.inject.InjectorKey`](https://github.com/wrmsr/omlish/blob/master/omcore/lite/inject.py).
163
+ - All internal imports `import` each individual item out of modules rather than importing the modules and referencing
164
+ their contents. Where standard code would `from .. import x; x.y`, lite code would `from ..x import y; y`. As a result
165
+ there are frequently 'api' non-instantiated namespace classes serving the purpose of modules - just handy bags of
166
+ stuff with shortened names.
167
+ - As lite code is tested in 3.8+ but core code requires 3.14+, packages containing lite code can't import anything
168
+ standard in their (and their ancestors') `__init__.py`'s. Furthermore, `__init__.py` files are omitted outright in
169
+ amalgamation, so they effectively must be empty in any package containing any lite code. As a result there are
170
+ frequently [`all.py`](https://github.com/wrmsr/omlish/blob/master/omcore/configs/all.py) files in mixed-lite packages
171
+ which serve the purpose of `__init__.py` for standard usage - where importing standard packages from standard code
172
+ would be done via `from .. import lang`, importing mixed-lite packages from standard code would be done via
173
+ `from ..configs import all as cfgs`.
174
+
175
+ # Dependencies
176
+
177
+ This library has no required dependencies of any kind, but there are some optional integrations - see
178
+ [`__about__.py`](https://github.com/wrmsr/omlish/blob/master/omcore/__about__.py) for a full list, but some specific
179
+ examples are:
180
+
181
+ - **asttokens / executing** - For getting runtime source representations of function call arguments, an optional
182
+ capability of [check](https://github.com/wrmsr/omlish/blob/master/omcore/check.py).
183
+ - **pytest** - What is used for all standard testing - as lite code has no dependencies of any kind its testing uses
184
+ stdlib's [unittest](https://docs.python.org/3/library/unittest.html).
185
+ - **anyio** - While lite code must use only asyncio, some async standard code sometimes is written to anyio.
186
+ - **sqlalchemy** - The codebase has migrated away from SQLAlchemy in favor of the internal api but it retains it as an
187
+ optional dep to support adapting the internal api to it.
188
+
189
+ Additionally, some catchall dep categories include:
190
+
191
+ - **compression** - Various preferred compression backends like lz4, python-snappy, and brotli.
192
+ - **formats** - Various preferred data format backends like orjson/ujson, pyyaml, cbor2, and cloudpickle.
193
+ - **sql drivers** - Various preferred and tested sql drivers.