asanypath 2.0.0__tar.gz → 2.1.0__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.
- {asanypath-2.0.0 → asanypath-2.1.0}/.github/workflows/publish.yml +16 -8
- {asanypath-2.0.0 → asanypath-2.1.0}/.github/workflows/unittests.yml +1 -1
- {asanypath-2.0.0 → asanypath-2.1.0}/PKG-INFO +50 -39
- {asanypath-2.0.0 → asanypath-2.1.0}/README.md +47 -33
- {asanypath-2.0.0 → asanypath-2.1.0}/pyproject.toml +2 -2
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/_version.py +2 -2
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/artifactory.py +14 -7
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/azure.py +4 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/cli.py +1 -1
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/cloud.py +62 -14
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/ftp.py +1 -1
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/gcs.py +4 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/http.py +2 -5
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/s3.py +83 -61
- asanypath-2.1.0/src/asanypath/ssh.py +594 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath_native.pyi +26 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_cli.py +3 -15
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_s3.py +89 -31
- asanypath-2.1.0/tests/test_ssh.py +560 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/uv.lock +15 -21
- asanypath-2.0.0/src/asanypath/ssh.py +0 -776
- asanypath-2.0.0/tests/test_ssh.py +0 -995
- {asanypath-2.0.0 → asanypath-2.1.0}/.copilot/skills/async-python-lib/SKILL.md +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/.copilot/skills/gitguro/SKILL.md +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/.github/CODEOWNERS +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/.github/dependabot.yml +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/.gitignore +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/.pre-commit-config.yaml +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/CODE_OF_CONDUCT.md +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/CONTRIBUTING.md +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/LICENSE +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/SECURITY.md +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/asanypath.png +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/compose.yml +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/hatch_build.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/scripts/bench.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/__init__.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/__init__.pyi +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/_credstore.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/_transfer.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/asanypath.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/asanypath.pyi +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/batcher.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/common.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/exceptions.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/local.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/options.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/sync.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/src/asanypath/unsupported.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/__init__.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/conftest.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_artifactory.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_asanypath.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_azure.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_batcher.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_cloudpathmixin.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_commonpathmixin.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_credstore.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_ftp.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_gcs.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_http.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_http_auth.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_local.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_sync.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_syncpath.py +0 -0
- {asanypath-2.0.0 → asanypath-2.1.0}/tests/test_unsupported_path.py +0 -0
|
@@ -3,6 +3,12 @@ name: Publish Python and native Package to pypi
|
|
|
3
3
|
on:
|
|
4
4
|
release:
|
|
5
5
|
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
release_tag:
|
|
9
|
+
description: Existing v<major>.<minor>.<patch> tag to build and publish
|
|
10
|
+
required: true
|
|
11
|
+
type: string
|
|
6
12
|
|
|
7
13
|
permissions:
|
|
8
14
|
contents: read
|
|
@@ -11,17 +17,19 @@ jobs:
|
|
|
11
17
|
release-version:
|
|
12
18
|
runs-on: ubuntu-latest
|
|
13
19
|
outputs:
|
|
20
|
+
tag: ${{ steps.version.outputs.tag }}
|
|
14
21
|
value: ${{ steps.version.outputs.value }}
|
|
15
22
|
steps:
|
|
16
23
|
- name: Validate release tag
|
|
17
24
|
id: version
|
|
18
25
|
env:
|
|
19
|
-
TAG: ${{ github.event.release.tag_name }}
|
|
26
|
+
TAG: ${{ inputs.release_tag || github.event.release.tag_name }}
|
|
20
27
|
run: |
|
|
21
28
|
case "$TAG" in
|
|
22
29
|
v[0-9]*.[0-9]*.[0-9]*) ;;
|
|
23
30
|
*) echo "Release tag must be v<major>.<minor>.<patch>." >&2; exit 1 ;;
|
|
24
31
|
esac
|
|
32
|
+
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
|
|
25
33
|
echo "value=${TAG#v}" >> "$GITHUB_OUTPUT"
|
|
26
34
|
|
|
27
35
|
build-native:
|
|
@@ -33,7 +41,7 @@ jobs:
|
|
|
33
41
|
- os: ubuntu-latest
|
|
34
42
|
target: x86_64
|
|
35
43
|
manylinux: auto
|
|
36
|
-
- os: macos-
|
|
44
|
+
- os: macos-15-intel
|
|
37
45
|
target: x86_64
|
|
38
46
|
manylinux: off
|
|
39
47
|
- os: macos-14
|
|
@@ -47,7 +55,7 @@ jobs:
|
|
|
47
55
|
- name: Checkout release
|
|
48
56
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
49
57
|
with:
|
|
50
|
-
ref: ${{
|
|
58
|
+
ref: ${{ needs.release-version.outputs.tag }}
|
|
51
59
|
fetch-depth: 0
|
|
52
60
|
persist-credentials: false
|
|
53
61
|
|
|
@@ -81,7 +89,7 @@ jobs:
|
|
|
81
89
|
- name: Checkout release
|
|
82
90
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
83
91
|
with:
|
|
84
|
-
ref: ${{
|
|
92
|
+
ref: ${{ needs.release-version.outputs.tag }}
|
|
85
93
|
fetch-depth: 0
|
|
86
94
|
persist-credentials: false
|
|
87
95
|
|
|
@@ -94,7 +102,7 @@ jobs:
|
|
|
94
102
|
rm rust/Cargo.toml.bak
|
|
95
103
|
|
|
96
104
|
- name: Set up uv
|
|
97
|
-
uses: astral-sh/setup-uv@
|
|
105
|
+
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
|
|
98
106
|
with:
|
|
99
107
|
enable-cache: false
|
|
100
108
|
|
|
@@ -115,12 +123,12 @@ jobs:
|
|
|
115
123
|
- name: Checkout release
|
|
116
124
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
|
117
125
|
with:
|
|
118
|
-
ref: ${{
|
|
126
|
+
ref: ${{ needs.release-version.outputs.tag }}
|
|
119
127
|
fetch-depth: 0
|
|
120
128
|
persist-credentials: false
|
|
121
129
|
|
|
122
130
|
- name: Set up uv
|
|
123
|
-
uses: astral-sh/setup-uv@
|
|
131
|
+
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
|
|
124
132
|
with:
|
|
125
133
|
enable-cache: false
|
|
126
134
|
|
|
@@ -131,7 +139,7 @@ jobs:
|
|
|
131
139
|
env:
|
|
132
140
|
VERSION: ${{ needs.release-version.outputs.value }}
|
|
133
141
|
run: |
|
|
134
|
-
unzip -p dist/*.whl '*/METADATA' | grep -Fx "Requires-Dist: asanypath-native~=${VERSION}.0"
|
|
142
|
+
unzip -p dist/*.whl '*/METADATA' | grep -Fx "Requires-Dist: asanypath-native~=${VERSION%.*}.0"
|
|
135
143
|
|
|
136
144
|
- name: Upload Python distributions
|
|
137
145
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
|
@@ -44,7 +44,7 @@ jobs:
|
|
|
44
44
|
python-version: ${{ matrix.python-version }}
|
|
45
45
|
|
|
46
46
|
- name: Set up uv
|
|
47
|
-
uses: astral-sh/setup-uv@
|
|
47
|
+
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
|
|
48
48
|
|
|
49
49
|
- name: Ruff checks
|
|
50
50
|
run: uvx ruff check src tests && uvx ruff format --check src tests
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: asanypath
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: Async pathlib for local and cloud storage
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -19,17 +19,17 @@ Classifier: Programming Language :: Python :: 3.14
|
|
|
19
19
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
20
|
Requires-Python: >=3.10
|
|
21
21
|
Requires-Dist: anyio>=4
|
|
22
|
-
Requires-Dist: asanypath-native~=2.
|
|
22
|
+
Requires-Dist: asanypath-native~=2.1.0
|
|
23
23
|
Requires-Dist: msgspec>=0.21.1
|
|
24
24
|
Requires-Dist: yarl>=1.2
|
|
25
25
|
Provides-Extra: all
|
|
26
26
|
Requires-Dist: aioftp>=0.21; extra == 'all'
|
|
27
|
-
Requires-Dist: asyncssh>=2.14; extra == 'all'
|
|
28
27
|
Requires-Dist: keyring>=24; extra == 'all'
|
|
29
28
|
Provides-Extra: bench
|
|
30
29
|
Requires-Dist: adlfs; extra == 'bench'
|
|
31
30
|
Requires-Dist: aiobotocore; extra == 'bench'
|
|
32
31
|
Requires-Dist: aiofiles; extra == 'bench'
|
|
32
|
+
Requires-Dist: asyncssh>=2.14; extra == 'bench'
|
|
33
33
|
Requires-Dist: azure-storage-blob; extra == 'bench'
|
|
34
34
|
Requires-Dist: cloudpathlib[all]; extra == 'bench'
|
|
35
35
|
Requires-Dist: fsspec; extra == 'bench'
|
|
@@ -43,7 +43,6 @@ Provides-Extra: credstore
|
|
|
43
43
|
Requires-Dist: keyring>=24; extra == 'credstore'
|
|
44
44
|
Provides-Extra: dev
|
|
45
45
|
Requires-Dist: aioftp>=0.21; extra == 'dev'
|
|
46
|
-
Requires-Dist: asyncssh>=2.14; extra == 'dev'
|
|
47
46
|
Requires-Dist: keyring>=24; extra == 'dev'
|
|
48
47
|
Requires-Dist: pre-commit>=4; extra == 'dev'
|
|
49
48
|
Requires-Dist: pytest-asyncio>=1.3; extra == 'dev'
|
|
@@ -52,8 +51,6 @@ Requires-Dist: pytest>=8; extra == 'dev'
|
|
|
52
51
|
Requires-Dist: rich-click>=1.9.7; extra == 'dev'
|
|
53
52
|
Provides-Extra: ftp
|
|
54
53
|
Requires-Dist: aioftp>=0.21; extra == 'ftp'
|
|
55
|
-
Provides-Extra: ssh
|
|
56
|
-
Requires-Dist: asyncssh>=2.14; extra == 'ssh'
|
|
57
54
|
Description-Content-Type: text/markdown
|
|
58
55
|
|
|
59
56
|
©2026 Axis Communications AB. AXIS COMMUNICATIONS, AXIS, ARTPEC and VAPIX are registered trademarks of Axis AB in various jurisdictions. All other trademarks are the property of their respective owners.
|
|
@@ -76,6 +73,9 @@ locally before connecting to a cloud account.
|
|
|
76
73
|
|
|
77
74
|
- Python 3.10 through 3.14.
|
|
78
75
|
- Access credentials for each cloud service that your application uses.
|
|
76
|
+
|
|
77
|
+
S3 authentication accepts explicit keys or uses the AWS SDK credential provider
|
|
78
|
+
chain (including shared profiles and IAM roles) when keys are not supplied.
|
|
79
79
|
- A POSIX-compatible shell such as Bash or Zsh for the terminal commands below.
|
|
80
80
|
Windows users can use Windows Subsystem for Linux or adapt the commands for
|
|
81
81
|
PowerShell.
|
|
@@ -182,8 +182,8 @@ uv sync
|
|
|
182
182
|
# With CLI
|
|
183
183
|
uv sync --extra cli
|
|
184
184
|
|
|
185
|
-
# With
|
|
186
|
-
uv sync --extra
|
|
185
|
+
# With FTP backend support (SSH/SFTP is built in — no extra needed)
|
|
186
|
+
uv sync --extra ftp
|
|
187
187
|
|
|
188
188
|
# With OS keyring-backed credential cache
|
|
189
189
|
uv sync --extra credstore
|
|
@@ -343,63 +343,66 @@ uv run --extra bench python scripts/bench.py --backend art --rounds 3 --concurre
|
|
|
343
343
|
|
|
344
344
|
| Operation | asanypath | s3fs | aiobotocore | cloudpathlib |
|
|
345
345
|
|-----------|-----------|------|-------------|--------------|
|
|
346
|
-
| write | 8.
|
|
347
|
-
| read |
|
|
348
|
-
| exists | 3.
|
|
349
|
-
| iterdir |
|
|
346
|
+
| write | **8.80 ms** | 12.67 ms | 28.07 ms | 41.75 ms |
|
|
347
|
+
| read | **3.78 ms** | 9.10 ms | 23.15 ms | 12.83 ms |
|
|
348
|
+
| exists | **3.57 ms** | 4.25 ms | 21.92 ms | 4.02 ms |
|
|
349
|
+
| iterdir | 40.55 ms | 39.16 ms | 56.49 ms | **39.07 ms** |
|
|
350
350
|
|
|
351
351
|
### Azure — Azurite emulator (median of 20 rounds, 10 objects, c=1)
|
|
352
352
|
|
|
353
353
|
| Operation | asanypath | azure-sdk | adlfs | cloudpathlib |
|
|
354
354
|
|-----------|-----------|-----------|-------|--------------|
|
|
355
|
-
| write | 1.
|
|
356
|
-
| read | 0.
|
|
357
|
-
| exists | 0.
|
|
358
|
-
| iterdir |
|
|
355
|
+
| write | **1.24 ms** | 1.79 ms | 2.34 ms | 7.88 ms |
|
|
356
|
+
| read | **0.51 ms** | 1.15 ms | 2.44 ms | 3.19 ms |
|
|
357
|
+
| exists | **0.35 ms** | 0.95 ms | 0.98 ms | 1.04 ms |
|
|
358
|
+
| iterdir | **0.88 ms** | 2.40 ms | 4.11 ms | 2.72 ms |
|
|
359
359
|
|
|
360
360
|
### GCS — fake-gcs-server emulator (median of 20 rounds, 10 objects, c=1)
|
|
361
361
|
|
|
362
362
|
| Operation | asanypath | gcloud-aio | cloudpathlib | gcsfs |
|
|
363
363
|
|-----------|-----------|------------|--------------|-------|
|
|
364
|
-
| write | 0.
|
|
365
|
-
| read | 0.
|
|
366
|
-
| exists | 0.
|
|
367
|
-
| iterdir | 0.
|
|
364
|
+
| write | **0.45 ms** | 0.51 ms | 3.53 ms | 0.58 ms |
|
|
365
|
+
| read | 0.22 ms | **0.18 ms** | 1.48 ms | 0.30 ms |
|
|
366
|
+
| exists | **0.15 ms** | 0.18 ms | 0.50 ms | 0.46 ms |
|
|
367
|
+
| iterdir | **0.19 ms** | 0.25 ms | 0.69 ms | 0.33 ms |
|
|
368
368
|
|
|
369
369
|
### Artifactory — live server (median of 20 rounds, 10 objects, c=1)
|
|
370
370
|
|
|
371
371
|
| Operation | asanypath | aiohttp | requests |
|
|
372
372
|
|-----------|-----------|---------|----------|
|
|
373
|
-
| write |
|
|
374
|
-
| read |
|
|
375
|
-
| exists | 2.
|
|
376
|
-
| iterdir |
|
|
373
|
+
| write | **54.49 ms** | 54.75 ms | 57.57 ms |
|
|
374
|
+
| read | **2.83 ms** | 3.09 ms | 12.01 ms |
|
|
375
|
+
| exists | 2.33 ms | **2.18 ms** | 4.61 ms |
|
|
376
|
+
| iterdir | **2.85 ms** | 3.07 ms | 7.88 ms |
|
|
377
377
|
|
|
378
378
|
### SSH / SFTP — localhost emulator (median of 20 rounds, 10 objects, c=1)
|
|
379
379
|
|
|
380
|
+
asanypath uses a built-in native russh SFTP transport (off-GIL); `asyncssh` is
|
|
381
|
+
shown only as a benchmark baseline.
|
|
382
|
+
|
|
380
383
|
| Operation | asanypath | asyncssh |
|
|
381
384
|
|-----------|-----------|----------|
|
|
382
|
-
| write | 0.
|
|
383
|
-
| read | 0.
|
|
384
|
-
| exists | 0.
|
|
385
|
-
| iterdir | 0.
|
|
385
|
+
| write | **0.16 ms** | 0.33 ms |
|
|
386
|
+
| read | **0.21 ms** | 0.36 ms |
|
|
387
|
+
| exists | **0.07 ms** | 0.11 ms |
|
|
388
|
+
| iterdir | **0.23 ms** | 0.44 ms |
|
|
386
389
|
|
|
387
390
|
### FTP — localhost emulator (median of 20 rounds, 10 objects, c=1)
|
|
388
391
|
|
|
389
392
|
| Operation | asanypath | aioftp |
|
|
390
393
|
|-----------|-----------|--------|
|
|
391
|
-
| write | 0.
|
|
392
|
-
| read | 0.
|
|
393
|
-
| exists | 1.
|
|
394
|
-
| iterdir | 1.
|
|
394
|
+
| write | **0.35 ms** | 0.41 ms |
|
|
395
|
+
| read | **0.35 ms** | 0.40 ms |
|
|
396
|
+
| exists | **1.00 ms** | 1.13 ms |
|
|
397
|
+
| iterdir | 1.09 ms | **1.04 ms** |
|
|
395
398
|
|
|
396
399
|
Latencies are per-operation medians over 20 rounds. S3 and Artifactory ran
|
|
397
400
|
against live services; Azure, GCS, SSH/SFTP, and FTP against local emulators
|
|
398
401
|
(Azurite, fake-gcs-server, and localhost sftp/ftp), so those figures reflect
|
|
399
|
-
client-library overhead, not WAN latency.
|
|
400
|
-
|
|
401
|
-
dedicated client libraries on most
|
|
402
|
-
API across all backends.
|
|
402
|
+
client-library overhead, not WAN latency. The SSH/SFTP transport is a built-in
|
|
403
|
+
native russh backend that runs SFTP off-GIL and beats asyncssh on every
|
|
404
|
+
operation. asanypath matches or beats dedicated client libraries on most
|
|
405
|
+
operations while providing a single unified API across all backends.
|
|
403
406
|
|
|
404
407
|
## How It Works
|
|
405
408
|
|
|
@@ -413,9 +416,17 @@ API across all backends.
|
|
|
413
416
|
| `az://`, `azure://` | `AzurePath` | reqwest + SharedKey |
|
|
414
417
|
| `art://` | `ArtifactoryPath` | reqwest + Bearer |
|
|
415
418
|
| `http://`, `https://` | `HTTPPath` / `HTTPSPath` | reqwest |
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
+
| `ssh://` | `SSHPath` | native russh (SFTP) |
|
|
420
|
+
| `ftp://` | `FTPPath` | `aioftp` |
|
|
421
|
+
| `ftps://` | `FTPSPath` | `aioftp` + TLS |
|
|
422
|
+
| any other scheme | `UnsupportedProtocolPath` | none — pure-path only |
|
|
423
|
+
|
|
424
|
+
Cloud and HTTP network I/O is handled by `asanypath-native` (Rust/PyO3 + reqwest)
|
|
425
|
+
with jittered exponential backoff retry for transient errors. SSH/SFTP uses a
|
|
426
|
+
built-in off-GIL native russh transport (no Python SSH dependency); FTP/FTPS use
|
|
427
|
+
`aioftp`. Unknown schemes construct an `UnsupportedProtocolPath`: pure-path
|
|
428
|
+
operations (`.name`, `.parent`, joins) work, while any backend operation raises
|
|
429
|
+
`UnsupportedProtocolError`.
|
|
419
430
|
|
|
420
431
|
## API Reference
|
|
421
432
|
|
|
@@ -18,6 +18,9 @@ locally before connecting to a cloud account.
|
|
|
18
18
|
|
|
19
19
|
- Python 3.10 through 3.14.
|
|
20
20
|
- Access credentials for each cloud service that your application uses.
|
|
21
|
+
|
|
22
|
+
S3 authentication accepts explicit keys or uses the AWS SDK credential provider
|
|
23
|
+
chain (including shared profiles and IAM roles) when keys are not supplied.
|
|
21
24
|
- A POSIX-compatible shell such as Bash or Zsh for the terminal commands below.
|
|
22
25
|
Windows users can use Windows Subsystem for Linux or adapt the commands for
|
|
23
26
|
PowerShell.
|
|
@@ -124,8 +127,8 @@ uv sync
|
|
|
124
127
|
# With CLI
|
|
125
128
|
uv sync --extra cli
|
|
126
129
|
|
|
127
|
-
# With
|
|
128
|
-
uv sync --extra
|
|
130
|
+
# With FTP backend support (SSH/SFTP is built in — no extra needed)
|
|
131
|
+
uv sync --extra ftp
|
|
129
132
|
|
|
130
133
|
# With OS keyring-backed credential cache
|
|
131
134
|
uv sync --extra credstore
|
|
@@ -285,63 +288,66 @@ uv run --extra bench python scripts/bench.py --backend art --rounds 3 --concurre
|
|
|
285
288
|
|
|
286
289
|
| Operation | asanypath | s3fs | aiobotocore | cloudpathlib |
|
|
287
290
|
|-----------|-----------|------|-------------|--------------|
|
|
288
|
-
| write | 8.
|
|
289
|
-
| read |
|
|
290
|
-
| exists | 3.
|
|
291
|
-
| iterdir |
|
|
291
|
+
| write | **8.80 ms** | 12.67 ms | 28.07 ms | 41.75 ms |
|
|
292
|
+
| read | **3.78 ms** | 9.10 ms | 23.15 ms | 12.83 ms |
|
|
293
|
+
| exists | **3.57 ms** | 4.25 ms | 21.92 ms | 4.02 ms |
|
|
294
|
+
| iterdir | 40.55 ms | 39.16 ms | 56.49 ms | **39.07 ms** |
|
|
292
295
|
|
|
293
296
|
### Azure — Azurite emulator (median of 20 rounds, 10 objects, c=1)
|
|
294
297
|
|
|
295
298
|
| Operation | asanypath | azure-sdk | adlfs | cloudpathlib |
|
|
296
299
|
|-----------|-----------|-----------|-------|--------------|
|
|
297
|
-
| write | 1.
|
|
298
|
-
| read | 0.
|
|
299
|
-
| exists | 0.
|
|
300
|
-
| iterdir |
|
|
300
|
+
| write | **1.24 ms** | 1.79 ms | 2.34 ms | 7.88 ms |
|
|
301
|
+
| read | **0.51 ms** | 1.15 ms | 2.44 ms | 3.19 ms |
|
|
302
|
+
| exists | **0.35 ms** | 0.95 ms | 0.98 ms | 1.04 ms |
|
|
303
|
+
| iterdir | **0.88 ms** | 2.40 ms | 4.11 ms | 2.72 ms |
|
|
301
304
|
|
|
302
305
|
### GCS — fake-gcs-server emulator (median of 20 rounds, 10 objects, c=1)
|
|
303
306
|
|
|
304
307
|
| Operation | asanypath | gcloud-aio | cloudpathlib | gcsfs |
|
|
305
308
|
|-----------|-----------|------------|--------------|-------|
|
|
306
|
-
| write | 0.
|
|
307
|
-
| read | 0.
|
|
308
|
-
| exists | 0.
|
|
309
|
-
| iterdir | 0.
|
|
309
|
+
| write | **0.45 ms** | 0.51 ms | 3.53 ms | 0.58 ms |
|
|
310
|
+
| read | 0.22 ms | **0.18 ms** | 1.48 ms | 0.30 ms |
|
|
311
|
+
| exists | **0.15 ms** | 0.18 ms | 0.50 ms | 0.46 ms |
|
|
312
|
+
| iterdir | **0.19 ms** | 0.25 ms | 0.69 ms | 0.33 ms |
|
|
310
313
|
|
|
311
314
|
### Artifactory — live server (median of 20 rounds, 10 objects, c=1)
|
|
312
315
|
|
|
313
316
|
| Operation | asanypath | aiohttp | requests |
|
|
314
317
|
|-----------|-----------|---------|----------|
|
|
315
|
-
| write |
|
|
316
|
-
| read |
|
|
317
|
-
| exists | 2.
|
|
318
|
-
| iterdir |
|
|
318
|
+
| write | **54.49 ms** | 54.75 ms | 57.57 ms |
|
|
319
|
+
| read | **2.83 ms** | 3.09 ms | 12.01 ms |
|
|
320
|
+
| exists | 2.33 ms | **2.18 ms** | 4.61 ms |
|
|
321
|
+
| iterdir | **2.85 ms** | 3.07 ms | 7.88 ms |
|
|
319
322
|
|
|
320
323
|
### SSH / SFTP — localhost emulator (median of 20 rounds, 10 objects, c=1)
|
|
321
324
|
|
|
325
|
+
asanypath uses a built-in native russh SFTP transport (off-GIL); `asyncssh` is
|
|
326
|
+
shown only as a benchmark baseline.
|
|
327
|
+
|
|
322
328
|
| Operation | asanypath | asyncssh |
|
|
323
329
|
|-----------|-----------|----------|
|
|
324
|
-
| write | 0.
|
|
325
|
-
| read | 0.
|
|
326
|
-
| exists | 0.
|
|
327
|
-
| iterdir | 0.
|
|
330
|
+
| write | **0.16 ms** | 0.33 ms |
|
|
331
|
+
| read | **0.21 ms** | 0.36 ms |
|
|
332
|
+
| exists | **0.07 ms** | 0.11 ms |
|
|
333
|
+
| iterdir | **0.23 ms** | 0.44 ms |
|
|
328
334
|
|
|
329
335
|
### FTP — localhost emulator (median of 20 rounds, 10 objects, c=1)
|
|
330
336
|
|
|
331
337
|
| Operation | asanypath | aioftp |
|
|
332
338
|
|-----------|-----------|--------|
|
|
333
|
-
| write | 0.
|
|
334
|
-
| read | 0.
|
|
335
|
-
| exists | 1.
|
|
336
|
-
| iterdir | 1.
|
|
339
|
+
| write | **0.35 ms** | 0.41 ms |
|
|
340
|
+
| read | **0.35 ms** | 0.40 ms |
|
|
341
|
+
| exists | **1.00 ms** | 1.13 ms |
|
|
342
|
+
| iterdir | 1.09 ms | **1.04 ms** |
|
|
337
343
|
|
|
338
344
|
Latencies are per-operation medians over 20 rounds. S3 and Artifactory ran
|
|
339
345
|
against live services; Azure, GCS, SSH/SFTP, and FTP against local emulators
|
|
340
346
|
(Azurite, fake-gcs-server, and localhost sftp/ftp), so those figures reflect
|
|
341
|
-
client-library overhead, not WAN latency.
|
|
342
|
-
|
|
343
|
-
dedicated client libraries on most
|
|
344
|
-
API across all backends.
|
|
347
|
+
client-library overhead, not WAN latency. The SSH/SFTP transport is a built-in
|
|
348
|
+
native russh backend that runs SFTP off-GIL and beats asyncssh on every
|
|
349
|
+
operation. asanypath matches or beats dedicated client libraries on most
|
|
350
|
+
operations while providing a single unified API across all backends.
|
|
345
351
|
|
|
346
352
|
## How It Works
|
|
347
353
|
|
|
@@ -355,9 +361,17 @@ API across all backends.
|
|
|
355
361
|
| `az://`, `azure://` | `AzurePath` | reqwest + SharedKey |
|
|
356
362
|
| `art://` | `ArtifactoryPath` | reqwest + Bearer |
|
|
357
363
|
| `http://`, `https://` | `HTTPPath` / `HTTPSPath` | reqwest |
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
364
|
+
| `ssh://` | `SSHPath` | native russh (SFTP) |
|
|
365
|
+
| `ftp://` | `FTPPath` | `aioftp` |
|
|
366
|
+
| `ftps://` | `FTPSPath` | `aioftp` + TLS |
|
|
367
|
+
| any other scheme | `UnsupportedProtocolPath` | none — pure-path only |
|
|
368
|
+
|
|
369
|
+
Cloud and HTTP network I/O is handled by `asanypath-native` (Rust/PyO3 + reqwest)
|
|
370
|
+
with jittered exponential backoff retry for transient errors. SSH/SFTP uses a
|
|
371
|
+
built-in off-GIL native russh transport (no Python SSH dependency); FTP/FTPS use
|
|
372
|
+
`aioftp`. Unknown schemes construct an `UnsupportedProtocolPath`: pure-path
|
|
373
|
+
operations (`.name`, `.parent`, joins) work, while any backend operation raises
|
|
374
|
+
`UnsupportedProtocolError`.
|
|
361
375
|
|
|
362
376
|
## API Reference
|
|
363
377
|
|
|
@@ -57,9 +57,9 @@ dev = [
|
|
|
57
57
|
]
|
|
58
58
|
cli = ["rich-click>=1.9.7"]
|
|
59
59
|
ftp = ["aioftp>=0.21"]
|
|
60
|
-
ssh = ["asyncssh>=2.14"]
|
|
61
60
|
credstore = ["keyring>=24"]
|
|
62
61
|
bench = [
|
|
62
|
+
"asyncssh>=2.14",
|
|
63
63
|
"fsspec",
|
|
64
64
|
"s3fs",
|
|
65
65
|
"adlfs",
|
|
@@ -71,7 +71,7 @@ bench = [
|
|
|
71
71
|
"aiofiles",
|
|
72
72
|
"requests",
|
|
73
73
|
]
|
|
74
|
-
all = ["asanypath[
|
|
74
|
+
all = ["asanypath[credstore,ftp]"]
|
|
75
75
|
[project.scripts]
|
|
76
76
|
asanypath = "asanypath.cli:main"
|
|
77
77
|
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '2.
|
|
22
|
-
__version_tuple__ = version_tuple = (2,
|
|
21
|
+
__version__ = version = '2.1.0'
|
|
22
|
+
__version_tuple__ = version_tuple = (2, 1, 0)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -170,6 +170,18 @@ class ArtifactoryPath(CloudPathMixin):
|
|
|
170
170
|
def _item_path(self) -> str:
|
|
171
171
|
return self._repo_path
|
|
172
172
|
|
|
173
|
+
def _bind_path_attrs(self) -> None:
|
|
174
|
+
raw = str(self)[len("art://") :]
|
|
175
|
+
idx = raw.find("/artifactory/")
|
|
176
|
+
if idx >= 0:
|
|
177
|
+
self._base_url = raw[: idx + len("/artifactory")]
|
|
178
|
+
self._repo_path = raw[idx + len("/artifactory/") :]
|
|
179
|
+
else:
|
|
180
|
+
self._base_url = raw.split("/")[0]
|
|
181
|
+
self._repo_path = "/".join(raw.split("/")[1:])
|
|
182
|
+
self._is_folder = None
|
|
183
|
+
self._cached_info = None
|
|
184
|
+
|
|
173
185
|
@property
|
|
174
186
|
def _native_kwargs(self) -> dict:
|
|
175
187
|
return {
|
|
@@ -234,9 +246,7 @@ class ArtifactoryPath(CloudPathMixin):
|
|
|
234
246
|
containers = await self._list_containers()
|
|
235
247
|
if containers is not None:
|
|
236
248
|
for uri in containers:
|
|
237
|
-
|
|
238
|
-
child._token = self._token
|
|
239
|
-
yield child
|
|
249
|
+
yield self._child(uri)
|
|
240
250
|
return
|
|
241
251
|
batcher = self._get_batcher()
|
|
242
252
|
results = await batcher.list(
|
|
@@ -247,10 +257,7 @@ class ArtifactoryPath(CloudPathMixin):
|
|
|
247
257
|
base = str(self).rstrip("/")
|
|
248
258
|
for uri, is_folder in results:
|
|
249
259
|
child_name = uri.rsplit("/", 1)[-1]
|
|
250
|
-
|
|
251
|
-
child_path._token = self._token
|
|
252
|
-
child_path._is_folder = is_folder
|
|
253
|
-
yield child_path
|
|
260
|
+
yield self._child(f"{base}/{child_name}", _is_folder=is_folder)
|
|
254
261
|
|
|
255
262
|
async def _list_containers(self) -> list[str] | None:
|
|
256
263
|
"""List repositories when at the server root (``art://<host>/artifactory/``).
|
|
@@ -162,6 +162,10 @@ class AzurePath(CloudPathMixin):
|
|
|
162
162
|
def _item_path(self) -> str:
|
|
163
163
|
return self._blob_path
|
|
164
164
|
|
|
165
|
+
def _bind_path_attrs(self) -> None:
|
|
166
|
+
self._container = self._path.host or ""
|
|
167
|
+
self._blob_path = self._path.path.lstrip("/")
|
|
168
|
+
|
|
165
169
|
@property
|
|
166
170
|
def _native_kwargs(self) -> dict:
|
|
167
171
|
return {
|
|
@@ -504,7 +504,7 @@ def _maybe_rewrite_scp_style(value: str, check_config: bool = True) -> str:
|
|
|
504
504
|
return value
|
|
505
505
|
if not _discover_ssh_config():
|
|
506
506
|
return value
|
|
507
|
-
resolved_host, _, _ = _resolve_alias(host, None, None)
|
|
507
|
+
resolved_host, _, _, _ = _resolve_alias(host, None, None)
|
|
508
508
|
if resolved_host == host:
|
|
509
509
|
# No Host block matched — leave alone (don't probe DNS).
|
|
510
510
|
return value
|