exonware-xwsystem 0.0.1.411__py3-none-any.whl → 0.1.0.1__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.
- exonware/__init__.py +1 -1
- exonware/conf.py +1 -1
- exonware/xwsystem/__init__.py +1 -1
- exonware/xwsystem/caching/__init__.py +1 -1
- exonware/xwsystem/caching/base.py +1 -1
- exonware/xwsystem/caching/bloom_cache.py +1 -1
- exonware/xwsystem/caching/cache_manager.py +1 -1
- exonware/xwsystem/caching/conditional.py +1 -1
- exonware/xwsystem/caching/contracts.py +1 -1
- exonware/xwsystem/caching/decorators.py +1 -1
- exonware/xwsystem/caching/defs.py +1 -1
- exonware/xwsystem/caching/disk_cache.py +1 -1
- exonware/xwsystem/caching/distributed.py +1 -1
- exonware/xwsystem/caching/errors.py +1 -1
- exonware/xwsystem/caching/events.py +1 -1
- exonware/xwsystem/caching/eviction_strategies.py +1 -1
- exonware/xwsystem/caching/fluent.py +1 -1
- exonware/xwsystem/caching/integrity.py +1 -1
- exonware/xwsystem/caching/lfu_cache.py +1 -1
- exonware/xwsystem/caching/lfu_optimized.py +1 -1
- exonware/xwsystem/caching/lru_cache.py +1 -1
- exonware/xwsystem/caching/memory_bounded.py +1 -1
- exonware/xwsystem/caching/metrics_exporter.py +1 -1
- exonware/xwsystem/caching/observable_cache.py +1 -1
- exonware/xwsystem/caching/pluggable_cache.py +1 -1
- exonware/xwsystem/caching/rate_limiter.py +1 -1
- exonware/xwsystem/caching/read_through.py +1 -1
- exonware/xwsystem/caching/secure_cache.py +1 -1
- exonware/xwsystem/caching/serializable.py +1 -1
- exonware/xwsystem/caching/stats.py +1 -1
- exonware/xwsystem/caching/tagging.py +1 -1
- exonware/xwsystem/caching/ttl_cache.py +1 -1
- exonware/xwsystem/caching/two_tier_cache.py +1 -1
- exonware/xwsystem/caching/utils.py +1 -1
- exonware/xwsystem/caching/validation.py +1 -1
- exonware/xwsystem/caching/warming.py +1 -1
- exonware/xwsystem/caching/write_behind.py +1 -1
- exonware/xwsystem/cli/__init__.py +1 -1
- exonware/xwsystem/cli/args.py +1 -1
- exonware/xwsystem/cli/base.py +1 -1
- exonware/xwsystem/cli/colors.py +1 -1
- exonware/xwsystem/cli/console.py +1 -1
- exonware/xwsystem/cli/contracts.py +1 -1
- exonware/xwsystem/cli/defs.py +1 -1
- exonware/xwsystem/cli/errors.py +1 -1
- exonware/xwsystem/cli/progress.py +1 -1
- exonware/xwsystem/cli/prompts.py +1 -1
- exonware/xwsystem/cli/tables.py +1 -1
- exonware/xwsystem/config/__init__.py +1 -1
- exonware/xwsystem/config/base.py +1 -1
- exonware/xwsystem/config/contracts.py +1 -1
- exonware/xwsystem/config/defaults.py +1 -1
- exonware/xwsystem/config/defs.py +1 -1
- exonware/xwsystem/config/errors.py +1 -1
- exonware/xwsystem/config/logging.py +1 -1
- exonware/xwsystem/config/logging_setup.py +1 -1
- exonware/xwsystem/config/performance.py +115 -388
- exonware/xwsystem/http_client/__init__.py +1 -1
- exonware/xwsystem/http_client/advanced_client.py +1 -1
- exonware/xwsystem/http_client/base.py +1 -1
- exonware/xwsystem/http_client/client.py +1 -1
- exonware/xwsystem/http_client/contracts.py +1 -1
- exonware/xwsystem/http_client/defs.py +1 -1
- exonware/xwsystem/http_client/errors.py +1 -1
- exonware/xwsystem/io/__init__.py +1 -1
- exonware/xwsystem/io/archive/__init__.py +1 -1
- exonware/xwsystem/io/archive/archive.py +1 -1
- exonware/xwsystem/io/archive/archive_files.py +1 -1
- exonware/xwsystem/io/archive/archivers.py +1 -1
- exonware/xwsystem/io/archive/base.py +1 -1
- exonware/xwsystem/io/archive/codec_integration.py +1 -1
- exonware/xwsystem/io/archive/compression.py +1 -1
- exonware/xwsystem/io/archive/formats/__init__.py +1 -1
- exonware/xwsystem/io/archive/formats/brotli_format.py +1 -1
- exonware/xwsystem/io/archive/formats/lz4_format.py +1 -1
- exonware/xwsystem/io/archive/formats/rar.py +1 -1
- exonware/xwsystem/io/archive/formats/sevenzip.py +1 -1
- exonware/xwsystem/io/archive/formats/squashfs_format.py +1 -1
- exonware/xwsystem/io/archive/formats/tar.py +1 -1
- exonware/xwsystem/io/archive/formats/wim_format.py +1 -1
- exonware/xwsystem/io/archive/formats/zip.py +1 -1
- exonware/xwsystem/io/archive/formats/zpaq_format.py +1 -1
- exonware/xwsystem/io/archive/formats/zstandard.py +1 -1
- exonware/xwsystem/io/base.py +1 -1
- exonware/xwsystem/io/codec/__init__.py +1 -1
- exonware/xwsystem/io/codec/base.py +1 -1
- exonware/xwsystem/io/codec/contracts.py +1 -1
- exonware/xwsystem/io/codec/registry.py +1 -1
- exonware/xwsystem/io/common/__init__.py +1 -1
- exonware/xwsystem/io/common/base.py +1 -1
- exonware/xwsystem/io/common/lock.py +1 -1
- exonware/xwsystem/io/common/watcher.py +1 -1
- exonware/xwsystem/io/contracts.py +1 -1
- exonware/xwsystem/io/data_operations.py +276 -10
- exonware/xwsystem/io/defs.py +1 -1
- exonware/xwsystem/io/errors.py +1 -1
- exonware/xwsystem/io/facade.py +1 -1
- exonware/xwsystem/io/file/__init__.py +1 -1
- exonware/xwsystem/io/file/base.py +1 -1
- exonware/xwsystem/io/file/conversion.py +1 -1
- exonware/xwsystem/io/file/file.py +1 -1
- exonware/xwsystem/io/file/paged_source.py +1 -1
- exonware/xwsystem/io/file/paging/__init__.py +1 -1
- exonware/xwsystem/io/file/paging/byte_paging.py +1 -1
- exonware/xwsystem/io/file/paging/line_paging.py +1 -1
- exonware/xwsystem/io/file/paging/record_paging.py +1 -1
- exonware/xwsystem/io/file/paging/registry.py +1 -1
- exonware/xwsystem/io/file/source.py +1 -1
- exonware/xwsystem/io/filesystem/__init__.py +1 -1
- exonware/xwsystem/io/filesystem/base.py +1 -1
- exonware/xwsystem/io/filesystem/local.py +1 -1
- exonware/xwsystem/io/folder/__init__.py +1 -1
- exonware/xwsystem/io/folder/base.py +1 -1
- exonware/xwsystem/io/folder/folder.py +1 -1
- exonware/xwsystem/io/serialization/__init__.py +1 -1
- exonware/xwsystem/io/serialization/auto_serializer.py +1 -1
- exonware/xwsystem/io/serialization/base.py +1 -1
- exonware/xwsystem/io/serialization/contracts.py +1 -1
- exonware/xwsystem/io/serialization/defs.py +1 -1
- exonware/xwsystem/io/serialization/errors.py +1 -1
- exonware/xwsystem/io/serialization/flyweight.py +1 -1
- exonware/xwsystem/io/serialization/format_detector.py +1 -1
- exonware/xwsystem/io/serialization/formats/__init__.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/bson.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/cbor.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/marshal.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/msgpack.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/pickle.py +1 -1
- exonware/xwsystem/io/serialization/formats/binary/plistlib.py +1 -1
- exonware/xwsystem/io/serialization/formats/database/dbm.py +1 -1
- exonware/xwsystem/io/serialization/formats/database/shelve.py +1 -1
- exonware/xwsystem/io/serialization/formats/database/sqlite3.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/append_only_log.py +201 -0
- exonware/xwsystem/io/serialization/formats/text/configparser.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/csv.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/formdata.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/json.py +43 -20
- exonware/xwsystem/io/serialization/formats/text/json5.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/jsonlines.py +99 -15
- exonware/xwsystem/io/serialization/formats/text/multipart.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/toml.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/xml.py +1 -1
- exonware/xwsystem/io/serialization/formats/text/yaml.py +1 -1
- exonware/xwsystem/io/serialization/parsers/__init__.py +15 -0
- exonware/xwsystem/io/serialization/parsers/base.py +59 -0
- exonware/xwsystem/io/serialization/parsers/hybrid_parser.py +61 -0
- exonware/xwsystem/io/serialization/parsers/msgspec_parser.py +45 -0
- exonware/xwsystem/io/serialization/parsers/orjson_direct_parser.py +53 -0
- exonware/xwsystem/io/serialization/parsers/orjson_parser.py +59 -0
- exonware/xwsystem/io/serialization/parsers/pysimdjson_parser.py +51 -0
- exonware/xwsystem/io/serialization/parsers/rapidjson_parser.py +50 -0
- exonware/xwsystem/io/serialization/parsers/registry.py +90 -0
- exonware/xwsystem/io/serialization/parsers/standard.py +43 -0
- exonware/xwsystem/io/serialization/parsers/ujson_parser.py +50 -0
- exonware/xwsystem/io/serialization/registry.py +1 -1
- exonware/xwsystem/io/serialization/serializer.py +1 -1
- exonware/xwsystem/io/serialization/utils/__init__.py +1 -1
- exonware/xwsystem/io/serialization/utils/path_ops.py +1 -1
- exonware/xwsystem/io/stream/__init__.py +1 -1
- exonware/xwsystem/io/stream/async_operations.py +1 -1
- exonware/xwsystem/io/stream/base.py +1 -1
- exonware/xwsystem/io/stream/codec_io.py +1 -1
- exonware/xwsystem/ipc/async_fabric.py +1 -1
- exonware/xwsystem/ipc/base.py +1 -1
- exonware/xwsystem/ipc/contracts.py +1 -1
- exonware/xwsystem/ipc/defs.py +1 -1
- exonware/xwsystem/ipc/errors.py +1 -1
- exonware/xwsystem/monitoring/base.py +1 -1
- exonware/xwsystem/monitoring/contracts.py +1 -1
- exonware/xwsystem/monitoring/defs.py +1 -1
- exonware/xwsystem/monitoring/errors.py +1 -1
- exonware/xwsystem/monitoring/performance_manager_generic.py +1 -1
- exonware/xwsystem/monitoring/system_monitor.py +1 -1
- exonware/xwsystem/monitoring/tracing.py +1 -1
- exonware/xwsystem/monitoring/tracker.py +1 -1
- exonware/xwsystem/operations/__init__.py +1 -1
- exonware/xwsystem/operations/base.py +1 -1
- exonware/xwsystem/operations/defs.py +1 -1
- exonware/xwsystem/operations/diff.py +1 -1
- exonware/xwsystem/operations/merge.py +1 -1
- exonware/xwsystem/operations/patch.py +1 -1
- exonware/xwsystem/patterns/base.py +1 -1
- exonware/xwsystem/patterns/contracts.py +1 -1
- exonware/xwsystem/patterns/defs.py +1 -1
- exonware/xwsystem/patterns/errors.py +1 -1
- exonware/xwsystem/patterns/registry.py +1 -1
- exonware/xwsystem/plugins/__init__.py +1 -1
- exonware/xwsystem/plugins/base.py +1 -1
- exonware/xwsystem/plugins/contracts.py +1 -1
- exonware/xwsystem/plugins/defs.py +1 -1
- exonware/xwsystem/plugins/errors.py +1 -1
- exonware/xwsystem/runtime/__init__.py +1 -1
- exonware/xwsystem/runtime/base.py +1 -1
- exonware/xwsystem/runtime/contracts.py +1 -1
- exonware/xwsystem/runtime/defs.py +1 -1
- exonware/xwsystem/runtime/env.py +1 -1
- exonware/xwsystem/runtime/errors.py +1 -1
- exonware/xwsystem/runtime/reflection.py +1 -1
- exonware/xwsystem/security/auth.py +1 -1
- exonware/xwsystem/security/base.py +1 -1
- exonware/xwsystem/security/contracts.py +1 -1
- exonware/xwsystem/security/crypto.py +1 -1
- exonware/xwsystem/security/defs.py +1 -1
- exonware/xwsystem/security/errors.py +1 -1
- exonware/xwsystem/security/hazmat.py +1 -1
- exonware/xwsystem/shared/__init__.py +1 -1
- exonware/xwsystem/shared/base.py +1 -1
- exonware/xwsystem/shared/contracts.py +1 -1
- exonware/xwsystem/shared/defs.py +1 -1
- exonware/xwsystem/shared/errors.py +1 -1
- exonware/xwsystem/structures/base.py +1 -1
- exonware/xwsystem/structures/contracts.py +1 -1
- exonware/xwsystem/structures/defs.py +1 -1
- exonware/xwsystem/structures/errors.py +1 -1
- exonware/xwsystem/threading/async_primitives.py +1 -1
- exonware/xwsystem/threading/base.py +1 -1
- exonware/xwsystem/threading/contracts.py +1 -1
- exonware/xwsystem/threading/defs.py +1 -1
- exonware/xwsystem/threading/errors.py +1 -1
- exonware/xwsystem/utils/base.py +1 -1
- exonware/xwsystem/utils/contracts.py +1 -1
- exonware/xwsystem/utils/dt/__init__.py +1 -1
- exonware/xwsystem/utils/dt/base.py +1 -1
- exonware/xwsystem/utils/dt/contracts.py +1 -1
- exonware/xwsystem/utils/dt/defs.py +1 -1
- exonware/xwsystem/utils/dt/errors.py +1 -1
- exonware/xwsystem/utils/dt/formatting.py +1 -1
- exonware/xwsystem/utils/dt/humanize.py +1 -1
- exonware/xwsystem/utils/dt/parsing.py +1 -1
- exonware/xwsystem/utils/dt/timezone_utils.py +1 -1
- exonware/xwsystem/utils/errors.py +1 -1
- exonware/xwsystem/utils/utils_contracts.py +1 -1
- exonware/xwsystem/validation/__init__.py +1 -1
- exonware/xwsystem/validation/base.py +1 -1
- exonware/xwsystem/validation/contracts.py +1 -1
- exonware/xwsystem/validation/declarative.py +1 -1
- exonware/xwsystem/validation/defs.py +1 -1
- exonware/xwsystem/validation/errors.py +1 -1
- exonware/xwsystem/validation/fluent_validator.py +1 -1
- exonware/xwsystem/version.py +4 -4
- {exonware_xwsystem-0.0.1.411.dist-info → exonware_xwsystem-0.1.0.1.dist-info}/METADATA +3 -3
- exonware_xwsystem-0.1.0.1.dist-info/RECORD +284 -0
- exonware/xwsystem/caching/USAGE_GUIDE.md +0 -779
- exonware/xwsystem/utils/test_runner.py +0 -526
- exonware_xwsystem-0.0.1.411.dist-info/RECORD +0 -274
- {exonware_xwsystem-0.0.1.411.dist-info → exonware_xwsystem-0.1.0.1.dist-info}/WHEEL +0 -0
- {exonware_xwsystem-0.0.1.411.dist-info → exonware_xwsystem-0.1.0.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""Parser registry for JSON parser selection and auto-detection."""
|
|
2
|
+
|
|
3
|
+
from typing import Optional, Dict, Type
|
|
4
|
+
|
|
5
|
+
from .base import IJsonParser
|
|
6
|
+
from .standard import StandardJsonParser
|
|
7
|
+
|
|
8
|
+
# Import hybrid parser (direct, no try/catch - assumes msgspec and orjson available)
|
|
9
|
+
from .hybrid_parser import HybridParser
|
|
10
|
+
|
|
11
|
+
# Registry of available parsers
|
|
12
|
+
_PARSERS: Dict[str, Type[IJsonParser]] = {
|
|
13
|
+
"hybrid": HybridParser, # Default: msgspec for reading, orjson for writing
|
|
14
|
+
"standard": StandardJsonParser, # Fallback only
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
# Cache of parser instances
|
|
18
|
+
_PARSER_INSTANCES: Dict[str, IJsonParser] = {}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def get_best_available_parser() -> IJsonParser:
|
|
22
|
+
"""
|
|
23
|
+
Auto-detect and return the best available parser.
|
|
24
|
+
|
|
25
|
+
Default: hybrid (msgspec for reading, orjson for writing)
|
|
26
|
+
- Fastest combination: msgspec reads 1.36x faster, orjson writes 2.27x faster
|
|
27
|
+
- Direct imports (no try/catch) - assumes both are available
|
|
28
|
+
|
|
29
|
+
Fallback: standard (stdlib json)
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
Best available parser instance
|
|
33
|
+
"""
|
|
34
|
+
# Try hybrid first (default)
|
|
35
|
+
parser_class = _PARSERS.get("hybrid")
|
|
36
|
+
if parser_class:
|
|
37
|
+
parser = parser_class()
|
|
38
|
+
if parser.is_available:
|
|
39
|
+
return parser
|
|
40
|
+
|
|
41
|
+
# Fallback to standard (always available)
|
|
42
|
+
return StandardJsonParser()
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def get_parser(name: Optional[str] = None) -> IJsonParser:
|
|
46
|
+
"""
|
|
47
|
+
Get parser by name or auto-detect best available.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
name: Parser name ("standard", "orjson", or None for auto-detect)
|
|
51
|
+
|
|
52
|
+
Returns:
|
|
53
|
+
Parser instance (falls back to best available if requested parser unavailable)
|
|
54
|
+
"""
|
|
55
|
+
if name is None:
|
|
56
|
+
return get_best_available_parser()
|
|
57
|
+
|
|
58
|
+
# Check cache first
|
|
59
|
+
if name in _PARSER_INSTANCES:
|
|
60
|
+
parser = _PARSER_INSTANCES[name]
|
|
61
|
+
if parser.is_available:
|
|
62
|
+
return parser
|
|
63
|
+
|
|
64
|
+
# Create new instance
|
|
65
|
+
parser_class = _PARSERS.get(name, StandardJsonParser)
|
|
66
|
+
parser = parser_class()
|
|
67
|
+
|
|
68
|
+
# Cache if available
|
|
69
|
+
if parser.is_available:
|
|
70
|
+
_PARSER_INSTANCES[name] = parser
|
|
71
|
+
else:
|
|
72
|
+
# Fallback to best available if requested parser unavailable
|
|
73
|
+
if name != "standard":
|
|
74
|
+
return get_best_available_parser()
|
|
75
|
+
|
|
76
|
+
return parser
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def register_parser(name: str, parser_class: Type[IJsonParser]):
|
|
80
|
+
"""
|
|
81
|
+
Register a new parser implementation.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
name: Parser identifier
|
|
85
|
+
parser_class: Parser class implementing IJsonParser
|
|
86
|
+
"""
|
|
87
|
+
_PARSERS[name] = parser_class
|
|
88
|
+
# Clear cache to allow new parser to be used
|
|
89
|
+
if name in _PARSER_INSTANCES:
|
|
90
|
+
del _PARSER_INSTANCES[name]
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""Standard library JSON parser (baseline implementation)."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from typing import Any, Union
|
|
5
|
+
|
|
6
|
+
from .base import IJsonParser
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class StandardJsonParser(IJsonParser):
|
|
10
|
+
"""Standard library JSON parser - Tier 0 (baseline)."""
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def parser_name(self) -> str:
|
|
14
|
+
return "standard"
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def tier(self) -> int:
|
|
18
|
+
return 0
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def is_available(self) -> bool:
|
|
22
|
+
return True # Always available (stdlib)
|
|
23
|
+
|
|
24
|
+
def loads(self, s: Union[str, bytes]) -> Any:
|
|
25
|
+
"""Parse JSON using stdlib json.loads()."""
|
|
26
|
+
if isinstance(s, bytes):
|
|
27
|
+
s = s.decode("utf-8")
|
|
28
|
+
return json.loads(s)
|
|
29
|
+
|
|
30
|
+
def dumps(self, obj: Any, **kwargs) -> Union[str, bytes]:
|
|
31
|
+
"""Serialize JSON using stdlib json.dumps()."""
|
|
32
|
+
ensure_ascii = kwargs.get("ensure_ascii", False)
|
|
33
|
+
indent = kwargs.get("indent", None)
|
|
34
|
+
sort_keys = kwargs.get("sort_keys", False)
|
|
35
|
+
|
|
36
|
+
return json.dumps(
|
|
37
|
+
obj,
|
|
38
|
+
ensure_ascii=ensure_ascii,
|
|
39
|
+
indent=indent,
|
|
40
|
+
sort_keys=sort_keys,
|
|
41
|
+
default=kwargs.get("default", None),
|
|
42
|
+
cls=kwargs.get("cls", None),
|
|
43
|
+
)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""ujson parser - Tier 1 (C-based, fast)."""
|
|
2
|
+
|
|
3
|
+
from typing import Any, Union
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
import ujson
|
|
7
|
+
UJSON_AVAILABLE = True
|
|
8
|
+
except ImportError:
|
|
9
|
+
UJSON_AVAILABLE = False
|
|
10
|
+
ujson = None
|
|
11
|
+
|
|
12
|
+
from .base import IJsonParser
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class UjsonParser(IJsonParser):
|
|
16
|
+
"""ujson parser - Tier 1 (C-based, fast)."""
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def parser_name(self) -> str:
|
|
20
|
+
return "ujson"
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def tier(self) -> int:
|
|
24
|
+
return 1
|
|
25
|
+
|
|
26
|
+
@property
|
|
27
|
+
def is_available(self) -> bool:
|
|
28
|
+
return UJSON_AVAILABLE
|
|
29
|
+
|
|
30
|
+
def loads(self, s: Union[str, bytes]) -> Any:
|
|
31
|
+
"""Parse JSON using ujson.loads()."""
|
|
32
|
+
if isinstance(s, bytes):
|
|
33
|
+
s = s.decode("utf-8")
|
|
34
|
+
return ujson.loads(s)
|
|
35
|
+
|
|
36
|
+
def dumps(self, obj: Any, **kwargs) -> Union[str, bytes]:
|
|
37
|
+
"""Serialize JSON using ujson.dumps()."""
|
|
38
|
+
# ujson supports most stdlib kwargs
|
|
39
|
+
result = ujson.dumps(
|
|
40
|
+
obj,
|
|
41
|
+
ensure_ascii=kwargs.get("ensure_ascii", True),
|
|
42
|
+
indent=kwargs.get("indent", None),
|
|
43
|
+
sort_keys=kwargs.get("sort_keys", False),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
# ujson returns str, encode if bytes needed
|
|
47
|
+
if isinstance(result, str) and kwargs.get("return_bytes", False):
|
|
48
|
+
return result.encode("utf-8")
|
|
49
|
+
|
|
50
|
+
return result
|
exonware/xwsystem/ipc/base.py
CHANGED
exonware/xwsystem/ipc/defs.py
CHANGED
exonware/xwsystem/ipc/errors.py
CHANGED
|
@@ -10,7 +10,7 @@ health monitoring, and recommendations without being tied to specific implementa
|
|
|
10
10
|
Company: eXonware.com
|
|
11
11
|
Author: Eng. Muhammad AlShehri
|
|
12
12
|
Email: connect@exonware.com
|
|
13
|
-
Version: 0.0.1
|
|
13
|
+
Version: 0.1.0.1
|
|
14
14
|
Generation Date: November 04, 2025
|
|
15
15
|
"""
|
|
16
16
|
|
exonware/xwsystem/runtime/env.py
CHANGED