vools 0.2.0__tar.gz → 0.2.2__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.
- {vools-0.2.0/vools.egg-info → vools-0.2.2}/PKG-INFO +21 -4
- {vools-0.2.0 → vools-0.2.2}/README.md +20 -3
- {vools-0.2.0 → vools-0.2.2}/pyproject.toml +4 -3
- {vools-0.2.0 → vools-0.2.2}/vools/__init__.py +39 -1
- vools-0.2.2/vools/api/__init__.py +21 -0
- vools-0.2.2/vools/api/curry_cmd.py +98 -0
- vools-0.2.2/vools/api/memoize_cmd.py +125 -0
- vools-0.2.2/vools/api/ops_cmd.py +112 -0
- vools-0.2.2/vools/api/seq_cmd.py +129 -0
- vools-0.2.2/vools/api/typer_app.py +61 -0
- vools-0.2.2/vools/bridge/__init__.py +735 -0
- vools-0.2.2/vools/bridge/_base.py +1383 -0
- vools-0.2.2/vools/bridge/_examples.py +252 -0
- vools-0.2.2/vools/bridge/c/__init__.py +737 -0
- vools-0.2.2/vools/bridge/cangjie/__init__.py +104 -0
- vools-0.2.2/vools/bridge/cangjie/compiler.py +516 -0
- vools-0.2.2/vools/bridge/cangjie/loader.py +259 -0
- vools-0.2.2/vools/bridge/cangjie/templates.py +206 -0
- vools-0.2.2/vools/bridge/cangjie/types.py +176 -0
- vools-0.2.2/vools/bridge/core/__init__.py +63 -0
- vools-0.2.2/vools/bridge/core/decorators.py +426 -0
- vools-0.2.2/vools/bridge/core/loader.py +260 -0
- vools-0.2.2/vools/bridge/core/serialization.py +79 -0
- vools-0.2.2/vools/bridge/core/sigcache.py +602 -0
- vools-0.2.2/vools/bridge/core/types.py +192 -0
- vools-0.2.2/vools/bridge/cpp/__init__.py +812 -0
- vools-0.2.2/vools/bridge/csharp/__init__.py +63 -0
- vools-0.2.2/vools/bridge/csharp/compiler.py +562 -0
- vools-0.2.2/vools/bridge/csharp/loader.py +39 -0
- vools-0.2.2/vools/bridge/csharp/templates.py +101 -0
- vools-0.2.2/vools/bridge/csharp/types.py +115 -0
- vools-0.2.2/vools/bridge/dart/__init__.py +28 -0
- vools-0.2.2/vools/bridge/dart/compiler.py +782 -0
- vools-0.2.2/vools/bridge/dart/types.py +29 -0
- vools-0.2.2/vools/bridge/freebasic/__init__.py +91 -0
- vools-0.2.2/vools/bridge/freebasic/compiler.py +664 -0
- vools-0.2.2/vools/bridge/freebasic/loader.py +39 -0
- vools-0.2.2/vools/bridge/freebasic/transport.py +200 -0
- vools-0.2.2/vools/bridge/freebasic/types.py +159 -0
- vools-0.2.2/vools/bridge/go/__init__.py +119 -0
- vools-0.2.2/vools/bridge/go/compiler.py +871 -0
- vools-0.2.2/vools/bridge/java/__init__.py +60 -0
- vools-0.2.2/vools/bridge/java/compiler.py +609 -0
- vools-0.2.2/vools/bridge/java/decorator.py +547 -0
- vools-0.2.2/vools/bridge/java/loader.py +559 -0
- vools-0.2.2/vools/bridge/java/types.py +371 -0
- vools-0.2.2/vools/bridge/julia/__init__.py +117 -0
- vools-0.2.2/vools/bridge/julia/_loader.py +205 -0
- vools-0.2.2/vools/bridge/julia/compiler.py +906 -0
- vools-0.2.2/vools/bridge/julia/decorator.py +136 -0
- vools-0.2.2/vools/bridge/julia/templates.py +222 -0
- vools-0.2.2/vools/bridge/julia/types.py +322 -0
- vools-0.2.2/vools/bridge/kotlin/__init__.py +32 -0
- vools-0.2.2/vools/bridge/kotlin/compiler.py +541 -0
- vools-0.2.2/vools/bridge/kotlin/types.py +28 -0
- vools-0.2.2/vools/bridge/lua/__init__.py +59 -0
- vools-0.2.2/vools/bridge/lua/compiler.py +829 -0
- vools-0.2.2/vools/bridge/lua/types.py +48 -0
- vools-0.2.2/vools/bridge/manager.py +1327 -0
- vools-0.2.2/vools/bridge/mojo/__init__.py +106 -0
- vools-0.2.2/vools/bridge/mojo/compiler.py +696 -0
- vools-0.2.2/vools/bridge/mojo/loader.py +42 -0
- vools-0.2.2/vools/bridge/mojo/templates.py +133 -0
- vools-0.2.2/vools/bridge/mojo/transport.py +216 -0
- vools-0.2.2/vools/bridge/mojo/types.py +202 -0
- vools-0.2.2/vools/bridge/moonbit/__init__.py +17 -0
- vools-0.2.2/vools/bridge/moonbit/compiler.py +545 -0
- vools-0.2.2/vools/bridge/moonbit/types.py +45 -0
- vools-0.2.2/vools/bridge/nim/__init__.py +64 -0
- vools-0.2.2/vools/bridge/nim/_loader.py +169 -0
- vools-0.2.2/vools/bridge/nim/compiler.py +524 -0
- vools-0.2.2/vools/bridge/nim/crypto.py +94 -0
- vools-0.2.2/vools/bridge/nim/curried.py +292 -0
- vools-0.2.2/vools/bridge/nim/datetime.py +198 -0
- vools-0.2.2/vools/bridge/nim/encoding.py +67 -0
- vools-0.2.2/vools/bridge/nim/seq.py +295 -0
- vools-0.2.2/vools/bridge/perl/__init__.py +28 -0
- vools-0.2.2/vools/bridge/perl/compiler.py +770 -0
- vools-0.2.2/vools/bridge/perl/types.py +28 -0
- vools-0.2.2/vools/bridge/php/__init__.py +28 -0
- vools-0.2.2/vools/bridge/php/compiler.py +734 -0
- vools-0.2.2/vools/bridge/php/types.py +31 -0
- vools-0.2.2/vools/bridge/powershell/__init__.py +28 -0
- vools-0.2.2/vools/bridge/powershell/compiler.py +800 -0
- vools-0.2.2/vools/bridge/powershell/types.py +28 -0
- vools-0.2.2/vools/bridge/probe.py +736 -0
- vools-0.2.2/vools/bridge/r/__init__.py +91 -0
- vools-0.2.2/vools/bridge/r/compiler.py +724 -0
- vools-0.2.2/vools/bridge/r/loader.py +75 -0
- vools-0.2.2/vools/bridge/r/templates.py +211 -0
- vools-0.2.2/vools/bridge/r/types.py +229 -0
- vools-0.2.2/vools/bridge/ruby/__init__.py +154 -0
- vools-0.2.2/vools/bridge/ruby/compiler.py +672 -0
- vools-0.2.2/vools/bridge/rust/__init__.py +67 -0
- vools-0.2.2/vools/bridge/rust/_loader.py +67 -0
- vools-0.2.2/vools/bridge/rust/compiler.py +623 -0
- vools-0.2.2/vools/bridge/rust/decorator.py +53 -0
- vools-0.2.2/vools/bridge/rust/templates.py +242 -0
- vools-0.2.2/vools/bridge/rust/types.py +219 -0
- vools-0.2.2/vools/bridge/scala/__init__.py +63 -0
- vools-0.2.2/vools/bridge/scala/compiler.py +672 -0
- vools-0.2.2/vools/bridge/scala/decorator.py +616 -0
- vools-0.2.2/vools/bridge/scala/loader.py +562 -0
- vools-0.2.2/vools/bridge/scala/types.py +445 -0
- vools-0.2.2/vools/bridge/scala/utils.py +354 -0
- vools-0.2.2/vools/bridge/shell/__init__.py +32 -0
- vools-0.2.2/vools/bridge/shell/compiler.py +584 -0
- vools-0.2.2/vools/bridge/shell/types.py +26 -0
- vools-0.2.2/vools/bridge/swift/__init__.py +28 -0
- vools-0.2.2/vools/bridge/swift/compiler.py +460 -0
- vools-0.2.2/vools/bridge/swift/types.py +30 -0
- vools-0.2.2/vools/bridge/typescript/__init__.py +94 -0
- vools-0.2.2/vools/bridge/typescript/compiler.py +543 -0
- vools-0.2.2/vools/bridge/vbnet/__init__.py +60 -0
- vools-0.2.2/vools/bridge/vbnet/compiler.py +341 -0
- vools-0.2.2/vools/bridge/vbnet/templates.py +99 -0
- vools-0.2.2/vools/bridge/vbnet/types.py +108 -0
- vools-0.2.2/vools/bridge/vbscript/__init__.py +28 -0
- vools-0.2.2/vools/bridge/vbscript/compiler.py +811 -0
- vools-0.2.2/vools/bridge/vbscript/types.py +28 -0
- vools-0.2.2/vools/bridge/zig/__init__.py +28 -0
- vools-0.2.2/vools/bridge/zig/compiler.py +411 -0
- vools-0.2.2/vools/bridge/zig/types.py +34 -0
- {vools-0.2.0 → vools-0.2.2}/vools/cache/memorize.py +1 -1
- {vools-0.2.0 → vools-0.2.2}/vools/cache/sigcache.py +1 -1
- vools-0.2.2/vools/core/asyncio_compat.py +122 -0
- {vools-0.2.0 → vools-0.2.2}/vools/core/dataclass_compat.py +19 -3
- vools-0.2.2/vools/core/datetime_compat.py +180 -0
- vools-0.2.2/vools/core/inspect_compat.py +50 -0
- {vools-0.2.0 → vools-0.2.2}/vools/data/vlist.py +3 -3
- {vools-0.2.0 → vools-0.2.2}/vools/datetime/__init__.py +9 -1
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/__init__.py +9 -1
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/cache.py +1 -1
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/rself.py +4 -0
- {vools-0.2.0 → vools-0.2.2}/vools/functional/iif.py +2 -2
- {vools-0.2.0 → vools-0.2.2}/vools/functional/pipe_ops.py +10 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/core/schedulers.py +2 -1
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/operators/extended_operators.py +7 -6
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/operators/operators.py +3 -2
- {vools-0.2.0 → vools-0.2.2}/vools/security/safe_eval.py +9 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/codec.py +9 -4
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/type_registry.py +5 -3
- vools-0.2.2/vools/sql/__init__.py +234 -0
- vools-0.2.2/vools/sql/core/__init__.py +51 -0
- vools-0.2.2/vools/sql/core/builder.py +819 -0
- vools-0.2.2/vools/sql/core/config.py +45 -0
- vools-0.2.2/vools/sql/core/connection.py +193 -0
- vools-0.2.2/vools/sql/core/decorators.py +408 -0
- vools-0.2.2/vools/sql/core/dialect.py +173 -0
- vools-0.2.2/vools/sql/core/result.py +431 -0
- vools-0.2.2/vools/sql/core/types.py +235 -0
- vools-0.2.2/vools/sql/manager.py +567 -0
- vools-0.2.2/vools/sql/postgres/__init__.py +88 -0
- vools-0.2.2/vools/sql/postgres/connection.py +251 -0
- vools-0.2.2/vools/sql/postgres/dialect.py +170 -0
- vools-0.2.2/vools/sql/spark/__init__.py +132 -0
- vools-0.2.2/vools/sql/spark/connection.py +500 -0
- vools-0.2.2/vools/sql/spark/dialect.py +176 -0
- vools-0.2.2/vools/sql/spark/scala_bridge.py +309 -0
- vools-0.2.2/vools/sql/sqlite/__init__.py +80 -0
- vools-0.2.2/vools/sql/sqlite/connection.py +214 -0
- vools-0.2.2/vools/sql/sqlite/dialect.py +166 -0
- {vools-0.2.0 → vools-0.2.2}/vools/task/core/models.py +6 -5
- {vools-0.2.0 → vools-0.2.2}/vools/task/core/storage.py +18 -10
- {vools-0.2.0 → vools-0.2.2}/vools/task/rules/dag.py +2 -2
- {vools-0.2.0 → vools-0.2.2}/vools/task/rules/engine.py +3 -3
- {vools-0.2.0 → vools-0.2.2}/vools/utils/stuff.py +13 -1
- {vools-0.2.0 → vools-0.2.2/vools.egg-info}/PKG-INFO +21 -4
- {vools-0.2.0 → vools-0.2.2}/vools.egg-info/SOURCES.txt +142 -28
- vools-0.2.0/tests/benchmark_curry.py +0 -179
- vools-0.2.0/tests/benchmark_curry_optimized.py +0 -226
- vools-0.2.0/tests/benchmark_modules.py +0 -190
- vools-0.2.0/tests/benchmark_placeholder.py +0 -176
- vools-0.2.0/tests/benchmark_reactive.py +0 -176
- vools-0.2.0/tests/benchmark_signature_cache.py +0 -230
- vools-0.2.0/tests/compare_rxpy_vools.py +0 -190
- vools-0.2.0/tests/compare_with_rx_spec.py +0 -251
- vools-0.2.0/tests/debug_curry.py +0 -26
- vools-0.2.0/tests/explore_rxpy_api.py +0 -180
- vools-0.2.0/tests/test_box.py +0 -238
- vools-0.2.0/tests/test_crypto.py +0 -153
- vools-0.2.0/tests/test_csharp_bridge.py +0 -258
- vools-0.2.0/tests/test_curried_performance.py +0 -316
- vools-0.2.0/tests/test_do.py +0 -41
- vools-0.2.0/tests/test_encoding.py +0 -111
- vools-0.2.0/tests/test_functional.py +0 -231
- vools-0.2.0/tests/test_functional_simple.py +0 -231
- vools-0.2.0/tests/test_import.py +0 -26
- vools-0.2.0/tests/test_itor.py +0 -662
- vools-0.2.0/tests/test_main_import.py +0 -70
- vools-0.2.0/tests/test_new_features.py +0 -68
- vools-0.2.0/tests/test_r_bridge.py +0 -399
- vools-0.2.0/tests/test_rust_async.py +0 -146
- vools-0.2.0/tests/test_rust_async_quick.py +0 -139
- vools-0.2.0/tests/test_rust_decorator.py +0 -246
- vools-0.2.0/tests/test_stuff.py +0 -165
- vools-0.2.0/tests/test_vools.py +0 -181
- {vools-0.2.0 → vools-0.2.2}/LICENSE +0 -0
- {vools-0.2.0 → vools-0.2.2}/NOTICE +0 -0
- {vools-0.2.0 → vools-0.2.2}/autopypi/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/autopypi/config.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/autopypi/environment.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/autopypi/fabfile.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/autopypi/logger.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/autopypi/packaging.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/autopypi/publishing.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/autopypi/release.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/autopypi/versioning.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/setup.cfg +0 -0
- {vools-0.2.0 → vools-0.2.2}/tests/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/tests/_serialize_helpers.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/tests/conftest.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/tests/test_functions.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/README.md +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/__main__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/_logging.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/_nim_crypto.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/_nim_curried.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/_nim_datetime.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/_nim_encoding.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/_nim_loader.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/_nim_seq.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/cache/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/cache/once.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/cache/persist.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/config.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/config.template.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/core/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/core/base.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/core/config.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/core/exceptions.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/crypto/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/crypto/core.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/curried/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/curried/collection.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/curried/composition.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/curried/core.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/curried/iteration.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/curried/math.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/curried/predicate.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/curried/string.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/data/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/data/itor.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/data/seq.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/data/vtext.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/datetime/dates_format.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/datetime/utils.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/datetime/vdate_class.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/control.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/curried.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/curry_core.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/curry_decorator.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/curry_delay.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/lazy.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/overcurry.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/overload.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/overloads.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/selector.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/shotcut.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/decorators/trd.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/encoding/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/encoding/core.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/functional/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/functional/arrow_func.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/functional/box.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/functional/funcs.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/functional/placeholder.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/functional/placeholder_impl.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/functional/result.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/libgcc_s_seh-1.dll +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/libstdc++-6.dll +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/libwinpthread-1.dll +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/linux/libvools_crypto.so +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/linux/libvools_curried.so +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/linux/libvools_datetime.so +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/linux/libvools_encoding.so +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/linux/libvools_seq.so +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/vools_crypto.dll +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/vools_curried.dll +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/vools_datetime.dll +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/vools_encoding.dll +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/lib/vools_seq.dll +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/oop/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/oop/calltype.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/oop/extend.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/oop/fusion.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/oop/method_extend.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/oop/mixer.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/oop/selector.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/core/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/core/connectable.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/core/object_pool.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/core/observable.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/core/subject.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/monitoring/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/monitoring/_monitoring.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/monitoring/clipboard.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/monitoring/file_watcher.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/monitoring/folder_watcher.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/monitoring/keyboard.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/monitoring/monitor_observer.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/monitoring/monitor_subject.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/monitoring/mouse.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/operators/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/operators/monitor_operators.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/reactive/operators/stats_operators.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/security/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/security/_constants.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/security/expression_handler.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/backends/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/backends/base.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/backends/json_backend.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/backends/msgpack_backend.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/backends/pickle_backend.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/callable/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/callable/decorator_handler.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/callable/functional_handler.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/config.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/context.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/core.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/decorators.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/serialize/sentinel.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/sys/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/sys/compile_cmd.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/sys/dll.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/sys/dll_cmd.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/sys/env_cmd.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/sys/exe.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/sys/fire_app.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/sys/run_cmd.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/task/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/task/core/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/task/core/queue.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/task/core/worker.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/task/decorators/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/task/decorators/task_decorator.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/task/rules/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/task/rules/rule.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/task/utils/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/utils/__init__.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/utils/hoder.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools/utils/tools.py +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools.egg-info/dependency_links.txt +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools.egg-info/entry_points.txt +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools.egg-info/requires.txt +0 -0
- {vools-0.2.0 → vools-0.2.2}/vools.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vools
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Python 函数式编程工具集
|
|
5
5
|
Author-email: Victor <victortop921129@gmail.com>
|
|
6
6
|
License: Apache License
|
|
@@ -264,6 +264,7 @@ Dynamic: license-file
|
|
|
264
264
|
- **任务调度**: TaskQueue、WorkerPool、DAG 调度器
|
|
265
265
|
- **序列化**: 支持 JSON、MsgPack、Pickle 等多种格式
|
|
266
266
|
- **编码/加密**: Base64、URL 编码、哈希函数
|
|
267
|
+
- **多语言桥接**: 支持 27 种编程语言(Lua、Rust、Go、Java、Kotlin、Swift、Dart、MoonBit 等),统一装饰器接口
|
|
267
268
|
|
|
268
269
|
## 安装
|
|
269
270
|
|
|
@@ -281,12 +282,12 @@ pip install .
|
|
|
281
282
|
|
|
282
283
|
### 环境要求
|
|
283
284
|
|
|
284
|
-
- Python 3.
|
|
285
|
+
- Python 3.6+
|
|
285
286
|
|
|
286
287
|
### 依赖
|
|
287
288
|
|
|
288
|
-
- `
|
|
289
|
-
- `
|
|
289
|
+
- `attrs >= 22.1` (Python < 3.7 时需要,用于 dataclass 兼容)
|
|
290
|
+
- `contextvars` (Python < 3.7 时需要)
|
|
290
291
|
|
|
291
292
|
## 快速开始
|
|
292
293
|
|
|
@@ -387,6 +388,20 @@ print(result) # [4, 8]
|
|
|
387
388
|
|
|
388
389
|
```
|
|
389
390
|
vools/
|
|
391
|
+
├── api/ # CLI 命令行接口
|
|
392
|
+
├── bridge/ # 多语言桥接(27种语言)
|
|
393
|
+
│ ├── core/ # 桥接核心(类型、签名缓存、装饰器)
|
|
394
|
+
│ ├── lua/ # Lua 桥接
|
|
395
|
+
│ ├── rust/ # Rust 桥接
|
|
396
|
+
│ ├── go/ # Go 桥接
|
|
397
|
+
│ ├── java/ # Java 桥接
|
|
398
|
+
│ ├── kotlin/ # Kotlin 桥接
|
|
399
|
+
│ ├── swift/ # Swift 桥接
|
|
400
|
+
│ ├── dart/ # Dart 桥接
|
|
401
|
+
│ ├── moonbit/ # MoonBit 桥接
|
|
402
|
+
│ ├── c/ # C 桥接
|
|
403
|
+
│ ├── cpp/ # C++ 桥接
|
|
404
|
+
│ └── ... # 更多语言
|
|
390
405
|
├── cache/ # 缓存装饰器
|
|
391
406
|
│ ├── memorize # 时间缓存
|
|
392
407
|
│ ├── once # 单次执行
|
|
@@ -421,6 +436,8 @@ vools/
|
|
|
421
436
|
├── recorder/ # 录制回放
|
|
422
437
|
├── security/ # 安全模块
|
|
423
438
|
├── serialize/ # 序列化
|
|
439
|
+
├── sql/ # SQL 工具
|
|
440
|
+
├── sys/ # 系统工具
|
|
424
441
|
├── task/ # 任务调度
|
|
425
442
|
└── utils/ # 通用工具
|
|
426
443
|
```
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
- **任务调度**: TaskQueue、WorkerPool、DAG 调度器
|
|
16
16
|
- **序列化**: 支持 JSON、MsgPack、Pickle 等多种格式
|
|
17
17
|
- **编码/加密**: Base64、URL 编码、哈希函数
|
|
18
|
+
- **多语言桥接**: 支持 27 种编程语言(Lua、Rust、Go、Java、Kotlin、Swift、Dart、MoonBit 等),统一装饰器接口
|
|
18
19
|
|
|
19
20
|
## 安装
|
|
20
21
|
|
|
@@ -32,12 +33,12 @@ pip install .
|
|
|
32
33
|
|
|
33
34
|
### 环境要求
|
|
34
35
|
|
|
35
|
-
- Python 3.
|
|
36
|
+
- Python 3.6+
|
|
36
37
|
|
|
37
38
|
### 依赖
|
|
38
39
|
|
|
39
|
-
- `
|
|
40
|
-
- `
|
|
40
|
+
- `attrs >= 22.1` (Python < 3.7 时需要,用于 dataclass 兼容)
|
|
41
|
+
- `contextvars` (Python < 3.7 时需要)
|
|
41
42
|
|
|
42
43
|
## 快速开始
|
|
43
44
|
|
|
@@ -138,6 +139,20 @@ print(result) # [4, 8]
|
|
|
138
139
|
|
|
139
140
|
```
|
|
140
141
|
vools/
|
|
142
|
+
├── api/ # CLI 命令行接口
|
|
143
|
+
├── bridge/ # 多语言桥接(27种语言)
|
|
144
|
+
│ ├── core/ # 桥接核心(类型、签名缓存、装饰器)
|
|
145
|
+
│ ├── lua/ # Lua 桥接
|
|
146
|
+
│ ├── rust/ # Rust 桥接
|
|
147
|
+
│ ├── go/ # Go 桥接
|
|
148
|
+
│ ├── java/ # Java 桥接
|
|
149
|
+
│ ├── kotlin/ # Kotlin 桥接
|
|
150
|
+
│ ├── swift/ # Swift 桥接
|
|
151
|
+
│ ├── dart/ # Dart 桥接
|
|
152
|
+
│ ├── moonbit/ # MoonBit 桥接
|
|
153
|
+
│ ├── c/ # C 桥接
|
|
154
|
+
│ ├── cpp/ # C++ 桥接
|
|
155
|
+
│ └── ... # 更多语言
|
|
141
156
|
├── cache/ # 缓存装饰器
|
|
142
157
|
│ ├── memorize # 时间缓存
|
|
143
158
|
│ ├── once # 单次执行
|
|
@@ -172,6 +187,8 @@ vools/
|
|
|
172
187
|
├── recorder/ # 录制回放
|
|
173
188
|
├── security/ # 安全模块
|
|
174
189
|
├── serialize/ # 序列化
|
|
190
|
+
├── sql/ # SQL 工具
|
|
191
|
+
├── sys/ # 系统工具
|
|
175
192
|
├── task/ # 任务调度
|
|
176
193
|
└── utils/ # 通用工具
|
|
177
194
|
```
|
|
@@ -76,9 +76,10 @@ vools = "vools.__main__:main"
|
|
|
76
76
|
"Repository" = "https://github.com/vicTop-cw/vools"
|
|
77
77
|
"Issues" = "https://github.com/vicTop-cw/vools/issues"
|
|
78
78
|
|
|
79
|
-
# ============ setuptools:
|
|
80
|
-
[tool.setuptools]
|
|
81
|
-
|
|
79
|
+
# ============ setuptools: 自动发现所有包 ============
|
|
80
|
+
[tool.setuptools.packages.find]
|
|
81
|
+
include = ["vools*"]
|
|
82
|
+
exclude = ["vools.__pycache__", "vools.*.__pycache__"]
|
|
82
83
|
|
|
83
84
|
[tool.setuptools.dynamic]
|
|
84
85
|
version = { attr = "vools.__version__" }
|
|
@@ -7,7 +7,7 @@ vools - Python 函数式编程工具集
|
|
|
7
7
|
import importlib
|
|
8
8
|
from typing import Any
|
|
9
9
|
|
|
10
|
-
__version__ = "0.2.
|
|
10
|
+
__version__ = "0.2.2"
|
|
11
11
|
__author__ = "Victor"
|
|
12
12
|
__license__ = "Apache 2.0"
|
|
13
13
|
|
|
@@ -514,6 +514,44 @@ __all__ = [
|
|
|
514
514
|
'VDate',
|
|
515
515
|
]
|
|
516
516
|
|
|
517
|
+
# Python 3.6 兼容:模块级 __getattr__ 和 __dir__ 是 3.7+ 才有的
|
|
518
|
+
# 在 3.6 中需要主动导入所有延迟加载的名称
|
|
519
|
+
import sys as _sys
|
|
520
|
+
if _sys.version_info < (3, 7):
|
|
521
|
+
for _name in _lazy_modules:
|
|
522
|
+
if _name not in globals():
|
|
523
|
+
try:
|
|
524
|
+
_module_path = _lazy_modules[_name]
|
|
525
|
+
_module = importlib.import_module(_module_path, package='vools')
|
|
526
|
+
if hasattr(_module, _name):
|
|
527
|
+
globals()[_name] = getattr(_module, _name)
|
|
528
|
+
else:
|
|
529
|
+
globals()[_name] = _module
|
|
530
|
+
except Exception:
|
|
531
|
+
pass
|
|
532
|
+
# VList, VText, VDate
|
|
533
|
+
for _vname in ('VList', 'VText', 'VDate'):
|
|
534
|
+
if _vname not in globals():
|
|
535
|
+
try:
|
|
536
|
+
if _vname == 'VList':
|
|
537
|
+
from .data.vlist import VList as _v
|
|
538
|
+
globals()['VList'] = _v
|
|
539
|
+
elif _vname == 'VText':
|
|
540
|
+
from .data.vtext import VText as _v
|
|
541
|
+
globals()['VText'] = _v
|
|
542
|
+
elif _vname == 'VDate':
|
|
543
|
+
from .datetime.vdate_class import VDate as _v
|
|
544
|
+
globals()['VDate'] = _v
|
|
545
|
+
except Exception:
|
|
546
|
+
pass
|
|
547
|
+
# vicTools, vicDate, vicText, vicList
|
|
548
|
+
try:
|
|
549
|
+
_load_vic()
|
|
550
|
+
for _vk, _vv in _vic_classes.items():
|
|
551
|
+
globals()[_vk] = _vv
|
|
552
|
+
except Exception:
|
|
553
|
+
pass
|
|
554
|
+
|
|
517
555
|
if __name__ == '__main__':
|
|
518
556
|
print(f"vools version: {__version__}")
|
|
519
557
|
print(f"Available exports: {len(__all__)} items")
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""
|
|
2
|
+
vools.api - Typer CLI 应用包
|
|
3
|
+
|
|
4
|
+
导出 Typer 应用实例,提供命令行接口。
|
|
5
|
+
|
|
6
|
+
子命令:
|
|
7
|
+
- seq: Seq 序列操作
|
|
8
|
+
- ops: Ops 管道操作
|
|
9
|
+
- curry: 函数柯里化
|
|
10
|
+
- memoize: 函数记忆化
|
|
11
|
+
|
|
12
|
+
示例:
|
|
13
|
+
from vools.api import typer_app
|
|
14
|
+
typer_app()
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from .typer_app import typer_app, main, info
|
|
18
|
+
|
|
19
|
+
__all__ = ["typer_app", "main", "info"]
|
|
20
|
+
|
|
21
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"""
|
|
2
|
+
curry 子命令 - 函数柯里化 CLI
|
|
3
|
+
|
|
4
|
+
用法示例:
|
|
5
|
+
vools curry --func "lambda x, y: x + y" --args 5 10
|
|
6
|
+
vools curry --func "lambda a, b, c: a * b * c" --args 2 3 4
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Optional, List, Callable
|
|
10
|
+
import typer
|
|
11
|
+
from typing_extensions import Annotated
|
|
12
|
+
|
|
13
|
+
from vools.decorators import curry
|
|
14
|
+
|
|
15
|
+
curry_app = typer.Typer(help="Curry 柯里化命令")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def parse_lambda_or_func(expr: str):
|
|
19
|
+
"""解析 lambda 表达式或函数名"""
|
|
20
|
+
try:
|
|
21
|
+
return eval(expr, {"__builtins__": {}})
|
|
22
|
+
except Exception:
|
|
23
|
+
# 如果是函数名,尝试从全局查找
|
|
24
|
+
import builtins
|
|
25
|
+
if hasattr(builtins, expr):
|
|
26
|
+
return getattr(builtins, expr)
|
|
27
|
+
raise ValueError(f"无法解析表达式: {expr}")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@curry_app.command()
|
|
31
|
+
def call(
|
|
32
|
+
func_expr: str = typer.Argument(..., help="函数表达式,如: lambda x, y: x + y"),
|
|
33
|
+
args: List[str] = typer.Argument(..., help="函数参数"),
|
|
34
|
+
kwargs: Annotated[
|
|
35
|
+
Optional[List[str]],
|
|
36
|
+
typer.Option("--kwargs", "-k", help="关键字参数,格式: key=value")
|
|
37
|
+
] = None,
|
|
38
|
+
):
|
|
39
|
+
"""调用柯里化函数"""
|
|
40
|
+
func = parse_lambda_or_func(func_expr)
|
|
41
|
+
|
|
42
|
+
# 解析参数
|
|
43
|
+
parsed_args = []
|
|
44
|
+
for arg in args:
|
|
45
|
+
try:
|
|
46
|
+
parsed_args.append(eval(arg, {"__builtins__": {}}))
|
|
47
|
+
except Exception:
|
|
48
|
+
parsed_args.append(arg)
|
|
49
|
+
|
|
50
|
+
# 解析关键字参数
|
|
51
|
+
parsed_kwargs = {}
|
|
52
|
+
if kwargs:
|
|
53
|
+
for kw in kwargs:
|
|
54
|
+
if "=" in kw:
|
|
55
|
+
key, value = kw.split("=", 1)
|
|
56
|
+
try:
|
|
57
|
+
parsed_kwargs[key] = eval(value, {"__builtins__": {}})
|
|
58
|
+
except Exception:
|
|
59
|
+
parsed_kwargs[key] = value
|
|
60
|
+
|
|
61
|
+
# 应用 curry 装饰器
|
|
62
|
+
curried_func = curry(func)
|
|
63
|
+
|
|
64
|
+
# 调用
|
|
65
|
+
if parsed_kwargs:
|
|
66
|
+
result = curried_func(*parsed_args, **parsed_kwargs)
|
|
67
|
+
else:
|
|
68
|
+
result = curried_func(*parsed_args)
|
|
69
|
+
|
|
70
|
+
typer.echo(f"结果: {result}")
|
|
71
|
+
return result
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@curry_app.command()
|
|
75
|
+
def curry_func(
|
|
76
|
+
func_expr: str = typer.Argument(..., help="函数表达式"),
|
|
77
|
+
):
|
|
78
|
+
"""将函数柯里化并显示"""
|
|
79
|
+
func = parse_lambda_or_func(func_expr)
|
|
80
|
+
curried = curry(func)
|
|
81
|
+
typer.echo(f"原始函数: {func}")
|
|
82
|
+
typer.echo(f"柯里化函数: {curried}")
|
|
83
|
+
|
|
84
|
+
# 尝试调用示例
|
|
85
|
+
try:
|
|
86
|
+
if hasattr(func, "__code__") and func.__code__.co_argcount >= 2:
|
|
87
|
+
# 如果是多参数函数,展示分步调用
|
|
88
|
+
args_example = ["arg1", "arg2"]
|
|
89
|
+
typer.echo(f"\n示例调用:")
|
|
90
|
+
typer.echo(f" curried({args_example[0]}) = {curried(args_example[0])}")
|
|
91
|
+
except Exception as e:
|
|
92
|
+
typer.echo(f"无法展示示例: {e}")
|
|
93
|
+
|
|
94
|
+
return curried
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
if __name__ == "__main__":
|
|
98
|
+
typer.run(call)
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"""
|
|
2
|
+
memoize 子命令 - 函数记忆化 CLI
|
|
3
|
+
|
|
4
|
+
用法示例:
|
|
5
|
+
vools memoize --func "lambda x: x * 2" --args 5 --repeat 3
|
|
6
|
+
vools memoize --func "my_func" --args 10 --repeat 5
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Optional, List, Callable
|
|
10
|
+
import time
|
|
11
|
+
import typer
|
|
12
|
+
from typing_extensions import Annotated
|
|
13
|
+
|
|
14
|
+
from vools import memorize
|
|
15
|
+
|
|
16
|
+
memoize_app = typer.Typer(help="Memoize 记忆化命令")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def parse_lambda_or_func(expr: str) -> Callable:
|
|
20
|
+
"""解析 lambda 表达式或函数名"""
|
|
21
|
+
try:
|
|
22
|
+
return eval(expr, {"__builtins__": {}})
|
|
23
|
+
except Exception:
|
|
24
|
+
import builtins
|
|
25
|
+
if hasattr(builtins, expr):
|
|
26
|
+
return getattr(builtins, expr)
|
|
27
|
+
raise ValueError(f"无法解析表达式: {expr}")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def timing_decorator(func: Callable) -> Callable:
|
|
31
|
+
"""计时装饰器"""
|
|
32
|
+
def wrapper(*args, **kwargs):
|
|
33
|
+
start = time.time()
|
|
34
|
+
result = func(*args, **kwargs)
|
|
35
|
+
elapsed = time.time() - start
|
|
36
|
+
return result, elapsed
|
|
37
|
+
return wrapper
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@memoize_app.command()
|
|
41
|
+
def call(
|
|
42
|
+
func_expr: str = typer.Argument(..., help="函数表达式,如: lambda x: x * 2"),
|
|
43
|
+
args: List[str] = typer.Argument(..., help="函数参数"),
|
|
44
|
+
repeat: int = typer.Option(1, "--repeat", "-r", help="重复调用次数"),
|
|
45
|
+
show_cache: bool = typer.Option(False, "--show-cache/--no-show-cache", help="显示缓存状态"),
|
|
46
|
+
):
|
|
47
|
+
"""调用记忆化函数并测量性能"""
|
|
48
|
+
func = parse_lambda_or_func(func_expr)
|
|
49
|
+
|
|
50
|
+
# 解析参数
|
|
51
|
+
parsed_args = []
|
|
52
|
+
for arg in args:
|
|
53
|
+
try:
|
|
54
|
+
parsed_args.append(eval(arg, {"__builtins__": {}}))
|
|
55
|
+
except Exception:
|
|
56
|
+
parsed_args.append(arg)
|
|
57
|
+
|
|
58
|
+
# 应用 memorize 装饰器
|
|
59
|
+
memorized_func = memorize(func)
|
|
60
|
+
|
|
61
|
+
typer.echo(f"函数: {func_expr}")
|
|
62
|
+
typer.echo(f"参数: {parsed_args}")
|
|
63
|
+
typer.echo(f"重复次数: {repeat}")
|
|
64
|
+
typer.echo("-" * 40)
|
|
65
|
+
|
|
66
|
+
total_time = 0
|
|
67
|
+
results = []
|
|
68
|
+
|
|
69
|
+
for i in range(repeat):
|
|
70
|
+
result, elapsed = timing_decorator(memorized_func)(*parsed_args)
|
|
71
|
+
results.append(result)
|
|
72
|
+
total_time += elapsed
|
|
73
|
+
|
|
74
|
+
cache_status = "缓存命中" if i > 0 else "首次计算"
|
|
75
|
+
typer.echo(f"第 {i+1} 次: 结果={result}, 耗时={elapsed:.6f}s, {cache_status}")
|
|
76
|
+
|
|
77
|
+
typer.echo("-" * 40)
|
|
78
|
+
typer.echo(f"平均耗时: {total_time/repeat:.6f}s")
|
|
79
|
+
typer.echo(f"结果一致: {len(set(results)) == 1}")
|
|
80
|
+
|
|
81
|
+
return results[0]
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@memoize_app.command()
|
|
85
|
+
def benchmark(
|
|
86
|
+
func_expr: str = typer.Argument(..., help="函数表达式"),
|
|
87
|
+
args: List[str] = typer.Argument(..., help="函数参数"),
|
|
88
|
+
iterations: int = typer.Option(100, "--iterations", "-n", help="基准测试迭代次数"),
|
|
89
|
+
):
|
|
90
|
+
"""基准测试记忆化函数"""
|
|
91
|
+
func = parse_lambda_or_func(func_expr)
|
|
92
|
+
|
|
93
|
+
# 解析参数
|
|
94
|
+
parsed_args = []
|
|
95
|
+
for arg in args:
|
|
96
|
+
try:
|
|
97
|
+
parsed_args.append(eval(arg, {"__builtins__": {}}))
|
|
98
|
+
except Exception:
|
|
99
|
+
parsed_args.append(arg)
|
|
100
|
+
|
|
101
|
+
# 应用 memorize 装饰器
|
|
102
|
+
memorized_func = memorize(func)
|
|
103
|
+
|
|
104
|
+
# 预热
|
|
105
|
+
for _ in range(10):
|
|
106
|
+
memorized_func(*parsed_args)
|
|
107
|
+
|
|
108
|
+
# 基准测试
|
|
109
|
+
start = time.time()
|
|
110
|
+
for _ in range(iterations):
|
|
111
|
+
memorized_func(*parsed_args)
|
|
112
|
+
elapsed = time.time() - start
|
|
113
|
+
|
|
114
|
+
typer.echo(f"函数: {func_expr}")
|
|
115
|
+
typer.echo(f"参数: {parsed_args}")
|
|
116
|
+
typer.echo(f"迭代次数: {iterations}")
|
|
117
|
+
typer.echo(f"总耗时: {elapsed:.4f}s")
|
|
118
|
+
typer.echo(f"平均每次: {elapsed/iterations*1000:.4f}ms")
|
|
119
|
+
typer.echo(f"每秒操作数: {iterations/elapsed:.2f}")
|
|
120
|
+
|
|
121
|
+
return elapsed
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
if __name__ == "__main__":
|
|
125
|
+
typer.run(call)
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"""
|
|
2
|
+
ops 子命令 - Ops 管道操作 CLI
|
|
3
|
+
|
|
4
|
+
用法示例:
|
|
5
|
+
vools ops --pipe 1 2 3 4 5 --filter "lambda x: x % 2 == 0"
|
|
6
|
+
vools ops --pipe 1 2 3 4 5 --map "lambda x: x * 2" --sum
|
|
7
|
+
vools ops --pipe 1 2 3 4 5 6 7 8 9 10 --filter "lambda x: x % 2 == 0" --map "lambda x: x ** 2" --sum
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from typing import Optional, List, Callable
|
|
11
|
+
import typer
|
|
12
|
+
from typing_extensions import Annotated
|
|
13
|
+
|
|
14
|
+
from vools.functional import Ops, O
|
|
15
|
+
|
|
16
|
+
ops_app = typer.Typer(help="Ops 管道操作命令")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def parse_lambda(expr: str) -> Callable:
|
|
20
|
+
"""解析 lambda 表达式字符串"""
|
|
21
|
+
return eval(expr, {"__builtins__": {}})
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@ops_app.command()
|
|
25
|
+
def pipe(
|
|
26
|
+
items: List[int] = typer.Argument(..., help="输入数据列表"),
|
|
27
|
+
filter_expr: Annotated[
|
|
28
|
+
Optional[str],
|
|
29
|
+
typer.Option("--filter", "-f", help="过滤表达式")
|
|
30
|
+
] = None,
|
|
31
|
+
map_expr: Annotated[
|
|
32
|
+
Optional[str],
|
|
33
|
+
typer.Option("--map", "-m", help="映射表达式")
|
|
34
|
+
] = None,
|
|
35
|
+
sum_flag: bool = typer.Option(False, "--sum/--no-sum", help="求和"),
|
|
36
|
+
min_flag: bool = typer.Option(False, "--min/--no-min", help="最小值"),
|
|
37
|
+
max_flag: bool = typer.Option(False, "--max/--no-max", help="最大值"),
|
|
38
|
+
count_flag: bool = typer.Option(False, "--count/--no-count", help="计数"),
|
|
39
|
+
collect_flag: bool = typer.Option(True, "--collect/--no-collect", help="收集为列表"),
|
|
40
|
+
):
|
|
41
|
+
"""管道操作"""
|
|
42
|
+
result = items
|
|
43
|
+
|
|
44
|
+
if filter_expr:
|
|
45
|
+
result = result | Ops.filter(parse_lambda(filter_expr))
|
|
46
|
+
|
|
47
|
+
if map_expr:
|
|
48
|
+
result = result | Ops.map(parse_lambda(map_expr))
|
|
49
|
+
|
|
50
|
+
if sum_flag:
|
|
51
|
+
result = result | Ops.sum
|
|
52
|
+
typer.echo(f"求和结果: {result}")
|
|
53
|
+
return result
|
|
54
|
+
|
|
55
|
+
if min_flag:
|
|
56
|
+
result = result | Ops.min
|
|
57
|
+
typer.echo(f"最小值: {result}")
|
|
58
|
+
return result
|
|
59
|
+
|
|
60
|
+
if max_flag:
|
|
61
|
+
result = result | Ops.max
|
|
62
|
+
typer.echo(f"最大值: {result}")
|
|
63
|
+
return result
|
|
64
|
+
|
|
65
|
+
if count_flag:
|
|
66
|
+
result = result | Ops.count
|
|
67
|
+
typer.echo(f"计数: {result}")
|
|
68
|
+
return result
|
|
69
|
+
|
|
70
|
+
if collect_flag:
|
|
71
|
+
result = result | Ops.as_list
|
|
72
|
+
typer.echo(f"结果: {result}")
|
|
73
|
+
return result
|
|
74
|
+
|
|
75
|
+
typer.echo(f"结果: {result}")
|
|
76
|
+
return result
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@ops_app.command()
|
|
80
|
+
def filter_op(
|
|
81
|
+
items: List[int] = typer.Argument(..., help="输入数据列表"),
|
|
82
|
+
expr: str = typer.Argument(..., help="过滤表达式"),
|
|
83
|
+
):
|
|
84
|
+
"""管道过滤操作"""
|
|
85
|
+
result = items | Ops.filter(parse_lambda(expr)) | Ops.as_list
|
|
86
|
+
typer.echo(f"过滤结果: {result}")
|
|
87
|
+
return result
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@ops_app.command()
|
|
91
|
+
def map_op(
|
|
92
|
+
items: List[int] = typer.Argument(..., help="输入数据列表"),
|
|
93
|
+
expr: str = typer.Argument(..., help="映射表达式"),
|
|
94
|
+
):
|
|
95
|
+
"""管道映射操作"""
|
|
96
|
+
result = items | Ops.map(parse_lambda(expr)) | Ops.as_list
|
|
97
|
+
typer.echo(f"映射结果: {result}")
|
|
98
|
+
return result
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@ops_app.command()
|
|
102
|
+
def sum_op(
|
|
103
|
+
items: List[int] = typer.Argument(..., help="输入数据列表"),
|
|
104
|
+
):
|
|
105
|
+
"""管道求和操作"""
|
|
106
|
+
result = items | Ops.sum
|
|
107
|
+
typer.echo(f"求和结果: {result}")
|
|
108
|
+
return result
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
if __name__ == "__main__":
|
|
112
|
+
typer.run(pipe)
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"""
|
|
2
|
+
seq 子命令 - Seq 序列操作 CLI
|
|
3
|
+
|
|
4
|
+
用法示例:
|
|
5
|
+
vools seq --from-range 10 --filter "lambda x: x % 2 == 0"
|
|
6
|
+
vools seq --from-list 1 2 3 4 5 --map "lambda x: x * 2"
|
|
7
|
+
vools seq --from-range 20 --filter "lambda x: x % 2 == 0" --map "lambda x: x ** 2" --collect
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from typing import Optional, List, Callable
|
|
11
|
+
import typer
|
|
12
|
+
from typing_extensions import Annotated
|
|
13
|
+
|
|
14
|
+
from vools.data import Seq
|
|
15
|
+
|
|
16
|
+
seq_app = typer.Typer(help="Seq 序列操作命令")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def parse_lambda(expr: str) -> Callable:
|
|
20
|
+
"""解析 lambda 表达式字符串"""
|
|
21
|
+
return eval(expr, {"__builtins__": {}})
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@seq_app.command()
|
|
25
|
+
def from_range(
|
|
26
|
+
count: int = typer.Argument(..., help="范围大小(生成 0 到 count-1 的序列)"),
|
|
27
|
+
filter_expr: Annotated[
|
|
28
|
+
Optional[str],
|
|
29
|
+
typer.Option("--filter", "-f", help="过滤表达式,如: lambda x: x % 2 == 0")
|
|
30
|
+
] = None,
|
|
31
|
+
map_expr: Annotated[
|
|
32
|
+
Optional[str],
|
|
33
|
+
typer.Option("--map", "-m", help="映射表达式,如: lambda x: x * 2")
|
|
34
|
+
] = None,
|
|
35
|
+
collect: bool = typer.Option(False, "--collect/--no-collect", help="立即收集结果"),
|
|
36
|
+
limit: Annotated[
|
|
37
|
+
Optional[int],
|
|
38
|
+
typer.Option("--limit", "-l", help="限制结果数量")
|
|
39
|
+
] = None,
|
|
40
|
+
):
|
|
41
|
+
"""从范围创建序列"""
|
|
42
|
+
seq = Seq.range(count)
|
|
43
|
+
|
|
44
|
+
if filter_expr:
|
|
45
|
+
seq = seq.filter(parse_lambda(filter_expr))
|
|
46
|
+
|
|
47
|
+
if map_expr:
|
|
48
|
+
seq = seq.map(parse_lambda(map_expr))
|
|
49
|
+
|
|
50
|
+
if limit:
|
|
51
|
+
seq = seq.take(limit)
|
|
52
|
+
|
|
53
|
+
if collect:
|
|
54
|
+
result = seq.collect()
|
|
55
|
+
typer.echo(f"结果: {result}")
|
|
56
|
+
return result
|
|
57
|
+
else:
|
|
58
|
+
typer.echo(f"Seq (lazy): {seq}")
|
|
59
|
+
return seq
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@seq_app.command()
|
|
63
|
+
def from_list(
|
|
64
|
+
items: List[int] = typer.Argument(..., help="列表元素"),
|
|
65
|
+
filter_expr: Annotated[
|
|
66
|
+
Optional[str],
|
|
67
|
+
typer.Option("--filter", "-f", help="过滤表达式")
|
|
68
|
+
] = None,
|
|
69
|
+
map_expr: Annotated[
|
|
70
|
+
Optional[str],
|
|
71
|
+
typer.Option("--map", "-m", help="映射表达式")
|
|
72
|
+
] = None,
|
|
73
|
+
collect: bool = typer.Option(False, "--collect/--no-collect", help="立即收集结果"),
|
|
74
|
+
):
|
|
75
|
+
"""从列表创建序列"""
|
|
76
|
+
seq = Seq(items)
|
|
77
|
+
|
|
78
|
+
if filter_expr:
|
|
79
|
+
seq = seq.filter(parse_lambda(filter_expr))
|
|
80
|
+
|
|
81
|
+
if map_expr:
|
|
82
|
+
seq = seq.map(parse_lambda(map_expr))
|
|
83
|
+
|
|
84
|
+
if collect:
|
|
85
|
+
result = seq.collect()
|
|
86
|
+
typer.echo(f"结果: {result}")
|
|
87
|
+
return result
|
|
88
|
+
else:
|
|
89
|
+
typer.echo(f"Seq (lazy): {seq}")
|
|
90
|
+
return seq
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
@seq_app.command()
|
|
94
|
+
def filter_cmd(
|
|
95
|
+
data: List[int] = typer.Argument(..., help="输入数据"),
|
|
96
|
+
expr: str = typer.Argument(..., help="过滤表达式"),
|
|
97
|
+
):
|
|
98
|
+
"""过滤序列元素"""
|
|
99
|
+
seq = Seq(data)
|
|
100
|
+
result = seq.filter(parse_lambda(expr)).collect()
|
|
101
|
+
typer.echo(f"过滤结果: {result}")
|
|
102
|
+
return result
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
@seq_app.command()
|
|
106
|
+
def map_cmd(
|
|
107
|
+
data: List[int] = typer.Argument(..., help="输入数据"),
|
|
108
|
+
expr: str = typer.Argument(..., help="映射表达式"),
|
|
109
|
+
):
|
|
110
|
+
"""映射序列元素"""
|
|
111
|
+
seq = Seq(data)
|
|
112
|
+
result = seq.map(parse_lambda(expr)).collect()
|
|
113
|
+
typer.echo(f"映射结果: {result}")
|
|
114
|
+
return result
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
@seq_app.command()
|
|
118
|
+
def collect_cmd(
|
|
119
|
+
data: List[int] = typer.Argument(..., help="输入数据"),
|
|
120
|
+
):
|
|
121
|
+
"""收集序列为列表"""
|
|
122
|
+
seq = Seq(data)
|
|
123
|
+
result = seq.collect()
|
|
124
|
+
typer.echo(f"收集结果: {result}")
|
|
125
|
+
return result
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
if __name__ == "__main__":
|
|
129
|
+
typer.run(from_range)
|