Skip to main content

Overview

Core utilities and foundational code. It's relatively large but completely self-contained, and has no required dependencies of any kind.

Notable packages

  • lang - The standard library of this standard library. Usually imported as a whole (from omcore import lang), it contains an array of general purpose utilities used practically everywhere. It is kept relatively lightweight: its heaviest import is stdlib dataclasses and its transitives. Some of its contents include:

    • cached - The standard cached_function / cached_property tools, which are more capable than functools.lru_cache.
    • imports - Import tools like:
      • proxy_import - For late-loaded imports.
      • proxy_init - For late-loaded module globals.
      • auto_proxy_init - For automatic late-loaded package exports.
    • classes - Class tools and bases, such as Abstract (which checks at subclass definition not instantiation), Sealed / PackageSealed, and Final.
    • maybes - A simple, nestable formalization of the presence or absence of an object, as in many other languages.
  • bootstrap - A centralized, configurable, all-in-one collection of various process-initialization minutiae like resource limiting, profiling, remote debugging, log configuration, environment variables, et cetera. Usable as a context manager or via its cli.

  • collections - A handful of collection utilities and simple implementations, including:

    • cache - A configurable LRU / LFU cache with options like ttl and max size / weight.
    • hasheq - A dict taking an external __hash__ / __eq__ implementation.
    • identity - Identity-keyed collections.
    • sorted - Interfaces for value-sorted collections and key-sorted mappings, and a simple but correct skiplist-backed implementation.
    • persistent - Interfaces for persistent maps, and a simple but correct treap-backed implementation.
  • dataclasses - A fully-compatible reimplementation of stdlib dataclasses with numerous enhancements and additional features. The full stdlib test suite is run against it ensuring compatibility - they are dataclasses. Current enhancements include:

    • Simple field coercion and validation.
    • Any number of @dc.init or @dc.validate methods, not just a central __post_init__.
    • Optional generic type parameter substitution in generated __init__ methods, enabling accurate reflection.
    • An optional metaclass which removes the need for re-decorating subclasses (with support for inheritance of dataclass parameters like frozen), and some basic base classes.
    • Support for ahead-of-time / build-time code generation, significantly reducing import times.

    The stdlib-equivalent api is exported in such a way as to appear to be direct aliases for the stdlib api itself, simplifying tool support.

  • dispatch - A beefed-up version of functools.singledispatch, most notably supporting MRO-honoring method impl dispatch.

  • formats - Tools for various data formats, including:

    • json - Tools for json, including abstraction over various backends and a self-contained streaming / incremental parser.
    • json5 - A self-contained and tested Json5 parser.
    • toml - Toml tools, including a lite version of the stdlib parser (for use in older pythons).
    • goyaml - A manual, near-direct, 'lite'-compatible translation of go-yaml.

    https://github.com/goccy/go-yaml/tree/8dd51ebb7f36f616b85f7b0e54539afa4341f22a

  • http - HTTP code, including:

    • clients - An abstraction over HTTP clients, with urllib and httpx implementations.
  • inject - A guice-style dependency injector.

  • io - IO tools, including:

  • jmespath - A vendoring of jmespath community edition, modernized and adapted to this codebase.

  • marshal - A jackson-style serde system.

  • manifests - A system for sharing lightweight metadata within / across codebases.

  • reflect - Reflection utilities, including primarily a formalization of stdlib type annotations for use at runtime, decoupled from stdlib impl detail. Keeping this working is notoriously difficult across python versions (one of the primary reasons for only supporting 3.14+).

  • sql - A collection of SQL utilities, including:

    • api - An abstracted api for SQL interaction, with support for dbapi compatible drivers (and a SQLAlchemy adapter).
    • queries - A SQL query builder with a fluent interface.
    • alchemy - SQLAlchemy utilities. The codebase has moved away from SQLAlchemy in favor of its own internal SQL api, but it will likely still remain as an optional dep for the api adapter.
  • testing - Test - primarily pytest - helpers, including:

    • 'harness' - An all-in-one fixture marrying it to the codebase's dependency injector.
    • plugins/async - An in-house async-backend abstraction plugin, capable of handling all of asyncio / trio / trio-asyncio / any-future-event-loop-impl without having multiple fighting plugins (I know, I know).
    • plugins - Various other plugins.
  • typedvalues - A little toolkit around 'boxed' values, whose 'box' types convey more information than the bare values themselves. A rebellion against kwargs / env vars / giant config objects: instead of foo(bar=1, baz=2), you do foo(Bar(1), Baz(2)).

  • lite - The standard library of 'lite' code. This is the only package beneath lang, and parts of it are re-exported by it for deduplication. On top of miscellaneous utilities it contains a handful of independent, self-contained, significantly simplified 'lite' equivalents of some major core packages:

    • lite/inject.py - The lite injector, which is more conservative with features and reflection than the core injector. The codebase's MiniGuice.
    • lite/marshal.py - The lite marshalling system, which is a classic canned setup of simple type-specific 2-method classes and limited generic handling.

Lite code

A subset of this codebase is written in a 'lite' style (non-'lite' code is referred to as standard code). While standard code is written for python 3.14+, 'lite' code is written for 3.8+, and is written in a style conducive to amalgamation in which multiple python source files are stitched together into one single self-contained python script.

Code written in this style has notable differences from standard code, including (but not limited to):

  • No name mangling is done in amalgamation, which means (among other things) that code must be written expecting to be all dumped into the same giant namespace. Where a standard class might be omcore.inject.keys.Key, a lite equivalent might be omcore.lite.inject.InjectorKey.
  • All internal imports import each individual item out of modules rather than importing the modules and referencing their contents. Where standard code would from .. import x; x.y, lite code would from ..x import y; y. As a result there are frequently 'api' non-instantiated namespace classes serving the purpose of modules - just handy bags of stuff with shortened names.
  • As lite code is tested in 3.8+ but core code requires 3.14+, packages containing lite code can't import anything standard in their (and their ancestors') __init__.py's. Furthermore, __init__.py files are omitted outright in amalgamation, so they effectively must be empty in any package containing any lite code. As a result there are frequently all.py files in mixed-lite packages which serve the purpose of __init__.py for standard usage - where importing standard packages from standard code would be done via from .. import lang, importing mixed-lite packages from standard code would be done via from ..configs import all as cfgs.

Dependencies

This library has no required dependencies of any kind, but there are some optional integrations - see __about__.py for a full list, but some specific examples are:

  • asttokens / executing - For getting runtime source representations of function call arguments, an optional capability of check.
  • pytest - What is used for all standard testing - as lite code has no dependencies of any kind its testing uses stdlib's unittest.
  • anyio - While lite code must use only asyncio, some async standard code sometimes is written to anyio.
  • sqlalchemy - The codebase has migrated away from SQLAlchemy in favor of the internal api but it retains it as an optional dep to support adapting the internal api to it.

Additionally, some catchall dep categories include:

  • compression - Various preferred compression backends like lz4, python-snappy, and brotli.
  • formats - Various preferred data format backends like orjson/ujson, pyyaml, cbor2, and cloudpickle.
  • sql drivers - Various preferred and tested sql drivers.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omcore_cext-0.0.43.tar.gz (144.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

omcore_cext-0.0.43-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

omcore_cext-0.0.43-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (9.0 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

omcore_cext-0.0.43-cp314-cp314t-macosx_15_0_arm64.whl (587.2 kB view details)

Uploaded CPython 3.14tmacOS 15.0+ ARM64

omcore_cext-0.0.43-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (9.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

omcore_cext-0.0.43-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (9.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

omcore_cext-0.0.43-cp314-cp314-macosx_15_0_arm64.whl (577.2 kB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

File details

Details for the file omcore_cext-0.0.43.tar.gz.

File metadata

  • Download URL: omcore_cext-0.0.43.tar.gz
  • Upload date:
  • Size: 144.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for omcore_cext-0.0.43.tar.gz
Algorithm Hash digest
SHA256 916974672ebe1e6e61b612f3b294cfcf05ec66ffc229da6730164f4bebf247ed
MD5 0470ae33327cda61837741e56ec3f75a
BLAKE2b-256 3cce82a59f08a3a267d06acfe75a3e9d633336044561e614298b6f78107fed64

See more details on using hashes here.

File details

Details for the file omcore_cext-0.0.43-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for omcore_cext-0.0.43-cp314-cp314t-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 862506fec81a09623c3b27ed7e724e27f31ad9bf3029a12b00a6e4b2a0a35080
MD5 61a82f5c986eadb5ecae0870df141925
BLAKE2b-256 a6fd1c591ac9b40de0b9f684d40afbe65e633792aa2d8b5b2933c37a555459d9

See more details on using hashes here.

File details

Details for the file omcore_cext-0.0.43-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for omcore_cext-0.0.43-cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 82c32142ce6ad9bc5ee31c2fbe2baa67d56d30e18d7e3c345c8080e6099fcdac
MD5 932a114167f657fa196a77762a10a1c9
BLAKE2b-256 9efae6c2f3d499b949e1de4eb959bb8f38b422cfe06e0648e525482eb04de5da

See more details on using hashes here.

File details

Details for the file omcore_cext-0.0.43-cp314-cp314t-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for omcore_cext-0.0.43-cp314-cp314t-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8af489d8e824d44be9d410d9e6ce04ff7cb6e8717815eca62b8d263b9756d04e
MD5 deed78df30103fa32b049818cfc5926b
BLAKE2b-256 d42403084db9e5af07c1561e81075b98e909ff5d2a6bef07fd540f32e3b7d8fd

See more details on using hashes here.

File details

Details for the file omcore_cext-0.0.43-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for omcore_cext-0.0.43-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6683557a5108d988cfbb9b134fda7899ed6b4bdc6f260bea1ab10580694a0f13
MD5 d8b2b17f73433564fbcbe30efafd547a
BLAKE2b-256 9ae1c4b82317941f99f4523d025112d8119d6b7b5491fec272e8548b6490a210

See more details on using hashes here.

File details

Details for the file omcore_cext-0.0.43-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for omcore_cext-0.0.43-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7388a583a914c754c333c0a25b914185d86e0cba85d81d2c1400fee4f3495769
MD5 517f93cb7b257a81cfe7148ed4b4a849
BLAKE2b-256 6ea07d3c680aa59fab1c038a628c4265bcb165c3edb2c84fee1341514850c5a5

See more details on using hashes here.

File details

Details for the file omcore_cext-0.0.43-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for omcore_cext-0.0.43-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 e9de297a888785f360c771799f99c742e453ab5e50fb527f64c657ff58d5f91e
MD5 2915f0df06aaa3d1aeeed4552d103e7b
BLAKE2b-256 309352f647da73c1351730c2145b38e41cee47441077f14b14f19cc6c3b6cbee

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.53

7 files

0.0.52

7 files

0.0.51

7 files

0.0.50

7 files

0.0.49

7 files

0.0.48

7 files

0.0.47

7 files

0.0.46

7 files

0.0.45

7 files

0.0.44

7 files

This release

0.0.43 This release

7 files

0.0.42

2 files

0.0.41

2 files

0.0.40

2 files

0.0.39

2 files

0.0.38

2 files

0.0.37

2 files

0.0.36

2 files

0.0.35

2 files

0.0.34

2 files

0.0.33

2 files

0.0.32

2 files

0.0.31

2 files

0.0.30

2 files

0.0.29

2 files

0.0.28

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page