@vicoa/cli 1.3.11-linux-x64 → 1.3.11
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.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/_cffi_backend.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/aiofile-3.9.0.dist-info/INSTALLER +0 -1
- package/bin/_internal/aiofile-3.9.0.dist-info/LICENCE +0 -195
- package/bin/_internal/aiofile-3.9.0.dist-info/LICENCE.md +0 -195
- package/bin/_internal/aiofile-3.9.0.dist-info/METADATA +0 -492
- package/bin/_internal/aiofile-3.9.0.dist-info/RECORD +0 -15
- package/bin/_internal/aiofile-3.9.0.dist-info/WHEEL +0 -4
- package/bin/_internal/aiohttp/_http_parser.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/aiohttp/_http_writer.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/aiohttp/_websocket/mask.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/aiohttp/_websocket/reader_c.cpython-312-x86_64-linux-gnu.so +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/caio/linux_aio.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/caio/thread_aio.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/certifi/cacert.pem +0 -4494
- package/bin/_internal/certifi/py.typed +0 -0
- package/bin/_internal/charset_normalizer/cd.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/charset_normalizer/md.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/click-8.3.2.dist-info/INSTALLER +0 -1
- package/bin/_internal/click-8.3.2.dist-info/METADATA +0 -84
- package/bin/_internal/click-8.3.2.dist-info/RECORD +0 -40
- package/bin/_internal/click-8.3.2.dist-info/WHEEL +0 -4
- package/bin/_internal/click-8.3.2.dist-info/licenses/LICENSE.txt +0 -28
- package/bin/_internal/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
- package/bin/_internal/cryptography-46.0.7.dist-info/INSTALLER +0 -1
- package/bin/_internal/cryptography-46.0.7.dist-info/METADATA +0 -139
- package/bin/_internal/cryptography-46.0.7.dist-info/RECORD +0 -180
- package/bin/_internal/cryptography-46.0.7.dist-info/WHEEL +0 -5
- package/bin/_internal/cryptography-46.0.7.dist-info/licenses/LICENSE +0 -3
- package/bin/_internal/cryptography-46.0.7.dist-info/licenses/LICENSE.APACHE +0 -202
- package/bin/_internal/cryptography-46.0.7.dist-info/licenses/LICENSE.BSD +0 -27
- 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/frozenlist/_frozenlist.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/importlib_metadata-8.7.1.dist-info/INSTALLER +0 -1
- package/bin/_internal/importlib_metadata-8.7.1.dist-info/METADATA +0 -133
- package/bin/_internal/importlib_metadata-8.7.1.dist-info/RECORD +0 -33
- package/bin/_internal/importlib_metadata-8.7.1.dist-info/WHEEL +0 -5
- package/bin/_internal/importlib_metadata-8.7.1.dist-info/licenses/LICENSE +0 -73
- package/bin/_internal/importlib_metadata-8.7.1.dist-info/top_level.txt +0 -1
- 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/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.cpython-312-x86_64-linux-gnu.so +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/libbz2.so.1.0 +0 -0
- package/bin/_internal/libcrypto.so.3 +0 -0
- package/bin/_internal/libffi.so.8 +0 -0
- package/bin/_internal/libgcc_s.so.1 +0 -0
- package/bin/_internal/liblzma.so.5 +0 -0
- package/bin/_internal/libpython3.12.so.1.0 +0 -0
- package/bin/_internal/libreadline.so.8 +0 -0
- package/bin/_internal/libssl.so.3 +0 -0
- package/bin/_internal/libstdc++.so.6 +0 -0
- package/bin/_internal/libtinfo.so.6 +0 -0
- package/bin/_internal/libuuid.so.1 +0 -0
- package/bin/_internal/libz.so.1 +0 -0
- package/bin/_internal/mcp-1.27.0.dist-info/INSTALLER +0 -1
- package/bin/_internal/mcp-1.27.0.dist-info/METADATA +0 -230
- package/bin/_internal/mcp-1.27.0.dist-info/RECORD +0 -226
- package/bin/_internal/mcp-1.27.0.dist-info/WHEEL +0 -4
- package/bin/_internal/mcp-1.27.0.dist-info/entry_points.txt +0 -2
- package/bin/_internal/mcp-1.27.0.dist-info/licenses/LICENSE +0 -21
- package/bin/_internal/multidict/_multidict.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/opentelemetry_api-1.41.0.dist-info/INSTALLER +0 -1
- package/bin/_internal/opentelemetry_api-1.41.0.dist-info/METADATA +0 -45
- package/bin/_internal/opentelemetry_api-1.41.0.dist-info/RECORD +0 -81
- package/bin/_internal/opentelemetry_api-1.41.0.dist-info/WHEEL +0 -4
- package/bin/_internal/opentelemetry_api-1.41.0.dist-info/entry_points.txt +0 -15
- package/bin/_internal/opentelemetry_api-1.41.0.dist-info/licenses/LICENSE +0 -201
- package/bin/_internal/propcache/_helpers_c.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/pydantic-2.13.2.dist-info/INSTALLER +0 -1
- package/bin/_internal/pydantic-2.13.2.dist-info/METADATA +0 -1269
- package/bin/_internal/pydantic-2.13.2.dist-info/RECORD +0 -217
- package/bin/_internal/pydantic-2.13.2.dist-info/WHEEL +0 -4
- package/bin/_internal/pydantic-2.13.2.dist-info/licenses/LICENSE +0 -21
- package/bin/_internal/pydantic_core/_pydantic_core.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_asyncio.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_bisect.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_blake2.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_bz2.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_codecs_cn.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_codecs_hk.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_codecs_iso2022.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_codecs_jp.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_codecs_kr.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_codecs_tw.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_contextvars.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_csv.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_ctypes.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_datetime.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_decimal.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_hashlib.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_heapq.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_json.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_lzma.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_md5.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_multibytecodec.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_multiprocessing.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_opcode.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_pickle.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_posixshmem.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_posixsubprocess.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_queue.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_random.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_sha1.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_sha2.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_sha3.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_socket.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_ssl.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_statistics.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_struct.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_uuid.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/_zoneinfo.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/array.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/binascii.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/fcntl.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/grp.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/math.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/mmap.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/pyexpat.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/readline.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/resource.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/select.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/syslog.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/termios.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/unicodedata.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/python3.12/lib-dynload/zlib.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/rpds/rpds.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/setuptools/_vendor/jaraco/text/Lorem ipsum.txt +0 -2
- package/bin/_internal/vicoa/_bin/README.md +0 -28
- package/bin/_internal/vicoa-1.3.10.dist-info/INSTALLER +0 -1
- package/bin/_internal/vicoa-1.3.10.dist-info/METADATA +0 -311
- package/bin/_internal/vicoa-1.3.10.dist-info/RECORD +0 -11
- package/bin/_internal/vicoa-1.3.10.dist-info/REQUESTED +0 -0
- package/bin/_internal/vicoa-1.3.10.dist-info/WHEEL +0 -5
- package/bin/_internal/vicoa-1.3.10.dist-info/direct_url.json +0 -1
- package/bin/_internal/vicoa-1.3.10.dist-info/entry_points.txt +0 -2
- package/bin/_internal/vicoa-1.3.10.dist-info/licenses/LICENSE +0 -201
- package/bin/_internal/vicoa-1.3.10.dist-info/top_level.txt +0 -3
- package/bin/_internal/watchfiles/_rust_notify.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/websockets/speedups.cpython-312-x86_64-linux-gnu.so +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 -7
- 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/yaml/_yaml.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/_internal/yarl/_quoting_c.cpython-312-x86_64-linux-gnu.so +0 -0
- package/bin/vicoa +0 -0
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: aiofile
|
|
3
|
-
Version: 3.9.0
|
|
4
|
-
Summary: Asynchronous file operations.
|
|
5
|
-
Home-page: http://github.com/mosquito/aiofile
|
|
6
|
-
License: Apache-2.0
|
|
7
|
-
Keywords: aio,python,asyncio,fileio,io
|
|
8
|
-
Author: Dmitry Orlov
|
|
9
|
-
Author-email: me@mosquito.su
|
|
10
|
-
Requires-Python: >=3.8,<4
|
|
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
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
26
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
27
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
28
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
29
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
30
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
31
|
-
Classifier: Topic :: Software Development :: Libraries
|
|
32
|
-
Classifier: Topic :: System
|
|
33
|
-
Classifier: Topic :: System :: Operating System
|
|
34
|
-
Requires-Dist: caio (>=0.9.0,<0.10.0)
|
|
35
|
-
Description-Content-Type: text/markdown
|
|
36
|
-
|
|
37
|
-
# AIOFile
|
|
38
|
-
|
|
39
|
-
[](https://github.com/mosquito/aiofile/actions?query=branch%3Amaster) [](https://pypi.python.org/pypi/aiofile/) [](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)
|
|
40
|
-
|
|
41
|
-
Real asynchronous file operations with asyncio support.
|
|
42
|
-
|
|
43
|
-
## Status
|
|
44
|
-
|
|
45
|
-
Development - Stable
|
|
46
|
-
|
|
47
|
-
## Features
|
|
48
|
-
|
|
49
|
-
* Since version 2.0.0 using [caio](https://pypi.org/project/caio), which contains linux `libaio` and two
|
|
50
|
-
thread-based implementations (c-based and pure-python).
|
|
51
|
-
* AIOFile has no internal pointer. You should pass `offset` and
|
|
52
|
-
`chunk_size` for each operation or use helpers (Reader or Writer).
|
|
53
|
-
The simplest way is to use `async_open` for creating object with
|
|
54
|
-
file-like interface.
|
|
55
|
-
* For Linux using implementation based on [libaio](https://pagure.io/libaio).
|
|
56
|
-
* For POSIX (MacOS X and optional Linux) using implementation
|
|
57
|
-
based on [threadpool](https://github.com/mbrossard/threadpool/).
|
|
58
|
-
* Otherwise using pure-python thread-based implementation.
|
|
59
|
-
* Implementation chooses automatically depending on system compatibility.
|
|
60
|
-
|
|
61
|
-
## Limitations
|
|
62
|
-
|
|
63
|
-
* Linux native AIO implementation is not able to open special files.
|
|
64
|
-
Asynchronous operations against special fs like `/proc/` `/sys/` are not
|
|
65
|
-
supported by the kernel. It's not a aiofile's or caio issue.
|
|
66
|
-
In these cases, you might switch to thread-based implementations
|
|
67
|
-
(see [Troubleshooting](#troubleshooting) section).
|
|
68
|
-
However, when used on supported file systems, the linux implementation has a
|
|
69
|
-
smaller overhead and is preferred but it's not a silver bullet.
|
|
70
|
-
|
|
71
|
-
## Code examples
|
|
72
|
-
|
|
73
|
-
All code examples require Python 3.6+.
|
|
74
|
-
|
|
75
|
-
### High-level API
|
|
76
|
-
|
|
77
|
-
#### `async_open` helper
|
|
78
|
-
|
|
79
|
-
Helper mimics python file-like objects, it returns file-like
|
|
80
|
-
objects with similar but async methods.
|
|
81
|
-
|
|
82
|
-
Supported methods:
|
|
83
|
-
|
|
84
|
-
* `async def read(length = -1)` - reading chunk from file, when length is
|
|
85
|
-
`-1`, will be reading file to the end.
|
|
86
|
-
* `async def write(data)` - writing chunk to file
|
|
87
|
-
* `def seek(offset)` - setting file pointer position
|
|
88
|
-
* `def tell()` - returns current file pointer position
|
|
89
|
-
* `async def readline(size=-1, newline="\n")` - read chunks until
|
|
90
|
-
newline or EOF. Since version 3.7.0 `__aiter__` returns `LineReader`.
|
|
91
|
-
|
|
92
|
-
This method is suboptimal for small lines because it doesn't reuse read buffer.
|
|
93
|
-
When you want to read file by lines please avoid using `async_open`
|
|
94
|
-
use `LineReader` instead.
|
|
95
|
-
* `def __aiter__() -> LineReader` - iterator over lines.
|
|
96
|
-
* `def iter_chunked(chunk_size: int = 32768) -> Reader` - iterator over
|
|
97
|
-
chunks.
|
|
98
|
-
* `.file` property contains AIOFile object
|
|
99
|
-
|
|
100
|
-
Basic example:
|
|
101
|
-
|
|
102
|
-
<!-- name: test_basic -->
|
|
103
|
-
```python
|
|
104
|
-
import asyncio
|
|
105
|
-
from pathlib import Path
|
|
106
|
-
from tempfile import gettempdir
|
|
107
|
-
|
|
108
|
-
from aiofile import async_open
|
|
109
|
-
|
|
110
|
-
tmp_filename = Path(gettempdir()) / "hello.txt"
|
|
111
|
-
|
|
112
|
-
async def main():
|
|
113
|
-
async with async_open(tmp_filename, 'w+') as afp:
|
|
114
|
-
await afp.write("Hello ")
|
|
115
|
-
await afp.write("world")
|
|
116
|
-
afp.seek(0)
|
|
117
|
-
|
|
118
|
-
print(await afp.read())
|
|
119
|
-
|
|
120
|
-
await afp.write("Hello from\nasync world")
|
|
121
|
-
print(await afp.readline())
|
|
122
|
-
print(await afp.readline())
|
|
123
|
-
|
|
124
|
-
asyncio.run(main())
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Example without context manager:
|
|
128
|
-
|
|
129
|
-
<!-- name: test_basic_without_context_manager -->
|
|
130
|
-
```python
|
|
131
|
-
import asyncio
|
|
132
|
-
import atexit
|
|
133
|
-
import os
|
|
134
|
-
from tempfile import mktemp
|
|
135
|
-
|
|
136
|
-
from aiofile import async_open
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
TMP_NAME = mktemp()
|
|
140
|
-
atexit.register(os.unlink, TMP_NAME)
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
async def main():
|
|
144
|
-
afp = await async_open(TMP_NAME, "w")
|
|
145
|
-
await afp.write("Hello")
|
|
146
|
-
await afp.close()
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
asyncio.run(main())
|
|
150
|
-
assert open(TMP_NAME, "r").read() == "Hello"
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Concatenate example program (`cat`):
|
|
154
|
-
|
|
155
|
-
```python
|
|
156
|
-
import asyncio
|
|
157
|
-
import sys
|
|
158
|
-
from argparse import ArgumentParser
|
|
159
|
-
from pathlib import Path
|
|
160
|
-
|
|
161
|
-
from aiofile import async_open
|
|
162
|
-
|
|
163
|
-
parser = ArgumentParser(
|
|
164
|
-
description="Read files line by line using asynchronous io API"
|
|
165
|
-
)
|
|
166
|
-
parser.add_argument("file_name", nargs="+", type=Path)
|
|
167
|
-
|
|
168
|
-
async def main(arguments):
|
|
169
|
-
for src in arguments.file_name:
|
|
170
|
-
async with async_open(src, "r") as afp:
|
|
171
|
-
async for line in afp:
|
|
172
|
-
sys.stdout.write(line)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
asyncio.run(main(parser.parse_args()))
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
Copy file example program (`cp`):
|
|
179
|
-
|
|
180
|
-
```python
|
|
181
|
-
import asyncio
|
|
182
|
-
from argparse import ArgumentParser
|
|
183
|
-
from pathlib import Path
|
|
184
|
-
|
|
185
|
-
from aiofile import async_open
|
|
186
|
-
|
|
187
|
-
parser = ArgumentParser(
|
|
188
|
-
description="Copying files using asynchronous io API"
|
|
189
|
-
)
|
|
190
|
-
parser.add_argument("source", type=Path)
|
|
191
|
-
parser.add_argument("dest", type=Path)
|
|
192
|
-
parser.add_argument("--chunk-size", type=int, default=65535)
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
async def main(arguments):
|
|
196
|
-
async with async_open(arguments.source, "rb") as src, \
|
|
197
|
-
async_open(arguments.dest, "wb") as dest:
|
|
198
|
-
async for chunk in src.iter_chunked(arguments.chunk_size):
|
|
199
|
-
await dest.write(chunk)
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
asyncio.run(main(parser.parse_args()))
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Example with opening already open file pointer:
|
|
206
|
-
|
|
207
|
-
```python
|
|
208
|
-
import asyncio
|
|
209
|
-
from typing import IO, Any
|
|
210
|
-
from aiofile import async_open
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
async def main(fp: IO[Any]):
|
|
214
|
-
async with async_open(fp) as afp:
|
|
215
|
-
await afp.write("Hello from\nasync world")
|
|
216
|
-
print(await afp.readline())
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
with open("test.txt", "w+") as fp:
|
|
220
|
-
asyncio.run(main(fp))
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
Linux native aio doesn't support reading and writing special files
|
|
224
|
-
(e.g. procfs/sysfs/unix pipes/etc.), so you can perform operations with
|
|
225
|
-
these files using compatible context objects.
|
|
226
|
-
|
|
227
|
-
```python
|
|
228
|
-
import asyncio
|
|
229
|
-
from aiofile import async_open
|
|
230
|
-
from caio import thread_aio_asyncio
|
|
231
|
-
from contextlib import AsyncExitStack
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
async def main():
|
|
235
|
-
async with AsyncExitStack() as stack:
|
|
236
|
-
|
|
237
|
-
# Custom context should be reused
|
|
238
|
-
ctx = await stack.enter_async_context(
|
|
239
|
-
thread_aio_asyncio.AsyncioContext()
|
|
240
|
-
)
|
|
241
|
-
|
|
242
|
-
# Open special file with custom context
|
|
243
|
-
src = await stack.enter_async_context(
|
|
244
|
-
async_open("/proc/cpuinfo", "r", context=ctx)
|
|
245
|
-
)
|
|
246
|
-
|
|
247
|
-
# Open regular file with default context
|
|
248
|
-
dest = await stack.enter_async_context(
|
|
249
|
-
async_open("/tmp/cpuinfo", "w")
|
|
250
|
-
)
|
|
251
|
-
|
|
252
|
-
# Copying file content line by line
|
|
253
|
-
async for line in src:
|
|
254
|
-
await dest.write(line)
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
asyncio.run(main())
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
### Low-level API
|
|
261
|
-
|
|
262
|
-
The `AIOFile` class is a low-level interface for asynchronous file operations, and the read and write methods accept
|
|
263
|
-
an `offset=0` in bytes at which the operation will be performed.
|
|
264
|
-
|
|
265
|
-
This allows you to do many independent IO operations on a once open file without moving the virtual carriage.
|
|
266
|
-
|
|
267
|
-
For example, you may make 10 concurrent HTTP requests by specifying the `Range` header, and asynchronously write
|
|
268
|
-
one opened file, while the offsets must either be calculated manually, or use 10 instances of `Writer` with
|
|
269
|
-
specified initial offsets.
|
|
270
|
-
|
|
271
|
-
In order to provide sequential reading and writing, there is `Writer`, `Reader` and `LineReader`. Keep in mind
|
|
272
|
-
`async_open` is not the same as AIOFile, it provides a similar interface for file operations, it simulates methods
|
|
273
|
-
like read or write as it is implemented in the built-in open.
|
|
274
|
-
|
|
275
|
-
```python
|
|
276
|
-
import asyncio
|
|
277
|
-
from aiofile import AIOFile
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
async def main():
|
|
281
|
-
async with AIOFile("hello.txt", 'w+') as afp:
|
|
282
|
-
payload = "Hello world\n"
|
|
283
|
-
|
|
284
|
-
await asyncio.gather(
|
|
285
|
-
*[afp.write(payload, offset=i * len(payload)) for i in range(10)]
|
|
286
|
-
)
|
|
287
|
-
|
|
288
|
-
await afp.fsync()
|
|
289
|
-
|
|
290
|
-
assert await afp.read(len(payload) * 10) == payload * 10
|
|
291
|
-
|
|
292
|
-
asyncio.run(main())
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
The Low-level API in fact is just little bit sugared `caio` API.
|
|
296
|
-
|
|
297
|
-
```python
|
|
298
|
-
import asyncio
|
|
299
|
-
from aiofile import AIOFile
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
async def main():
|
|
303
|
-
async with AIOFile("/tmp/hello.txt", 'w+') as afp:
|
|
304
|
-
await afp.write("Hello ")
|
|
305
|
-
await afp.write("world", offset=7)
|
|
306
|
-
await afp.fsync()
|
|
307
|
-
|
|
308
|
-
print(await afp.read())
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
asyncio.run(main())
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
#### `Reader` and `Writer`
|
|
315
|
-
|
|
316
|
-
When you want to read or write file linearly following example
|
|
317
|
-
might be helpful.
|
|
318
|
-
|
|
319
|
-
```python
|
|
320
|
-
import asyncio
|
|
321
|
-
from aiofile import AIOFile, Reader, Writer
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
async def main():
|
|
325
|
-
async with AIOFile("/tmp/hello.txt", 'w+') as afp:
|
|
326
|
-
writer = Writer(afp)
|
|
327
|
-
reader = Reader(afp, chunk_size=8)
|
|
328
|
-
|
|
329
|
-
await writer("Hello")
|
|
330
|
-
await writer(" ")
|
|
331
|
-
await writer("World")
|
|
332
|
-
await afp.fsync()
|
|
333
|
-
|
|
334
|
-
async for chunk in reader:
|
|
335
|
-
print(chunk)
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
asyncio.run(main())
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
#### `LineReader` - read file line by line
|
|
342
|
-
|
|
343
|
-
LineReader is a helper that is very effective when you want to read a file
|
|
344
|
-
linearly and line by line.
|
|
345
|
-
|
|
346
|
-
It contains a buffer and will read the fragments of the file chunk by
|
|
347
|
-
chunk into the buffer, where it will try to find lines.
|
|
348
|
-
|
|
349
|
-
The default chunk size is 4KB.
|
|
350
|
-
|
|
351
|
-
```python
|
|
352
|
-
import asyncio
|
|
353
|
-
from aiofile import AIOFile, LineReader, Writer
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
async def main():
|
|
357
|
-
async with AIOFile("/tmp/hello.txt", 'w+') as afp:
|
|
358
|
-
writer = Writer(afp)
|
|
359
|
-
|
|
360
|
-
await writer("Hello")
|
|
361
|
-
await writer(" ")
|
|
362
|
-
await writer("World")
|
|
363
|
-
await writer("\n")
|
|
364
|
-
await writer("\n")
|
|
365
|
-
await writer("From async world")
|
|
366
|
-
await afp.fsync()
|
|
367
|
-
|
|
368
|
-
async for line in LineReader(afp):
|
|
369
|
-
print(line)
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
asyncio.run(main())
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
When you want to read file by lines please avoid to use `async_open`
|
|
376
|
-
use `LineReader` instead.
|
|
377
|
-
|
|
378
|
-
## More examples
|
|
379
|
-
|
|
380
|
-
Useful examples with `aiofile`
|
|
381
|
-
|
|
382
|
-
### Async CSV Dict Reader
|
|
383
|
-
|
|
384
|
-
```python
|
|
385
|
-
import asyncio
|
|
386
|
-
import io
|
|
387
|
-
from csv import DictReader
|
|
388
|
-
|
|
389
|
-
from aiofile import AIOFile, LineReader
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
class AsyncDictReader:
|
|
393
|
-
def __init__(self, afp, **kwargs):
|
|
394
|
-
self.buffer = io.BytesIO()
|
|
395
|
-
self.file_reader = LineReader(
|
|
396
|
-
afp, line_sep=kwargs.pop('line_sep', '\n'),
|
|
397
|
-
chunk_size=kwargs.pop('chunk_size', 4096),
|
|
398
|
-
offset=kwargs.pop('offset', 0),
|
|
399
|
-
)
|
|
400
|
-
self.reader = DictReader(
|
|
401
|
-
io.TextIOWrapper(
|
|
402
|
-
self.buffer,
|
|
403
|
-
encoding=kwargs.pop('encoding', 'utf-8'),
|
|
404
|
-
errors=kwargs.pop('errors', 'replace'),
|
|
405
|
-
), **kwargs,
|
|
406
|
-
)
|
|
407
|
-
self.line_num = 0
|
|
408
|
-
|
|
409
|
-
def __aiter__(self):
|
|
410
|
-
return self
|
|
411
|
-
|
|
412
|
-
async def __anext__(self):
|
|
413
|
-
if self.line_num == 0:
|
|
414
|
-
header = await self.file_reader.readline()
|
|
415
|
-
self.buffer.write(header)
|
|
416
|
-
|
|
417
|
-
line = await self.file_reader.readline()
|
|
418
|
-
|
|
419
|
-
if not line:
|
|
420
|
-
raise StopAsyncIteration
|
|
421
|
-
|
|
422
|
-
self.buffer.write(line)
|
|
423
|
-
self.buffer.seek(0)
|
|
424
|
-
|
|
425
|
-
try:
|
|
426
|
-
result = next(self.reader)
|
|
427
|
-
except StopIteration as e:
|
|
428
|
-
raise StopAsyncIteration from e
|
|
429
|
-
|
|
430
|
-
self.buffer.seek(0)
|
|
431
|
-
self.buffer.truncate(0)
|
|
432
|
-
self.line_num = self.reader.line_num
|
|
433
|
-
|
|
434
|
-
return result
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
async def main():
|
|
438
|
-
async with AIOFile('sample.csv', 'rb') as afp:
|
|
439
|
-
async for item in AsyncDictReader(afp):
|
|
440
|
-
print(item)
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
asyncio.run(main())
|
|
444
|
-
```
|
|
445
|
-
|
|
446
|
-
## Troubleshooting
|
|
447
|
-
|
|
448
|
-
The caio `linux` implementation works normal for modern linux kernel versions
|
|
449
|
-
and file systems. So you may have problems specific for your environment.
|
|
450
|
-
It's not a bug and might be resolved some ways:
|
|
451
|
-
|
|
452
|
-
1. Upgrade the kernel
|
|
453
|
-
2. Use compatible file systems
|
|
454
|
-
3. Use threads based or pure python implementation.
|
|
455
|
-
|
|
456
|
-
The caio since version 0.7.0 contains some ways to do this.
|
|
457
|
-
|
|
458
|
-
1. In runtime use the environment variable `CAIO_IMPL` with
|
|
459
|
-
possible values:
|
|
460
|
-
|
|
461
|
-
* `linux` - use native linux kernels aio mechanism
|
|
462
|
-
* `thread` - use thread based implementation written in C
|
|
463
|
-
* `python` - use pure python implementation
|
|
464
|
-
|
|
465
|
-
2. File `default_implementation` located near `__init__.py` in caio
|
|
466
|
-
installation path. It's useful for distros package maintainers. This file
|
|
467
|
-
might contains comments (lines starts with `#` symbol) and the first line
|
|
468
|
-
should be one of `linux` `thread` or `python`.
|
|
469
|
-
|
|
470
|
-
3. You might manually manage contexts:
|
|
471
|
-
|
|
472
|
-
```python
|
|
473
|
-
import asyncio
|
|
474
|
-
|
|
475
|
-
from aiofile import async_open
|
|
476
|
-
from caio import linux_aio_asyncio, thread_aio_asyncio
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
async def main():
|
|
480
|
-
linux_ctx = linux_aio_asyncio.AsyncioContext()
|
|
481
|
-
threads_ctx = thread_aio_asyncio.AsyncioContext()
|
|
482
|
-
|
|
483
|
-
async with async_open("/tmp/test.txt", "w", context=linux_ctx) as afp:
|
|
484
|
-
await afp.write("Hello")
|
|
485
|
-
|
|
486
|
-
async with async_open("/tmp/test.txt", "r", context=threads_ctx) as afp:
|
|
487
|
-
print(await afp.read())
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
asyncio.run(main())
|
|
491
|
-
```
|
|
492
|
-
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
aiofile-3.9.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
|
2
|
-
aiofile-3.9.0.dist-info/LICENCE,sha256=7GQBUOA3dNG1Jk-yaPOCncNnRVURCRMev23QpZ1ew-s,10495
|
|
3
|
-
aiofile-3.9.0.dist-info/LICENCE.md,sha256=7GQBUOA3dNG1Jk-yaPOCncNnRVURCRMev23QpZ1ew-s,10495
|
|
4
|
-
aiofile-3.9.0.dist-info/METADATA,sha256=zlrmdokR-TvPMaMTeGvp9rtpqqoSkMIG76QPqfB50lI,14046
|
|
5
|
-
aiofile-3.9.0.dist-info/RECORD,,
|
|
6
|
-
aiofile-3.9.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
7
|
-
aiofile/__init__.py,sha256=7yc9jKAQNFC1bYghRlMM_tvMlqNXBoWFC0DHrVtZimg,618
|
|
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=YvUNB51-p7MjwcTwQsZUKnahrNnfloJohyQRhhGONOU,9147
|
|
13
|
-
aiofile/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
14
|
-
aiofile/utils.py,sha256=fSmImBPaZrFmiHXn0x0UrUa3T9NPa13YK6kcqO1Viow,10607
|
|
15
|
-
aiofile/version.py,sha256=4JIbHoxFpAICH6rY5oqXJ8_iP-wLwyx3U2YNgk2nUZI,483
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
pip
|