@vicoa/cli 1.5.4-win32-x64 → 1.5.4
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.
- package/README.md +82 -0
- package/bin/vicoa.js +38 -0
- package/package.json +29 -10
- package/bin/_internal/81d243bd2c585b0f4821__mypyc.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/VCRUNTIME140.dll +0 -0
- package/bin/_internal/VCRUNTIME140_1.dll +0 -0
- package/bin/_internal/_asyncio.pyd +0 -0
- package/bin/_internal/_bz2.pyd +0 -0
- package/bin/_internal/_cffi_backend.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/_ctypes.pyd +0 -0
- package/bin/_internal/_decimal.pyd +0 -0
- package/bin/_internal/_hashlib.pyd +0 -0
- package/bin/_internal/_lzma.pyd +0 -0
- package/bin/_internal/_multiprocessing.pyd +0 -0
- package/bin/_internal/_overlapped.pyd +0 -0
- package/bin/_internal/_queue.pyd +0 -0
- package/bin/_internal/_socket.pyd +0 -0
- package/bin/_internal/_ssl.pyd +0 -0
- package/bin/_internal/_uuid.pyd +0 -0
- package/bin/_internal/_wmi.pyd +0 -0
- package/bin/_internal/_zoneinfo.pyd +0 -0
- package/bin/_internal/aiofile-3.11.1.dist-info/INSTALLER +0 -1
- package/bin/_internal/aiofile-3.11.1.dist-info/METADATA +0 -511
- package/bin/_internal/aiofile-3.11.1.dist-info/RECORD +0 -15
- package/bin/_internal/aiofile-3.11.1.dist-info/WHEEL +0 -4
- package/bin/_internal/aiofile-3.11.1.dist-info/licenses/LICENCE +0 -195
- package/bin/_internal/aiofile-3.11.1.dist-info/licenses/LICENCE.md +0 -195
- package/bin/_internal/aiohttp/_http_parser.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/aiohttp/_http_writer.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/aiohttp/_websocket/mask.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/aiohttp/_websocket/reader_c.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/api-ms-win-core-console-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-datetime-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-debug-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-errorhandling-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-fibers-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-fibers-l1-1-1.dll +0 -0
- package/bin/_internal/api-ms-win-core-file-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-file-l1-2-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-file-l2-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-handle-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-heap-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-interlocked-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-kernel32-legacy-l1-1-1.dll +0 -0
- package/bin/_internal/api-ms-win-core-libraryloader-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-localization-l1-2-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-memory-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-namedpipe-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-processenvironment-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-processthreads-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-processthreads-l1-1-1.dll +0 -0
- package/bin/_internal/api-ms-win-core-profile-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-rtlsupport-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-string-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-synch-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-synch-l1-2-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-sysinfo-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-sysinfo-l1-2-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-timezone-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-core-util-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-conio-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-convert-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-environment-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-filesystem-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-heap-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-locale-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-math-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-process-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-runtime-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-stdio-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-string-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-time-l1-1-0.dll +0 -0
- package/bin/_internal/api-ms-win-crt-utility-l1-1-0.dll +0 -0
- package/bin/_internal/attrs-26.1.0.dist-info/INSTALLER +0 -1
- package/bin/_internal/attrs-26.1.0.dist-info/METADATA +0 -199
- package/bin/_internal/attrs-26.1.0.dist-info/RECORD +0 -55
- package/bin/_internal/attrs-26.1.0.dist-info/WHEEL +0 -4
- package/bin/_internal/attrs-26.1.0.dist-info/licenses/LICENSE +0 -21
- package/bin/_internal/base_library.zip +0 -0
- package/bin/_internal/certifi/cacert.pem +0 -3892
- package/bin/_internal/certifi/py.typed +0 -0
- package/bin/_internal/charset_normalizer/cd.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/charset_normalizer/md.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/click-8.4.1.dist-info/INSTALLER +0 -1
- package/bin/_internal/click-8.4.1.dist-info/METADATA +0 -84
- package/bin/_internal/click-8.4.1.dist-info/RECORD +0 -40
- package/bin/_internal/click-8.4.1.dist-info/WHEEL +0 -4
- package/bin/_internal/click-8.4.1.dist-info/licenses/LICENSE.txt +0 -28
- package/bin/_internal/cryptography/hazmat/bindings/_rust.pyd +0 -0
- package/bin/_internal/cryptography-48.0.0.dist-info/INSTALLER +0 -1
- package/bin/_internal/cryptography-48.0.0.dist-info/METADATA +0 -110
- package/bin/_internal/cryptography-48.0.0.dist-info/RECORD +0 -195
- package/bin/_internal/cryptography-48.0.0.dist-info/WHEEL +0 -4
- package/bin/_internal/cryptography-48.0.0.dist-info/licenses/LICENSE +0 -3
- package/bin/_internal/cryptography-48.0.0.dist-info/licenses/LICENSE.APACHE +0 -202
- package/bin/_internal/cryptography-48.0.0.dist-info/licenses/LICENSE.BSD +0 -27
- package/bin/_internal/cryptography-48.0.0.dist-info/sboms/cryptography-rust.cyclonedx.json +0 -1362
- package/bin/_internal/cryptography-48.0.0.dist-info/sboms/sbom.json +0 -43
- package/bin/_internal/email_validator-2.3.0.dist-info/INSTALLER +0 -1
- package/bin/_internal/email_validator-2.3.0.dist-info/METADATA +0 -466
- package/bin/_internal/email_validator-2.3.0.dist-info/RECORD +0 -27
- package/bin/_internal/email_validator-2.3.0.dist-info/WHEEL +0 -5
- package/bin/_internal/email_validator-2.3.0.dist-info/entry_points.txt +0 -2
- package/bin/_internal/email_validator-2.3.0.dist-info/licenses/LICENSE +0 -27
- package/bin/_internal/email_validator-2.3.0.dist-info/top_level.txt +0 -1
- package/bin/_internal/fastmcp-3.4.0.dist-info/INSTALLER +0 -1
- package/bin/_internal/fastmcp-3.4.0.dist-info/METADATA +0 -160
- package/bin/_internal/fastmcp-3.4.0.dist-info/RECORD +0 -5
- package/bin/_internal/fastmcp-3.4.0.dist-info/WHEEL +0 -4
- package/bin/_internal/fastmcp-3.4.0.dist-info/licenses/LICENSE +0 -201
- package/bin/_internal/frozenlist/_frozenlist.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/integrations/cli_wrappers/IMPORTANT_USE_CASES.md +0 -33
- package/bin/_internal/integrations/github/claude-code-action/CLAUDE.md +0 -136
- package/bin/_internal/integrations/github/claude-code-action/CODE_OF_CONDUCT.md +0 -128
- package/bin/_internal/integrations/github/claude-code-action/CONTRIBUTING.md +0 -116
- package/bin/_internal/integrations/github/claude-code-action/LICENSE +0 -21
- package/bin/_internal/integrations/github/claude-code-action/README.md +0 -53
- package/bin/_internal/integrations/github/claude-code-action/ROADMAP.md +0 -20
- package/bin/_internal/integrations/github/claude-code-action/SECURITY.md +0 -15
- package/bin/_internal/integrations/github/claude-code-action/action.yml +0 -294
- package/bin/_internal/integrations/github/claude-code-action/base-action/CLAUDE.md +0 -60
- package/bin/_internal/integrations/github/claude-code-action/base-action/CODE_OF_CONDUCT.md +0 -128
- package/bin/_internal/integrations/github/claude-code-action/base-action/CONTRIBUTING.md +0 -136
- package/bin/_internal/integrations/github/claude-code-action/base-action/LICENSE +0 -21
- package/bin/_internal/integrations/github/claude-code-action/base-action/MIRROR_DISCLAIMER.md +0 -11
- package/bin/_internal/integrations/github/claude-code-action/base-action/README.md +0 -521
- package/bin/_internal/integrations/github/claude-code-action/base-action/action.yml +0 -149
- package/bin/_internal/integrations/github/claude-code-action/base-action/bun.lock +0 -54
- package/bin/_internal/integrations/github/claude-code-action/base-action/examples/issue-triage.yml +0 -108
- package/bin/_internal/integrations/github/claude-code-action/base-action/package.json +0 -23
- package/bin/_internal/integrations/github/claude-code-action/base-action/scripts/install-hooks.sh +0 -13
- package/bin/_internal/integrations/github/claude-code-action/base-action/scripts/pre-push +0 -46
- package/bin/_internal/integrations/github/claude-code-action/base-action/src/index.ts +0 -82
- package/bin/_internal/integrations/github/claude-code-action/base-action/src/prepare-prompt.ts +0 -82
- package/bin/_internal/integrations/github/claude-code-action/base-action/src/run-claude.ts +0 -257
- package/bin/_internal/integrations/github/claude-code-action/base-action/src/run-vicoa.ts +0 -301
- package/bin/_internal/integrations/github/claude-code-action/base-action/src/setup-claude-code-settings.ts +0 -68
- package/bin/_internal/integrations/github/claude-code-action/base-action/src/validate-env.ts +0 -54
- package/bin/_internal/integrations/github/claude-code-action/base-action/test-local.sh +0 -12
- package/bin/_internal/integrations/github/claude-code-action/base-action/test-mcp-local.sh +0 -18
- package/bin/_internal/integrations/github/claude-code-action/base-action/tsconfig.json +0 -30
- package/bin/_internal/integrations/github/claude-code-action/bun.lock +0 -384
- package/bin/_internal/integrations/github/claude-code-action/docs/capabilities-and-limitations.md +0 -33
- package/bin/_internal/integrations/github/claude-code-action/docs/cloud-providers.md +0 -99
- package/bin/_internal/integrations/github/claude-code-action/docs/configuration.md +0 -345
- package/bin/_internal/integrations/github/claude-code-action/docs/custom-automations.md +0 -113
- package/bin/_internal/integrations/github/claude-code-action/docs/experimental.md +0 -128
- package/bin/_internal/integrations/github/claude-code-action/docs/faq.md +0 -205
- package/bin/_internal/integrations/github/claude-code-action/docs/migration-guide.md +0 -261
- package/bin/_internal/integrations/github/claude-code-action/docs/security.md +0 -38
- package/bin/_internal/integrations/github/claude-code-action/docs/setup.md +0 -146
- package/bin/_internal/integrations/github/claude-code-action/docs/usage.md +0 -213
- package/bin/_internal/integrations/github/claude-code-action/examples/auto-fix-ci/auto-fix-ci.yml +0 -97
- package/bin/_internal/integrations/github/claude-code-action/examples/auto-fix-ci/commands/fix-ci.md +0 -127
- package/bin/_internal/integrations/github/claude-code-action/examples/auto-fix-ci-signed/auto-fix-ci-signed.yml +0 -97
- package/bin/_internal/integrations/github/claude-code-action/examples/auto-fix-ci-signed/commands/fix-ci-signed.md +0 -148
- package/bin/_internal/integrations/github/claude-code-action/examples/issue-deduplication.yml +0 -63
- package/bin/_internal/integrations/github/claude-code-action/examples/issue-triage.yml +0 -75
- package/bin/_internal/integrations/github/claude-code-action/examples/vicoa.yml +0 -75
- package/bin/_internal/integrations/github/claude-code-action/package.json +0 -31
- package/bin/_internal/integrations/github/claude-code-action/scripts/install-hooks.sh +0 -13
- package/bin/_internal/integrations/github/claude-code-action/scripts/pre-commit +0 -46
- package/bin/_internal/integrations/github/claude-code-action/scripts/setup-network-restrictions.sh +0 -123
- package/bin/_internal/integrations/github/claude-code-action/src/create-prompt/index.ts +0 -799
- package/bin/_internal/integrations/github/claude-code-action/src/create-prompt/types.ts +0 -102
- package/bin/_internal/integrations/github/claude-code-action/src/entrypoints/collect-inputs.ts +0 -58
- package/bin/_internal/integrations/github/claude-code-action/src/entrypoints/format-turns.ts +0 -465
- package/bin/_internal/integrations/github/claude-code-action/src/entrypoints/prepare.ts +0 -98
- package/bin/_internal/integrations/github/claude-code-action/src/entrypoints/update-comment-link.ts +0 -245
- package/bin/_internal/integrations/github/claude-code-action/src/github/api/client.ts +0 -23
- package/bin/_internal/integrations/github/claude-code-action/src/github/api/config.ts +0 -4
- package/bin/_internal/integrations/github/claude-code-action/src/github/api/queries/github.ts +0 -117
- package/bin/_internal/integrations/github/claude-code-action/src/github/context.ts +0 -277
- package/bin/_internal/integrations/github/claude-code-action/src/github/data/fetcher.ts +0 -233
- package/bin/_internal/integrations/github/claude-code-action/src/github/data/formatter.ts +0 -144
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/branch-cleanup.ts +0 -132
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/branch.ts +0 -163
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comment-logic.ts +0 -203
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comments/common.ts +0 -33
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comments/create-initial.ts +0 -111
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comments/update-claude-comment.ts +0 -70
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/comments/update-with-branch.ts +0 -57
- package/bin/_internal/integrations/github/claude-code-action/src/github/operations/git-config.ts +0 -62
- package/bin/_internal/integrations/github/claude-code-action/src/github/token.ts +0 -108
- package/bin/_internal/integrations/github/claude-code-action/src/github/types.ts +0 -98
- package/bin/_internal/integrations/github/claude-code-action/src/github/utils/image-downloader.ts +0 -246
- package/bin/_internal/integrations/github/claude-code-action/src/github/utils/sanitizer.ts +0 -100
- package/bin/_internal/integrations/github/claude-code-action/src/github/validation/actor.ts +0 -64
- package/bin/_internal/integrations/github/claude-code-action/src/github/validation/permissions.ts +0 -47
- package/bin/_internal/integrations/github/claude-code-action/src/github/validation/trigger.ts +0 -148
- package/bin/_internal/integrations/github/claude-code-action/src/mcp/github-actions-server.ts +0 -279
- package/bin/_internal/integrations/github/claude-code-action/src/mcp/github-comment-server.ts +0 -101
- package/bin/_internal/integrations/github/claude-code-action/src/mcp/github-file-ops-server.ts +0 -677
- package/bin/_internal/integrations/github/claude-code-action/src/mcp/github-inline-comment-server.ts +0 -184
- package/bin/_internal/integrations/github/claude-code-action/src/mcp/install-mcp-server.ts +0 -201
- package/bin/_internal/integrations/github/claude-code-action/src/modes/agent/index.ts +0 -152
- package/bin/_internal/integrations/github/claude-code-action/src/modes/agent/parse-tools.ts +0 -22
- package/bin/_internal/integrations/github/claude-code-action/src/modes/detector.ts +0 -66
- package/bin/_internal/integrations/github/claude-code-action/src/modes/registry.ts +0 -54
- package/bin/_internal/integrations/github/claude-code-action/src/modes/tag/index.ts +0 -187
- package/bin/_internal/integrations/github/claude-code-action/src/modes/types.ts +0 -100
- package/bin/_internal/integrations/github/claude-code-action/src/prepare/index.ts +0 -20
- package/bin/_internal/integrations/github/claude-code-action/src/prepare/types.ts +0 -20
- package/bin/_internal/integrations/github/claude-code-action/src/utils/retry.ts +0 -40
- package/bin/_internal/integrations/github/claude-code-action/tsconfig.json +0 -30
- package/bin/_internal/integrations/headless/tests/README.md +0 -58
- package/bin/_internal/integrations/n8n/LICENSE +0 -21
- package/bin/_internal/integrations/n8n/README.md +0 -298
- package/bin/_internal/integrations/n8n/package-lock.json +0 -2989
- package/bin/_internal/integrations/n8n/package.json +0 -68
- package/bin/_internal/integrations/n8n/src/credentials/OmnaraApi.credentials.ts +0 -52
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/Omnara.node.json +0 -35
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/Omnara.node.ts +0 -304
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/message/index.ts +0 -37
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/message/send.operation.ts +0 -151
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/message/sendAndWait.operation.ts +0 -252
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/session/end.operation.ts +0 -56
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/actions/session/index.ts +0 -29
- package/bin/_internal/integrations/n8n/src/nodes/Omnara/vicoa.png +0 -0
- package/bin/_internal/integrations/n8n/src/utils/GenericFunctions.ts +0 -93
- package/bin/_internal/integrations/n8n/src/utils/sendAndWait/configureWaitTillDate.ts +0 -42
- package/bin/_internal/integrations/n8n/src/utils/sendAndWait/descriptions.ts +0 -20
- package/bin/_internal/integrations/n8n/src/utils/sendAndWaitWebhook.ts +0 -72
- package/bin/_internal/integrations/n8n/tsconfig.json +0 -20
- package/bin/_internal/jiter/jiter.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/jsonschema/benchmarks/issue232/issue.json +0 -2653
- package/bin/_internal/jsonschema-4.26.0.dist-info/INSTALLER +0 -1
- package/bin/_internal/jsonschema-4.26.0.dist-info/METADATA +0 -170
- package/bin/_internal/jsonschema-4.26.0.dist-info/RECORD +0 -82
- package/bin/_internal/jsonschema-4.26.0.dist-info/WHEEL +0 -4
- package/bin/_internal/jsonschema-4.26.0.dist-info/entry_points.txt +0 -2
- package/bin/_internal/jsonschema-4.26.0.dist-info/licenses/COPYING +0 -19
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/metaschema.json +0 -42
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/applicator +0 -56
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/content +0 -17
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/core +0 -57
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/format +0 -14
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/meta-data +0 -37
- package/bin/_internal/jsonschema_specifications/schemas/draft201909/vocabularies/validation +0 -98
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/metaschema.json +0 -58
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/applicator +0 -48
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/content +0 -17
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/core +0 -51
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/format-annotation +0 -14
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/format-assertion +0 -14
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/meta-data +0 -37
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/unevaluated +0 -15
- package/bin/_internal/jsonschema_specifications/schemas/draft202012/vocabularies/validation +0 -98
- package/bin/_internal/jsonschema_specifications/schemas/draft3/metaschema.json +0 -172
- package/bin/_internal/jsonschema_specifications/schemas/draft4/metaschema.json +0 -149
- package/bin/_internal/jsonschema_specifications/schemas/draft6/metaschema.json +0 -153
- package/bin/_internal/jsonschema_specifications/schemas/draft7/metaschema.json +0 -166
- package/bin/_internal/libcrypto-3.dll +0 -0
- package/bin/_internal/libffi-8.dll +0 -0
- package/bin/_internal/libssl-3.dll +0 -0
- package/bin/_internal/mcp-1.27.2.dist-info/INSTALLER +0 -1
- package/bin/_internal/mcp-1.27.2.dist-info/METADATA +0 -231
- package/bin/_internal/mcp-1.27.2.dist-info/RECORD +0 -228
- package/bin/_internal/mcp-1.27.2.dist-info/WHEEL +0 -4
- package/bin/_internal/mcp-1.27.2.dist-info/entry_points.txt +0 -2
- package/bin/_internal/mcp-1.27.2.dist-info/licenses/LICENSE +0 -21
- package/bin/_internal/multidict/_multidict.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/opentelemetry_api-1.42.1.dist-info/INSTALLER +0 -1
- package/bin/_internal/opentelemetry_api-1.42.1.dist-info/METADATA +0 -43
- package/bin/_internal/opentelemetry_api-1.42.1.dist-info/RECORD +0 -81
- package/bin/_internal/opentelemetry_api-1.42.1.dist-info/WHEEL +0 -4
- package/bin/_internal/opentelemetry_api-1.42.1.dist-info/entry_points.txt +0 -15
- package/bin/_internal/opentelemetry_api-1.42.1.dist-info/licenses/LICENSE +0 -201
- package/bin/_internal/propcache/_helpers_c.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/pydantic-2.13.4.dist-info/INSTALLER +0 -1
- package/bin/_internal/pydantic-2.13.4.dist-info/METADATA +0 -1294
- package/bin/_internal/pydantic-2.13.4.dist-info/RECORD +0 -217
- package/bin/_internal/pydantic-2.13.4.dist-info/WHEEL +0 -4
- package/bin/_internal/pydantic-2.13.4.dist-info/licenses/LICENSE +0 -21
- package/bin/_internal/pydantic_core/_pydantic_core.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/pyexpat.pyd +0 -0
- package/bin/_internal/python3.dll +0 -0
- package/bin/_internal/python312.dll +0 -0
- package/bin/_internal/pywin32_system32/pythoncom312.dll +0 -0
- package/bin/_internal/pywin32_system32/pywintypes312.dll +0 -0
- package/bin/_internal/rpds/rpds.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/select.pyd +0 -0
- package/bin/_internal/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/INSTALLER +0 -1
- package/bin/_internal/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/METADATA +0 -133
- package/bin/_internal/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/RECORD +0 -21
- package/bin/_internal/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/REQUESTED +0 -0
- package/bin/_internal/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/WHEEL +0 -5
- package/bin/_internal/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/licenses/LICENSE +0 -73
- package/bin/_internal/setuptools/_vendor/importlib_metadata-8.7.1.dist-info/top_level.txt +0 -1
- package/bin/_internal/setuptools/_vendor/jaraco/text/Lorem ipsum.txt +0 -2
- package/bin/_internal/ucrtbase.dll +0 -0
- package/bin/_internal/unicodedata.pyd +0 -0
- package/bin/_internal/vicoa/_bin/README.md +0 -28
- package/bin/_internal/vicoa-1.5.4.dist-info/INSTALLER +0 -1
- package/bin/_internal/vicoa-1.5.4.dist-info/METADATA +0 -312
- package/bin/_internal/vicoa-1.5.4.dist-info/RECORD +0 -11
- package/bin/_internal/vicoa-1.5.4.dist-info/REQUESTED +0 -0
- package/bin/_internal/vicoa-1.5.4.dist-info/WHEEL +0 -5
- package/bin/_internal/vicoa-1.5.4.dist-info/direct_url.json +0 -1
- package/bin/_internal/vicoa-1.5.4.dist-info/entry_points.txt +0 -2
- package/bin/_internal/vicoa-1.5.4.dist-info/licenses/LICENSE +0 -201
- package/bin/_internal/vicoa-1.5.4.dist-info/top_level.txt +0 -3
- package/bin/_internal/watchfiles/_rust_notify.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/websockets/speedups.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/websockets-16.0.dist-info/INSTALLER +0 -1
- package/bin/_internal/websockets-16.0.dist-info/METADATA +0 -179
- package/bin/_internal/websockets-16.0.dist-info/RECORD +0 -108
- package/bin/_internal/websockets-16.0.dist-info/WHEEL +0 -5
- package/bin/_internal/websockets-16.0.dist-info/entry_points.txt +0 -2
- package/bin/_internal/websockets-16.0.dist-info/licenses/LICENSE +0 -24
- package/bin/_internal/websockets-16.0.dist-info/top_level.txt +0 -1
- package/bin/_internal/win32/_win32sysloader.pyd +0 -0
- package/bin/_internal/win32/win32api.pyd +0 -0
- package/bin/_internal/win32/win32evtlog.pyd +0 -0
- package/bin/_internal/win32/win32job.pyd +0 -0
- package/bin/_internal/yaml/_yaml.cp312-win_amd64.pyd +0 -0
- package/bin/_internal/yarl/_quoting_c.cp312-win_amd64.pyd +0 -0
- package/bin/vicoa.exe +0 -0
|
@@ -1,511 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: aiofile
|
|
3
|
-
Version: 3.11.1
|
|
4
|
-
Summary: Asynchronous file operations.
|
|
5
|
-
Project-URL: Homepage, https://github.com/mosquito/aiofile
|
|
6
|
-
Author-email: Dmitry Orlov <me@mosquito.su>
|
|
7
|
-
License-Expression: Apache-2.0
|
|
8
|
-
License-File: LICENCE
|
|
9
|
-
License-File: LICENCE.md
|
|
10
|
-
Keywords: aio,asyncio,fileio,io,python
|
|
11
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
-
Classifier: Environment :: Console
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: Intended Audience :: Education
|
|
15
|
-
Classifier: Intended Audience :: End Users/Desktop
|
|
16
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
-
Classifier: Natural Language :: English
|
|
18
|
-
Classifier: Natural Language :: Russian
|
|
19
|
-
Classifier: Operating System :: MacOS :: MacOS X
|
|
20
|
-
Classifier: Operating System :: POSIX :: Linux
|
|
21
|
-
Classifier: Programming Language :: Python
|
|
22
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
27
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
28
|
-
Classifier: Topic :: Software Development :: Libraries
|
|
29
|
-
Classifier: Topic :: System
|
|
30
|
-
Classifier: Topic :: System :: Operating System
|
|
31
|
-
Requires-Python: >=3.11
|
|
32
|
-
Requires-Dist: caio~=0.9.0
|
|
33
|
-
Description-Content-Type: text/markdown
|
|
34
|
-
|
|
35
|
-
# AIOFile
|
|
36
|
-
|
|
37
|
-
[](https://github.com/mosquito/aiofile/actions?query=workflow%3Aci) [](https://pypi.python.org/pypi/aiofile/) [](https://pypi.python.org/pypi/aiofile/) [](https://pypi.python.org/pypi/aiofile/) [](https://coveralls.io/github/mosquito/aiofile?branch=master)
|
|
38
|
-
|
|
39
|
-
Real asynchronous file operations with asyncio support.
|
|
40
|
-
|
|
41
|
-
## Features
|
|
42
|
-
|
|
43
|
-
* Since version 2.0.0, uses [caio](https://pypi.org/project/caio), which provides multiple
|
|
44
|
-
async I/O backends:
|
|
45
|
-
* **Linux io_uring** — the modern, high-performance Linux kernel AIO interface.
|
|
46
|
-
* **Linux libaio** — the classic kernel AIO mechanism via [libaio](https://pagure.io/libaio).
|
|
47
|
-
* **Thread-based (C)** — a [threadpool](https://github.com/mbrossard/threadpool/)-backed
|
|
48
|
-
implementation for POSIX systems (macOS, Linux).
|
|
49
|
-
* **Pure Python** — a thread-based fallback for any platform.
|
|
50
|
-
* The best available backend is chosen automatically based on system compatibility.
|
|
51
|
-
* `AIOFile` has no internal file pointer. Pass `offset` and `chunk_size` to each operation,
|
|
52
|
-
or use the `Reader`/`Writer` helpers. For a file-like interface, use `async_open`.
|
|
53
|
-
|
|
54
|
-
## Limitations
|
|
55
|
-
|
|
56
|
-
* The Linux native AIO and io_uring backends cannot open special files.
|
|
57
|
-
Asynchronous operations against special filesystems such as `/proc/` or `/sys/` are not
|
|
58
|
-
supported by the kernel — this is neither an aiofile nor a caio issue.
|
|
59
|
-
In such cases, switch to a thread-based implementation
|
|
60
|
-
(see the [Troubleshooting](#troubleshooting) section).
|
|
61
|
-
|
|
62
|
-
## Code examples
|
|
63
|
-
|
|
64
|
-
All code examples require Python 3.11+.
|
|
65
|
-
|
|
66
|
-
### High-level API
|
|
67
|
-
|
|
68
|
-
#### `async_open` helper
|
|
69
|
-
|
|
70
|
-
This helper mimics Python's file-like objects, returning an object with
|
|
71
|
-
equivalent asynchronous methods.
|
|
72
|
-
|
|
73
|
-
Supported methods:
|
|
74
|
-
|
|
75
|
-
* `async def read(length=-1)` — reads a chunk from the file; `-1` reads to the end.
|
|
76
|
-
* `async def write(data)` — writes a chunk to the file.
|
|
77
|
-
* `def seek(offset)` — sets the file pointer position.
|
|
78
|
-
* `def tell()` — returns the current file pointer position.
|
|
79
|
-
* `async def readline(size=-1, newline="\n")` — reads until a newline or EOF.
|
|
80
|
-
Since version 3.7.0, `__aiter__` returns a `LineReader`.
|
|
81
|
-
This method is suboptimal for small lines because it does not reuse the read buffer —
|
|
82
|
-
prefer `LineReader` when reading line by line.
|
|
83
|
-
* `def __aiter__() -> LineReader` — iterator over lines.
|
|
84
|
-
* `def iter_chunked(chunk_size: int = 32768) -> Reader` — iterator over chunks.
|
|
85
|
-
* `.file` — the underlying `AIOFile` object.
|
|
86
|
-
|
|
87
|
-
Basic example:
|
|
88
|
-
|
|
89
|
-
<!-- name: test_basic -->
|
|
90
|
-
```python
|
|
91
|
-
import asyncio
|
|
92
|
-
from pathlib import Path
|
|
93
|
-
from tempfile import gettempdir
|
|
94
|
-
|
|
95
|
-
from aiofile import async_open
|
|
96
|
-
|
|
97
|
-
tmp_filename = Path(gettempdir()) / "hello.txt"
|
|
98
|
-
|
|
99
|
-
async def main():
|
|
100
|
-
async with async_open(tmp_filename, 'w+') as afp:
|
|
101
|
-
await afp.write("Hello ")
|
|
102
|
-
await afp.write("world")
|
|
103
|
-
afp.seek(0)
|
|
104
|
-
|
|
105
|
-
print(await afp.read())
|
|
106
|
-
|
|
107
|
-
await afp.write("Hello from\nasync world")
|
|
108
|
-
print(await afp.readline())
|
|
109
|
-
print(await afp.readline())
|
|
110
|
-
|
|
111
|
-
asyncio.run(main())
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Example without context manager:
|
|
115
|
-
|
|
116
|
-
<!-- name: test_basic_without_context_manager -->
|
|
117
|
-
```python
|
|
118
|
-
import asyncio
|
|
119
|
-
import atexit
|
|
120
|
-
import os
|
|
121
|
-
from tempfile import mktemp
|
|
122
|
-
|
|
123
|
-
from aiofile import async_open
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
TMP_NAME = mktemp()
|
|
127
|
-
atexit.register(os.unlink, TMP_NAME)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
async def main():
|
|
131
|
-
afp = await async_open(TMP_NAME, "w")
|
|
132
|
-
await afp.write("Hello")
|
|
133
|
-
await afp.close()
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
asyncio.run(main())
|
|
137
|
-
assert open(TMP_NAME, "r").read() == "Hello"
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Concatenate example program (`cat`):
|
|
141
|
-
|
|
142
|
-
```python
|
|
143
|
-
import asyncio
|
|
144
|
-
import sys
|
|
145
|
-
from argparse import ArgumentParser
|
|
146
|
-
from pathlib import Path
|
|
147
|
-
|
|
148
|
-
from aiofile import async_open
|
|
149
|
-
|
|
150
|
-
parser = ArgumentParser(
|
|
151
|
-
description="Read files line by line using asynchronous io API"
|
|
152
|
-
)
|
|
153
|
-
parser.add_argument("file_name", nargs="+", type=Path)
|
|
154
|
-
|
|
155
|
-
async def main(arguments):
|
|
156
|
-
for src in arguments.file_name:
|
|
157
|
-
async with async_open(src, "r") as afp:
|
|
158
|
-
async for line in afp:
|
|
159
|
-
sys.stdout.write(line)
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
asyncio.run(main(parser.parse_args()))
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Copy file example program (`cp`):
|
|
166
|
-
|
|
167
|
-
```python
|
|
168
|
-
import asyncio
|
|
169
|
-
from argparse import ArgumentParser
|
|
170
|
-
from pathlib import Path
|
|
171
|
-
|
|
172
|
-
from aiofile import async_open
|
|
173
|
-
|
|
174
|
-
parser = ArgumentParser(
|
|
175
|
-
description="Copying files using asynchronous io API"
|
|
176
|
-
)
|
|
177
|
-
parser.add_argument("source", type=Path)
|
|
178
|
-
parser.add_argument("dest", type=Path)
|
|
179
|
-
parser.add_argument("--chunk-size", type=int, default=65535)
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
async def main(arguments):
|
|
183
|
-
async with async_open(arguments.source, "rb") as src, \
|
|
184
|
-
async_open(arguments.dest, "wb") as dest:
|
|
185
|
-
async for chunk in src.iter_chunked(arguments.chunk_size):
|
|
186
|
-
await dest.write(chunk)
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
asyncio.run(main(parser.parse_args()))
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
Example with opening an already-open file pointer:
|
|
193
|
-
|
|
194
|
-
```python
|
|
195
|
-
import asyncio
|
|
196
|
-
from typing import IO, Any
|
|
197
|
-
from aiofile import async_open
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
async def main(fp: IO[Any]):
|
|
201
|
-
async with async_open(fp) as afp:
|
|
202
|
-
await afp.write("Hello from\nasync world")
|
|
203
|
-
print(await afp.readline())
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
with open("test.txt", "w+") as fp:
|
|
207
|
-
asyncio.run(main(fp))
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
Linux native AIO and io_uring do not support reading or writing special files
|
|
211
|
-
(procfs, sysfs, Unix pipes, etc.), so operations on these files require
|
|
212
|
-
a compatible context object.
|
|
213
|
-
|
|
214
|
-
```python
|
|
215
|
-
import asyncio
|
|
216
|
-
from aiofile import async_open
|
|
217
|
-
from caio import thread_aio_asyncio
|
|
218
|
-
from contextlib import AsyncExitStack
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
async def main():
|
|
222
|
-
async with AsyncExitStack() as stack:
|
|
223
|
-
|
|
224
|
-
# Custom context should be reused
|
|
225
|
-
ctx = await stack.enter_async_context(
|
|
226
|
-
thread_aio_asyncio.AsyncioContext()
|
|
227
|
-
)
|
|
228
|
-
|
|
229
|
-
# Open special file with custom context
|
|
230
|
-
src = await stack.enter_async_context(
|
|
231
|
-
async_open("/proc/cpuinfo", "r", context=ctx)
|
|
232
|
-
)
|
|
233
|
-
|
|
234
|
-
# Open regular file with default context
|
|
235
|
-
dest = await stack.enter_async_context(
|
|
236
|
-
async_open("/tmp/cpuinfo", "w")
|
|
237
|
-
)
|
|
238
|
-
|
|
239
|
-
# Copying file content line by line
|
|
240
|
-
async for line in src:
|
|
241
|
-
await dest.write(line)
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
asyncio.run(main())
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
### `clone` helper
|
|
248
|
-
|
|
249
|
-
An asynchronous context supports a limited number of concurrent operations at the low level,
|
|
250
|
-
regardless of how many file descriptors are open. `clone` lets you create a second file-like
|
|
251
|
-
object with its own independent offset from a single descriptor, without opening the file
|
|
252
|
-
multiple times.
|
|
253
|
-
|
|
254
|
-
```python
|
|
255
|
-
"""
|
|
256
|
-
This example counts multiple hash functions from the file passed as the first
|
|
257
|
-
argument. The hash functions are counted competitively, and the results are
|
|
258
|
-
printed in the order of hashing completion.
|
|
259
|
-
"""
|
|
260
|
-
import asyncio
|
|
261
|
-
import hashlib
|
|
262
|
-
import sys
|
|
263
|
-
|
|
264
|
-
import aiofile
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
async def hasher(name, hash_func, afp):
|
|
268
|
-
loop = asyncio.get_running_loop()
|
|
269
|
-
async for chunk in afp.iter_chunked(2 ** 20):
|
|
270
|
-
await loop.run_in_executor(None, hash_func.update, chunk)
|
|
271
|
-
print(name, hash_func.hexdigest())
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
async def main():
|
|
275
|
-
async with aiofile.async_open(sys.argv[1], "rb") as source:
|
|
276
|
-
hashers = [
|
|
277
|
-
("MD5", hashlib.md5()),
|
|
278
|
-
("SHA1", hashlib.sha1()),
|
|
279
|
-
("SHA256", hashlib.sha256()),
|
|
280
|
-
("SHA512", hashlib.sha512()),
|
|
281
|
-
]
|
|
282
|
-
|
|
283
|
-
await asyncio.gather(*[
|
|
284
|
-
hasher(name, hash_func, await aiofile.clone(source))
|
|
285
|
-
for name, hash_func in hashers
|
|
286
|
-
])
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
asyncio.run(main())
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
> **Note:** This will likely perform poorly on Windows, so if that is
|
|
293
|
-
> your target platform, this optimization may not be worth it.
|
|
294
|
-
|
|
295
|
-
### Low-level API
|
|
296
|
-
|
|
297
|
-
The `AIOFile` class is a low-level interface for asynchronous file operations. Its `read` and
|
|
298
|
-
`write` methods accept an `offset=0` (in bytes) at which the operation is performed.
|
|
299
|
-
|
|
300
|
-
This allows many independent I/O operations on a single open file without an internal pointer.
|
|
301
|
-
For sequential reading and writing, use `Writer`, `Reader`, and `LineReader`. Note that
|
|
302
|
-
`async_open` is not the same as `AIOFile`: it wraps it to provide a file-like interface
|
|
303
|
-
similar to the built-in `open`.
|
|
304
|
-
|
|
305
|
-
```python
|
|
306
|
-
import asyncio
|
|
307
|
-
from aiofile import AIOFile
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
async def main():
|
|
311
|
-
async with AIOFile("hello.txt", 'w+') as afp:
|
|
312
|
-
payload = "Hello world\n"
|
|
313
|
-
|
|
314
|
-
await asyncio.gather(
|
|
315
|
-
*[afp.write(payload, offset=i * len(payload)) for i in range(10)]
|
|
316
|
-
)
|
|
317
|
-
|
|
318
|
-
await afp.fsync()
|
|
319
|
-
|
|
320
|
-
assert await afp.read(len(payload) * 10) == payload * 10
|
|
321
|
-
|
|
322
|
-
asyncio.run(main())
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
The low-level API is essentially a lightly sugared `caio` API.
|
|
326
|
-
|
|
327
|
-
```python
|
|
328
|
-
import asyncio
|
|
329
|
-
from aiofile import AIOFile
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
async def main():
|
|
333
|
-
async with AIOFile("/tmp/hello.txt", 'w+') as afp:
|
|
334
|
-
await afp.write("Hello ")
|
|
335
|
-
await afp.write("world", offset=7)
|
|
336
|
-
await afp.fsync()
|
|
337
|
-
|
|
338
|
-
print(await afp.read())
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
asyncio.run(main())
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
#### `Reader` and `Writer`
|
|
345
|
-
|
|
346
|
-
To read or write a file linearly, the following example may be helpful.
|
|
347
|
-
|
|
348
|
-
```python
|
|
349
|
-
import asyncio
|
|
350
|
-
from aiofile import AIOFile, Reader, Writer
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
async def main():
|
|
354
|
-
async with AIOFile("/tmp/hello.txt", 'w+') as afp:
|
|
355
|
-
writer = Writer(afp)
|
|
356
|
-
reader = Reader(afp, chunk_size=8)
|
|
357
|
-
|
|
358
|
-
await writer("Hello")
|
|
359
|
-
await writer(" ")
|
|
360
|
-
await writer("World")
|
|
361
|
-
await afp.fsync()
|
|
362
|
-
|
|
363
|
-
async for chunk in reader:
|
|
364
|
-
print(chunk)
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
asyncio.run(main())
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
#### `LineReader` - read file line by line
|
|
371
|
-
|
|
372
|
-
`LineReader` is a helper for reading a file linearly, line by line. It maintains a buffer
|
|
373
|
-
and reads file fragments chunk by chunk, searching for line boundaries. The default chunk
|
|
374
|
-
size is 4KB.
|
|
375
|
-
|
|
376
|
-
```python
|
|
377
|
-
import asyncio
|
|
378
|
-
from aiofile import AIOFile, LineReader, Writer
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
async def main():
|
|
382
|
-
async with AIOFile("/tmp/hello.txt", 'w+') as afp:
|
|
383
|
-
writer = Writer(afp)
|
|
384
|
-
|
|
385
|
-
await writer("Hello")
|
|
386
|
-
await writer(" ")
|
|
387
|
-
await writer("World")
|
|
388
|
-
await writer("\n")
|
|
389
|
-
await writer("\n")
|
|
390
|
-
await writer("From async world")
|
|
391
|
-
await afp.fsync()
|
|
392
|
-
|
|
393
|
-
async for line in LineReader(afp):
|
|
394
|
-
print(line)
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
asyncio.run(main())
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
To read a file line by line, prefer `LineReader` over `async_open`.
|
|
401
|
-
|
|
402
|
-
## More examples
|
|
403
|
-
|
|
404
|
-
### Async CSV Dict Reader
|
|
405
|
-
|
|
406
|
-
```python
|
|
407
|
-
import asyncio
|
|
408
|
-
import io
|
|
409
|
-
from csv import DictReader
|
|
410
|
-
|
|
411
|
-
from aiofile import AIOFile, LineReader
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
class AsyncDictReader:
|
|
415
|
-
def __init__(self, afp, **kwargs):
|
|
416
|
-
self.buffer = io.BytesIO()
|
|
417
|
-
self.file_reader = LineReader(
|
|
418
|
-
afp, line_sep=kwargs.pop('line_sep', '\n'),
|
|
419
|
-
chunk_size=kwargs.pop('chunk_size', 4096),
|
|
420
|
-
offset=kwargs.pop('offset', 0),
|
|
421
|
-
)
|
|
422
|
-
self.reader = DictReader(
|
|
423
|
-
io.TextIOWrapper(
|
|
424
|
-
self.buffer,
|
|
425
|
-
encoding=kwargs.pop('encoding', 'utf-8'),
|
|
426
|
-
errors=kwargs.pop('errors', 'replace'),
|
|
427
|
-
), **kwargs,
|
|
428
|
-
)
|
|
429
|
-
self.line_num = 0
|
|
430
|
-
|
|
431
|
-
def __aiter__(self):
|
|
432
|
-
return self
|
|
433
|
-
|
|
434
|
-
async def __anext__(self):
|
|
435
|
-
if self.line_num == 0:
|
|
436
|
-
header = await self.file_reader.readline()
|
|
437
|
-
self.buffer.write(header)
|
|
438
|
-
|
|
439
|
-
line = await self.file_reader.readline()
|
|
440
|
-
|
|
441
|
-
if not line:
|
|
442
|
-
raise StopAsyncIteration
|
|
443
|
-
|
|
444
|
-
self.buffer.write(line)
|
|
445
|
-
self.buffer.seek(0)
|
|
446
|
-
|
|
447
|
-
try:
|
|
448
|
-
result = next(self.reader)
|
|
449
|
-
except StopIteration as e:
|
|
450
|
-
raise StopAsyncIteration from e
|
|
451
|
-
|
|
452
|
-
self.buffer.seek(0)
|
|
453
|
-
self.buffer.truncate(0)
|
|
454
|
-
self.line_num = self.reader.line_num
|
|
455
|
-
|
|
456
|
-
return result
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
async def main():
|
|
460
|
-
async with AIOFile('sample.csv', 'rb') as afp:
|
|
461
|
-
async for item in AsyncDictReader(afp):
|
|
462
|
-
print(item)
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
asyncio.run(main())
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
## Troubleshooting
|
|
469
|
-
|
|
470
|
-
The caio Linux backends (io_uring and libaio) work well on modern kernels and filesystems.
|
|
471
|
-
Problems are usually environment-specific and are not bugs. There are several ways to resolve them:
|
|
472
|
-
|
|
473
|
-
1. Upgrade the kernel.
|
|
474
|
-
2. Use a compatible filesystem.
|
|
475
|
-
3. Switch to a thread-based or pure-Python backend.
|
|
476
|
-
|
|
477
|
-
Since version 0.7.0, caio offers several ways to select the backend:
|
|
478
|
-
|
|
479
|
-
1. Set the `CAIO_IMPL` environment variable at runtime:
|
|
480
|
-
|
|
481
|
-
* `uring` — Linux io_uring (requires kernel ≥ 5.1)
|
|
482
|
-
* `linux` — Linux libaio
|
|
483
|
-
* `thread` — C-based thread pool implementation
|
|
484
|
-
* `python` — pure-Python thread-based fallback
|
|
485
|
-
|
|
486
|
-
2. The `default_implementation` file located next to `__init__.py` in the caio installation
|
|
487
|
-
directory. Useful for distribution package maintainers. The file may contain comments
|
|
488
|
-
(lines starting with `#`); the first non-comment line should be one of the values above.
|
|
489
|
-
|
|
490
|
-
3. Manage contexts manually:
|
|
491
|
-
|
|
492
|
-
```python
|
|
493
|
-
import asyncio
|
|
494
|
-
|
|
495
|
-
from aiofile import async_open
|
|
496
|
-
from caio import linux_aio_asyncio, thread_aio_asyncio
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
async def main():
|
|
500
|
-
linux_ctx = linux_aio_asyncio.AsyncioContext()
|
|
501
|
-
threads_ctx = thread_aio_asyncio.AsyncioContext()
|
|
502
|
-
|
|
503
|
-
async with async_open("/tmp/test.txt", "w", context=linux_ctx) as afp:
|
|
504
|
-
await afp.write("Hello")
|
|
505
|
-
|
|
506
|
-
async with async_open("/tmp/test.txt", "r", context=threads_ctx) as afp:
|
|
507
|
-
print(await afp.read())
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
asyncio.run(main())
|
|
511
|
-
```
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
aiofile-3.11.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
|
2
|
-
aiofile-3.11.1.dist-info/METADATA,sha256=Tc9uVksU0dDCEFbFpvCnBQG--aUnnhrGTNhFAcLo33c,14628
|
|
3
|
-
aiofile-3.11.1.dist-info/RECORD,,
|
|
4
|
-
aiofile-3.11.1.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
5
|
-
aiofile-3.11.1.dist-info/licenses/LICENCE,sha256=7GQBUOA3dNG1Jk-yaPOCncNnRVURCRMev23QpZ1ew-s,10495
|
|
6
|
-
aiofile-3.11.1.dist-info/licenses/LICENCE.md,sha256=7GQBUOA3dNG1Jk-yaPOCncNnRVURCRMev23QpZ1ew-s,10495
|
|
7
|
-
aiofile/__init__.py,sha256=BRzd0ek2MqpOYdmXNs8sQXkeyt3-l7YUvsA_L7XlxhU,672
|
|
8
|
-
aiofile/__pycache__/__init__.cpython-312.pyc,,
|
|
9
|
-
aiofile/__pycache__/aio.cpython-312.pyc,,
|
|
10
|
-
aiofile/__pycache__/utils.cpython-312.pyc,,
|
|
11
|
-
aiofile/__pycache__/version.cpython-312.pyc,,
|
|
12
|
-
aiofile/aio.py,sha256=rgsk7MpsvHMEp6SEssgtFQre1Per3fg_IpvKbhuuzOI,9606
|
|
13
|
-
aiofile/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
14
|
-
aiofile/utils.py,sha256=Al8ELUo7IZfE8DMjiOBsoWGrRuVE958QMH-uyOH8Rgw,11559
|
|
15
|
-
aiofile/version.py,sha256=FmlXpZQekQEtRRFJX7PFDVeM5pOmtZ7TlmWbuOe3on8,932
|