mstransfer 0.2.2__tar.gz → 0.3.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.
Files changed (92) hide show
  1. mstransfer-0.3.0/.gitattributes +5 -0
  2. mstransfer-0.3.0/.github/dependabot.yml +41 -0
  3. {mstransfer-0.2.2 → mstransfer-0.3.0}/.github/workflows/docker.yml +5 -5
  4. mstransfer-0.3.0/.github/workflows/docs.yml +60 -0
  5. mstransfer-0.3.0/.github/workflows/pr-title.yml +42 -0
  6. {mstransfer-0.2.2 → mstransfer-0.3.0}/.github/workflows/publish.yml +5 -5
  7. mstransfer-0.3.0/.github/workflows/release-please.yml +49 -0
  8. mstransfer-0.3.0/.github/workflows/test.yml +64 -0
  9. {mstransfer-0.2.2 → mstransfer-0.3.0}/.gitignore +3 -1
  10. {mstransfer-0.2.2 → mstransfer-0.3.0}/.pre-commit-config.yaml +11 -5
  11. mstransfer-0.3.0/.release-please-manifest.json +3 -0
  12. mstransfer-0.3.0/CHANGELOG.md +46 -0
  13. {mstransfer-0.2.2 → mstransfer-0.3.0}/PKG-INFO +47 -6
  14. {mstransfer-0.2.2 → mstransfer-0.3.0}/README.md +41 -2
  15. mstransfer-0.3.0/benchmark/.env.example +22 -0
  16. mstransfer-0.3.0/benchmark/.gitignore +11 -0
  17. mstransfer-0.3.0/benchmark/Dockerfile.thermorawfileparser +12 -0
  18. mstransfer-0.3.0/benchmark/Makefile +15 -0
  19. mstransfer-0.3.0/benchmark/README.md +71 -0
  20. mstransfer-0.3.0/benchmark/benchmark.sh +304 -0
  21. mstransfer-0.3.0/benchmark/datasets.txt +14 -0
  22. mstransfer-0.3.0/benchmark/download.sh +89 -0
  23. mstransfer-0.3.0/benchmark/plot.py +352 -0
  24. mstransfer-0.3.0/benchmark/pyproject.toml +13 -0
  25. mstransfer-0.3.0/benchmark/uv.lock +879 -0
  26. mstransfer-0.3.0/docs/cli/index.md +133 -0
  27. mstransfer-0.3.0/docs/contributing/index.md +57 -0
  28. mstransfer-0.3.0/docs/getting-started/index.md +19 -0
  29. mstransfer-0.3.0/docs/getting-started/installation.md +49 -0
  30. mstransfer-0.3.0/docs/getting-started/quickstart.md +54 -0
  31. mstransfer-0.3.0/docs/guides/downloading.md +133 -0
  32. mstransfer-0.3.0/docs/guides/index.md +20 -0
  33. mstransfer-0.3.0/docs/guides/progress.md +79 -0
  34. mstransfer-0.3.0/docs/guides/uploading.md +103 -0
  35. mstransfer-0.3.0/docs/index.md +67 -0
  36. mstransfer-0.3.0/docs/reference/client.md +17 -0
  37. mstransfer-0.3.0/docs/reference/index.md +12 -0
  38. mstransfer-0.3.0/docs/reference/models.md +3 -0
  39. mstransfer-0.3.0/docs/reference/server.md +21 -0
  40. mstransfer-0.3.0/docs/reference/store.md +7 -0
  41. mstransfer-0.3.0/docs/server/auth.md +61 -0
  42. mstransfer-0.3.0/docs/server/deployment.md +31 -0
  43. mstransfer-0.3.0/docs/server/embedding.md +64 -0
  44. mstransfer-0.3.0/docs/server/file-providers.md +54 -0
  45. mstransfer-0.3.0/docs/server/http-api.md +112 -0
  46. mstransfer-0.3.0/docs/server/index.md +31 -0
  47. mstransfer-0.3.0/docs/stylesheets/extra.css +14 -0
  48. mstransfer-0.3.0/mkdocs.yml +158 -0
  49. {mstransfer-0.2.2 → mstransfer-0.3.0}/pyproject.toml +29 -6
  50. mstransfer-0.3.0/release-please-config.json +31 -0
  51. {mstransfer-0.2.2 → mstransfer-0.3.0}/src/mstransfer/__init__.py +1 -1
  52. {mstransfer-0.2.2 → mstransfer-0.3.0}/src/mstransfer/cli.py +147 -39
  53. mstransfer-0.3.0/src/mstransfer/client/__init__.py +31 -0
  54. mstransfer-0.3.0/src/mstransfer/client/downloader.py +545 -0
  55. mstransfer-0.3.0/src/mstransfer/client/results.py +26 -0
  56. mstransfer-0.3.0/src/mstransfer/client/sender.py +338 -0
  57. mstransfer-0.3.0/src/mstransfer/client/utils.py +161 -0
  58. {mstransfer-0.2.2 → mstransfer-0.3.0}/src/mstransfer/server/auth.py +10 -5
  59. {mstransfer-0.2.2 → mstransfer-0.3.0}/src/mstransfer/server/fileprovider.py +8 -13
  60. {mstransfer-0.2.2 → mstransfer-0.3.0}/src/mstransfer/server/models.py +15 -4
  61. mstransfer-0.3.0/src/mstransfer/server/routes.py +279 -0
  62. mstransfer-0.3.0/src/mstransfer/server/state.py +112 -0
  63. mstransfer-0.3.0/src/mstransfer/store.py +372 -0
  64. mstransfer-0.3.0/tests/__init__.py +0 -0
  65. {mstransfer-0.2.2 → mstransfer-0.3.0}/tests/conftest.py +9 -0
  66. {mstransfer-0.2.2 → mstransfer-0.3.0}/tests/test_auth.py +39 -0
  67. {mstransfer-0.2.2 → mstransfer-0.3.0}/tests/test_cli.py +493 -29
  68. mstransfer-0.3.0/tests/test_client.py +912 -0
  69. mstransfer-0.3.0/tests/test_downloader.py +2029 -0
  70. {mstransfer-0.2.2 → mstransfer-0.3.0}/tests/test_server.py +405 -19
  71. mstransfer-0.3.0/tests/test_store.py +445 -0
  72. {mstransfer-0.2.2 → mstransfer-0.3.0}/uv.lock +1184 -642
  73. mstransfer-0.2.2/.github/dependabot.yml +0 -8
  74. mstransfer-0.2.2/.github/workflows/test.yml +0 -42
  75. mstransfer-0.2.2/src/mstransfer/client/__init__.py +0 -10
  76. mstransfer-0.2.2/src/mstransfer/client/downloader.py +0 -287
  77. mstransfer-0.2.2/src/mstransfer/client/sender.py +0 -309
  78. mstransfer-0.2.2/src/mstransfer/server/routes.py +0 -276
  79. mstransfer-0.2.2/src/mstransfer/server/state.py +0 -78
  80. mstransfer-0.2.2/tests/test_client.py +0 -521
  81. mstransfer-0.2.2/tests/test_downloader.py +0 -503
  82. {mstransfer-0.2.2 → mstransfer-0.3.0}/.python-version +0 -0
  83. {mstransfer-0.2.2 → mstransfer-0.3.0}/.vscode/settings.json +0 -0
  84. {mstransfer-0.2.2 → mstransfer-0.3.0}/Dockerfile +0 -0
  85. {mstransfer-0.2.2 → mstransfer-0.3.0}/src/mstransfer/__main__.py +0 -0
  86. {mstransfer-0.2.2 → mstransfer-0.3.0}/src/mstransfer/log.py +0 -0
  87. /mstransfer-0.2.2/src/mstransfer/server/__init__.py → /mstransfer-0.3.0/src/mstransfer/py.typed +0 -0
  88. {mstransfer-0.2.2/tests → mstransfer-0.3.0/src/mstransfer/server}/__init__.py +0 -0
  89. {mstransfer-0.2.2 → mstransfer-0.3.0}/src/mstransfer/server/app.py +0 -0
  90. {mstransfer-0.2.2 → mstransfer-0.3.0}/tests/data/test.msz +0 -0
  91. {mstransfer-0.2.2 → mstransfer-0.3.0}/tests/data/test.mzML +0 -0
  92. {mstransfer-0.2.2 → mstransfer-0.3.0}/tests/test_include_router.py +0 -0
@@ -0,0 +1,5 @@
1
+ # Test fixtures must stay byte-identical on every platform; a CRLF checkout
2
+ # on Windows changes the mzML's size and breaks round-trip comparisons.
3
+ *.mzML -text
4
+ *.msz binary
5
+ *.mszx binary
@@ -0,0 +1,41 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: "uv"
5
+ directory: "/"
6
+ target-branch: "dev"
7
+ schedule:
8
+ interval: "daily"
9
+ open-pull-requests-limit: 5
10
+ commit-message:
11
+ prefix: "deps"
12
+ prefix-development: "chore(deps)"
13
+ groups:
14
+ # Groups match first-wins, so mscompress must stay ahead of the catch-alls
15
+ mscompress:
16
+ patterns: ["mscompress"]
17
+ dev-dependencies:
18
+ dependency-type: "development"
19
+ update-types: ["minor", "patch"]
20
+ production-dependencies:
21
+ dependency-type: "production"
22
+ update-types: ["minor", "patch"]
23
+
24
+ - package-ecosystem: "github-actions"
25
+ directory: "/"
26
+ target-branch: "dev"
27
+ schedule:
28
+ interval: "weekly"
29
+ commit-message:
30
+ prefix: "ci"
31
+ groups:
32
+ github-actions:
33
+ patterns: ["*"]
34
+
35
+ - package-ecosystem: "docker"
36
+ directory: "/"
37
+ target-branch: "dev"
38
+ schedule:
39
+ interval: "weekly"
40
+ commit-message:
41
+ prefix: "build(docker)"
@@ -8,26 +8,26 @@ jobs:
8
8
  build-and-push:
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
- - uses: actions/checkout@v4
11
+ - uses: actions/checkout@v7
12
12
 
13
13
  - name: Extract version from tag
14
14
  id: version
15
15
  run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
16
16
 
17
17
  - name: Set up QEMU
18
- uses: docker/setup-qemu-action@v3
18
+ uses: docker/setup-qemu-action@v4
19
19
 
20
20
  - name: Set up Docker Buildx
21
- uses: docker/setup-buildx-action@v3
21
+ uses: docker/setup-buildx-action@v4
22
22
 
23
23
  - name: Log in to Docker Hub
24
- uses: docker/login-action@v3
24
+ uses: docker/login-action@v4
25
25
  with:
26
26
  username: ${{ secrets.DOCKERHUB_USERNAME }}
27
27
  password: ${{ secrets.DOCKERHUB_TOKEN }}
28
28
 
29
29
  - name: Build and push
30
- uses: docker/build-push-action@v6
30
+ uses: docker/build-push-action@v7
31
31
  with:
32
32
  context: .
33
33
  push: true
@@ -0,0 +1,60 @@
1
+ name: docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths:
7
+ - 'docs/**'
8
+ - 'mkdocs.yml'
9
+ - 'pyproject.toml'
10
+ - 'uv.lock'
11
+ - 'src/mstransfer/**'
12
+ - '.github/workflows/docs.yml'
13
+ # Validate the site builds on every PR into dev (build only, no deploy).
14
+ # Not path-filtered so docs: PRs, which skip build.yml, always get a check.
15
+ pull_request:
16
+ branches: [dev]
17
+ workflow_dispatch:
18
+
19
+ permissions:
20
+ contents: read
21
+
22
+ # Allow one concurrent deployment, cancelling in-progress runs.
23
+ # PR builds are grouped per-PR so they never cancel a Pages deployment.
24
+ concurrency:
25
+ group: ${{ github.event_name == 'pull_request' && format('docs-pr-{0}', github.event.pull_request.number) || 'pages' }}
26
+ cancel-in-progress: true
27
+
28
+ jobs:
29
+ build:
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - uses: actions/checkout@v7
33
+
34
+ - name: Install uv
35
+ uses: astral-sh/setup-uv@v7
36
+
37
+ - name: Set up Python
38
+ run: uv python install 3.12
39
+
40
+ - name: Build site
41
+ run: uv run --only-group docs zensical build --strict
42
+
43
+ - uses: actions/upload-pages-artifact@v5
44
+ if: github.event_name != 'pull_request'
45
+ with:
46
+ path: site
47
+
48
+ deploy:
49
+ needs: build
50
+ if: github.event_name != 'pull_request'
51
+ runs-on: ubuntu-latest
52
+ permissions:
53
+ pages: write
54
+ id-token: write
55
+ environment:
56
+ name: github-pages
57
+ url: ${{ steps.deployment.outputs.page_url }}
58
+ steps:
59
+ - id: deployment
60
+ uses: actions/deploy-pages@v5
@@ -0,0 +1,42 @@
1
+ name: PR Title
2
+
3
+ # PRs into dev are squash-merged using the PR title as the commit message,
4
+ # which release-please parses for version bumps and CHANGELOG entries.
5
+ # Enforce Conventional Commits so every PR produces a parseable commit.
6
+ on:
7
+ pull_request:
8
+ branches:
9
+ - dev
10
+ types:
11
+ - opened
12
+ - edited
13
+ - synchronize
14
+ - reopened
15
+
16
+ permissions:
17
+ pull-requests: read
18
+
19
+ jobs:
20
+ lint:
21
+ name: Conventional PR title
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: amannn/action-semantic-pull-request@v6
25
+ env:
26
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27
+ with:
28
+ # Keep in sync with changelog-sections in release-please-config.json
29
+ types: |
30
+ feat
31
+ fix
32
+ perf
33
+ refactor
34
+ deps
35
+ revert
36
+ docs
37
+ test
38
+ ci
39
+ build
40
+ style
41
+ chore
42
+ requireScope: false
@@ -11,19 +11,19 @@ jobs:
11
11
  build:
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: actions/checkout@v4
14
+ - uses: actions/checkout@v7
15
15
 
16
16
  - name: Install uv
17
- uses: astral-sh/setup-uv@v5
17
+ uses: astral-sh/setup-uv@v7
18
18
 
19
19
  - name: Set up Python
20
- run: uv python install 3.10
20
+ run: uv python install 3.11
21
21
 
22
22
  - name: Build package
23
23
  run: uv build
24
24
 
25
25
  - name: Upload build artifacts
26
- uses: actions/upload-artifact@v4
26
+ uses: actions/upload-artifact@v7
27
27
  with:
28
28
  name: dist
29
29
  path: dist/
@@ -36,7 +36,7 @@ jobs:
36
36
  id-token: write
37
37
  steps:
38
38
  - name: Download build artifacts
39
- uses: actions/download-artifact@v4
39
+ uses: actions/download-artifact@v8
40
40
  with:
41
41
  name: dist
42
42
  path: dist/
@@ -0,0 +1,49 @@
1
+ name: Release Please
2
+
3
+ # Two-phase release flow (dev -> stage -> main):
4
+ # push to dev: open/update the release PR (targets dev). Never tags.
5
+ # push to main: tag + GitHub Release for any merged release PR that has
6
+ # been promoted to main. The published release triggers
7
+ # publish.yml (PyPI) and docker.yml (Docker Hub).
8
+ on:
9
+ push:
10
+ branches:
11
+ - dev
12
+ - main
13
+ workflow_dispatch:
14
+
15
+ permissions:
16
+ contents: write
17
+ pull-requests: write
18
+
19
+ jobs:
20
+ release-please:
21
+ name: Release Please
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ # Use a GitHub App token, not GITHUB_TOKEN, for two reasons:
25
+ # 1. Releases created with GITHUB_TOKEN do not trigger other workflows,
26
+ # so publish.yml and docker.yml (on: release: published) would never run.
27
+ # 2. The release is tagged at the release commit on dev, and if a workflow
28
+ # change has been promoted to main since then, that commit's
29
+ # .github/workflows/ differs from the default branch. Creating a
30
+ # release there requires the Workflows permission, which GITHUB_TOKEN
31
+ # can never have (fails with 403 "Resource not accessible by integration").
32
+ - uses: actions/create-github-app-token@v3
33
+ id: app-token
34
+ with:
35
+ client-id: ${{ vars.RELEASE_APP_CLIENT_ID }}
36
+ private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
37
+ permission-contents: write
38
+ permission-pull-requests: write
39
+ permission-workflows: write
40
+ - uses: googleapis/release-please-action@v5
41
+ id: release
42
+ with:
43
+ token: ${{ steps.app-token.outputs.token }}
44
+ # Release PRs always live on dev, so both phases look at dev's PRs.
45
+ target-branch: dev
46
+ # Only tag/release from main (once the release PR has been promoted).
47
+ skip-github-release: ${{ github.ref_name != 'main' }}
48
+ # Only open/update the release PR from dev.
49
+ skip-github-pull-request: ${{ github.ref_name != 'dev' }}
@@ -0,0 +1,64 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [dev, stage, main]
6
+ pull_request:
7
+ branches: [dev, stage, main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, windows-latest]
16
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
17
+ env:
18
+ # Override .python-version so uv uses the matrix version.
19
+ UV_PYTHON: ${{ matrix.python-version }}
20
+ defaults:
21
+ run:
22
+ # Use bash on Windows too so globs like dist/*.whl expand.
23
+ shell: bash
24
+
25
+ steps:
26
+ - uses: actions/checkout@v7
27
+
28
+ - name: Install uv
29
+ uses: astral-sh/setup-uv@v7
30
+
31
+ - name: Set up Python ${{ matrix.python-version }}
32
+ run: uv python install ${{ matrix.python-version }}
33
+
34
+ - name: Install dependencies
35
+ run: uv sync --dev
36
+
37
+ - name: Lint
38
+ if: runner.os == 'Linux'
39
+ run: uv run ruff check .
40
+
41
+ - name: Format check
42
+ if: runner.os == 'Linux'
43
+ run: uv run ruff format --check .
44
+
45
+ - name: Type check (mypy)
46
+ run: uv run mypy src/
47
+
48
+ - name: Verify py.typed (PEP 561)
49
+ run: |
50
+ uv build
51
+ uv pip install dist/*.whl
52
+ echo 'import mstransfer' > "$RUNNER_TEMP/check_typed.py"
53
+ uv run mypy --strict "$RUNNER_TEMP/check_typed.py"
54
+
55
+ - name: Run tests with coverage
56
+ run: uv run pytest --cov=mstransfer --cov-report=term-missing --cov-report=xml
57
+
58
+ - name: Upload coverage to Codecov
59
+ if: matrix.python-version == '3.11'
60
+ uses: codecov/codecov-action@v7
61
+ with:
62
+ token: ${{ secrets.CODECOV_TOKEN }}
63
+ files: coverage.xml
64
+ flags: ${{ runner.os }}
@@ -18,4 +18,6 @@ received/
18
18
 
19
19
  # OS generated files
20
20
  .DS_Store
21
- Thumbs.db
21
+ Thumbs.db
22
+ # Docs build output
23
+ site/
@@ -1,12 +1,18 @@
1
+ exclude: ^benchmark/
1
2
  repos:
2
- - repo: https://github.com/astral-sh/ruff-pre-commit
3
- rev: v0.9.1
3
+ - repo: local
4
4
  hooks:
5
5
  - id: ruff
6
- args: [--fix]
6
+ name: ruff
7
+ entry: uv run ruff check --fix
8
+ language: system
9
+ types_or: [python, pyi]
7
10
  - id: ruff-format
8
- - repo: local
9
- hooks:
11
+ name: ruff format
12
+ entry: uv run ruff format --check .
13
+ language: system
14
+ types_or: [python, pyi, markdown]
15
+ pass_filenames: false
10
16
  - id: pyright
11
17
  name: pyright
12
18
  entry: uv run pyright
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.3.0"
3
+ }
@@ -0,0 +1,46 @@
1
+ # Changelog
2
+
3
+ ## [0.3.0](https://github.com/chrisagrams/mstransfer/compare/v0.2.3...v0.3.0) (2026-11-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * **cli:** add --version/-V flag ([#93](https://github.com/chrisagrams/mstransfer/issues/93)) ([0fca3f7](https://github.com/chrisagrams/mstransfer/commit/0fca3f7736b7fd3fedabb2af16a8b0907b32ee77))
9
+ * **client:** store multi-member batch .mszx archives as msz or mzML ([#58](https://github.com/chrisagrams/mstransfer/issues/58)) ([20938cd](https://github.com/chrisagrams/mstransfer/commit/20938cd6aba11efc6ae530a3b0809e32181f3774))
10
+ * resume interrupted downloads ([#95](https://github.com/chrisagrams/mstransfer/issues/95)) ([f79d236](https://github.com/chrisagrams/mstransfer/commit/f79d23659c1d52033e61b6cd18e62ac0cbb5059e))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **cli:** add --api-key to download, read it from MS_API_KEY ([#84](https://github.com/chrisagrams/mstransfer/issues/84)) ([38e5045](https://github.com/chrisagrams/mstransfer/commit/38e504512b7af63dd1b68cd926fcad69ba555b3b))
16
+ * **client:** isolate and clean download part files ([#91](https://github.com/chrisagrams/mstransfer/issues/91)) ([85180ed](https://github.com/chrisagrams/mstransfer/commit/85180ed01a5ae238a97b9d82dd8d99c669232608))
17
+ * **client:** remove stale partials after a --no-resume download ([#109](https://github.com/chrisagrams/mstransfer/issues/109)) ([9baf06c](https://github.com/chrisagrams/mstransfer/commit/9baf06cef0cbdec5f1bde54e8464ae0ab77e5825))
18
+ * **client:** report a missing batch file as a per-file error ([#87](https://github.com/chrisagrams/mstransfer/issues/87)) ([b8ddedb](https://github.com/chrisagrams/mstransfer/commit/b8ddedbda843a40a6ec3691bd9f570b77caa1e19))
19
+ * **client:** return a result per request from download_batch ([#89](https://github.com/chrisagrams/mstransfer/issues/89)) ([eae38f2](https://github.com/chrisagrams/mstransfer/commit/eae38f2b72b4657931070acab6325bcb12bf81a0))
20
+ * **client:** take download size from the GET response, not a HEAD probe ([#73](https://github.com/chrisagrams/mstransfer/issues/73)) ([3bc4358](https://github.com/chrisagrams/mstransfer/commit/3bc4358a531ecb4b9347f43efa40cc3f06a4196f))
21
+ * **client:** take httpx.Timeout so explicit timeouts override client= ([#88](https://github.com/chrisagrams/mstransfer/issues/88)) ([a5f9c21](https://github.com/chrisagrams/mstransfer/commit/a5f9c21319c85ed431e07333fd0307c3a15aeff8))
22
+ * **cli:** exit 130 without a traceback on Ctrl-C ([#110](https://github.com/chrisagrams/mstransfer/issues/110)) ([0bcf4b8](https://github.com/chrisagrams/mstransfer/commit/0bcf4b8a39cd695d9bf1f1ab799b46a2a4f217ab))
23
+ * **cli:** exit non-zero when uploads or downloads fail ([#70](https://github.com/chrisagrams/mstransfer/issues/70)) ([1581382](https://github.com/chrisagrams/mstransfer/commit/1581382561b4630fa00bbfccada305c2827cf549))
24
+ * **cli:** let serve restart while the port is in TIME-WAIT ([#108](https://github.com/chrisagrams/mstransfer/issues/108)) ([cd4a0df](https://github.com/chrisagrams/mstransfer/commit/cd4a0df9533c8e59ebeea127d567a98ceb454664))
25
+ * **cli:** report skipped downloads as skipped, not downloaded ([#107](https://github.com/chrisagrams/mstransfer/issues/107)) ([14de13d](https://github.com/chrisagrams/mstransfer/commit/14de13dea24737ec1d02b744057915fd6ae8b7d9))
26
+ * **cli:** show the server's error detail when a transfer fails ([#106](https://github.com/chrisagrams/mstransfer/issues/106)) ([4fcd639](https://github.com/chrisagrams/mstransfer/commit/4fcd6394586d236ae0352134816e891be0efd903))
27
+ * remove download lock files with filelock 4 ([#104](https://github.com/chrisagrams/mstransfer/issues/104)) ([73f6253](https://github.com/chrisagrams/mstransfer/commit/73f6253d14db556a345fc0045f277e00ef1328e0))
28
+ * **server:** refuse uploads that would overwrite another file ([#72](https://github.com/chrisagrams/mstransfer/issues/72)) ([18fbf40](https://github.com/chrisagrams/mstransfer/commit/18fbf400f5f404bfbacd011e555bd7d6dac7bb1b))
29
+ * **server:** return 401, not 500, for non-ASCII API keys ([#85](https://github.com/chrisagrams/mstransfer/issues/85)) ([162da43](https://github.com/chrisagrams/mstransfer/commit/162da43e95178a8c59d72656a2e28ffcde7bdfa1))
30
+ * **server:** store uploaded .mszx archives as-is ([#69](https://github.com/chrisagrams/mstransfer/issues/69)) ([924e5c5](https://github.com/chrisagrams/mstransfer/commit/924e5c558126dd5bac4e4785d03569331bfe1df3))
31
+ * **store:** give the conversion temp file a hidden, unique name ([#74](https://github.com/chrisagrams/mstransfer/issues/74)) ([15f66c3](https://github.com/chrisagrams/mstransfer/commit/15f66c3ed961bfee128e0cbc490abe1822fca76f))
32
+ * support Windows and test it in CI ([#96](https://github.com/chrisagrams/mstransfer/issues/96)) ([784ef25](https://github.com/chrisagrams/mstransfer/commit/784ef253ad375c799b1c0cfe3566d7293cdb7bc3))
33
+
34
+
35
+ ### Code Refactoring
36
+
37
+ * **client:** extract store-as logic into StorePlan ([#59](https://github.com/chrisagrams/mstransfer/issues/59)) ([31f974d](https://github.com/chrisagrams/mstransfer/commit/31f974d7545ec952e22d6b41804a7ba05f98cbb6))
38
+
39
+
40
+ ### Dependencies
41
+
42
+ * bump mscompress from 1.0.13 to 1.2.0 in the mscompress group ([#44](https://github.com/chrisagrams/mstransfer/issues/44)) ([37853cb](https://github.com/chrisagrams/mstransfer/commit/37853cb61e872d46f323c38abeb9b4bbb8fbf213))
43
+ * bump pydantic from 2.14.1 to 2.14.2 in the production-dependencies group ([#76](https://github.com/chrisagrams/mstransfer/issues/76)) ([b1777ea](https://github.com/chrisagrams/mstransfer/commit/b1777ea0acbc4cbedee85a62e937ce10b51fe74a))
44
+ * bump rich from 14.3.3 to 15.0.0 ([#48](https://github.com/chrisagrams/mstransfer/issues/48)) ([643e842](https://github.com/chrisagrams/mstransfer/commit/643e8422660921db2f355a3483dd531d81d348bb))
45
+ * bump the production-dependencies group across 1 directory with 5 updates ([#120](https://github.com/chrisagrams/mstransfer/issues/120)) ([8a9a582](https://github.com/chrisagrams/mstransfer/commit/8a9a582a4d6eb574bbd168fb548b1c347ecb20d8))
46
+ * bump the production-dependencies group with 3 updates ([#46](https://github.com/chrisagrams/mstransfer/issues/46)) ([f89547c](https://github.com/chrisagrams/mstransfer/commit/f89547cfa579ec8a6cb74c522140ce23bf3e755c))
@@ -1,15 +1,17 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: mstransfer
3
- Version: 0.2.2
3
+ Version: 0.3.0
4
4
  Summary: Transfer mass spectrometry files (mzML/MSZ) between endpoints using mscompress
5
- Requires-Python: >=3.10
5
+ Requires-Python: >=3.11.5
6
6
  Requires-Dist: aiofiles
7
7
  Requires-Dist: fastapi
8
+ Requires-Dist: filelock>=4.2.7
8
9
  Requires-Dist: httpx
9
- Requires-Dist: mscompress>=1.0.13
10
+ Requires-Dist: mscompress>=1.2.2
10
11
  Requires-Dist: pydantic>=2.0
11
12
  Requires-Dist: python-multipart
12
13
  Requires-Dist: rich
14
+ Requires-Dist: starlette>=0.39
13
15
  Requires-Dist: uvicorn[standard]
14
16
  Description-Content-Type: text/markdown
15
17
 
@@ -20,6 +22,8 @@ Description-Content-Type: text/markdown
20
22
 
21
23
  Transfer mass spectrometry files (mzML / MSZ) between machines over HTTP. Files are always transported in compressed MSZ format using [mscompress](https://github.com/chrisagrams/mscompress) — mzML sources are compressed on-the-fly without temp files, and the receiving end can optionally decompress back to mzML.
22
24
 
25
+ **Documentation:** https://chrisagrams.github.io/mstransfer/
26
+
23
27
  ## Install
24
28
 
25
29
  ```bash
@@ -63,7 +67,7 @@ mstransfer serve [--host 0.0.0.0] [--port 1319] [--output-dir ./received] [--sto
63
67
  | `--host` | `0.0.0.0` | Bind address |
64
68
  | `--port` | `1319` | Listen port |
65
69
  | `--output-dir` | `./received` | Where received files are written |
66
- | `--store-as` | `msz` | Store as `msz` (compressed) or `mzml` (decompress on arrival) |
70
+ | `--store-as` | `msz` | Store as `msz` (compressed) or `mzml` (decompress on arrival). `.mszx` archives are always stored as-is. |
67
71
 
68
72
  ### `mstransfer upload`
69
73
 
@@ -83,6 +87,40 @@ Supported file types: `.mzML`, `.msz`, `.mszx`.
83
87
  - **mzML files** are compressed to MSZ on-the-fly via `compress_stream()` and streamed directly into the HTTP request — no temp files on the sender.
84
88
  - **MSZ / MSZX files** are streamed as-is.
85
89
 
90
+ The client sends the format in an `X-Source-Format` header (`mzML`, `msz` or `mszx`). The server stores `.mszx` uploads untouched as `<stem>.mszx`, whatever `--store-as` says.
91
+
92
+ The server names each stored file after the upload's stem, so `run1.mzML` and `run1.msz` both become `run1.msz`. It refuses an upload with **409 Conflict** if that output file already exists or another transfer is still writing it. The refused file counts as failed, and the CLI exits non-zero.
93
+
94
+ ### `mstransfer download`
95
+
96
+ Download files from a server by URL, e.g. `http://remote-host:1319/v1/files/run1.msz`.
97
+
98
+ ```
99
+ mstransfer download <urls...> [--output-dir ./downloads] [--parallel 4] [--store-as msz|mzml|mszx] [--skip-existing] [--force] [--no-resume]
100
+ ```
101
+
102
+ | Flag | Default | Description |
103
+ |------|---------|-------------|
104
+ | `--output-dir`, `-o` | `./downloads` | Where downloaded files are written |
105
+ | `--parallel`, `-p` | `4` | Number of concurrent downloads |
106
+ | `--store-as` | as-is | Convert each download to `msz`, `mzml` or (for `.mszx` only) `mszx` |
107
+ | `--skip-existing` | off | Skip files whose output already exists |
108
+ | `--force` | off | Download again even if the output exists, discarding any partial download |
109
+ | `--no-resume` | off | Start interrupted downloads over instead of resuming them |
110
+
111
+ If a download is interrupted (for example by a dropped connection or Ctrl-C), running the same command again picks up where it left off instead of starting over. If the file changed on the server in the meantime, or the server can't resume downloads, it starts from the beginning.
112
+
113
+ ### Authentication
114
+
115
+ `serve`, `upload` and `download` all take `--api-key`. On `serve` it makes the server require that key; on `upload` and `download` it is sent as `Authorization: Bearer <key>`. When `--api-key` is not given, each command reads the `MS_API_KEY` environment variable instead. If neither is set (or `MS_API_KEY` is empty), no key is used.
116
+
117
+ ```
118
+ export MS_API_KEY=secret
119
+ mstransfer serve # requires the key
120
+ mstransfer upload run1.mzML remote-host # sends the key
121
+ mstransfer download http://remote-host:1319/v1/files/run1.msz
122
+ ```
123
+
86
124
  ## Programmatic access
87
125
 
88
126
  You can use mstransfer as a library to send files from your own Python code:
@@ -139,6 +177,7 @@ app = create_app(output_dir="/data/ms", store_as="mzml")
139
177
 
140
178
  # Mount in an existing FastAPI app
141
179
  from fastapi import FastAPI
180
+
142
181
  main_app = FastAPI()
143
182
  main_app.mount("/transfer", create_app())
144
183
  ```
@@ -156,7 +195,9 @@ flowchart LR
156
195
  read --> upload
157
196
 
158
197
  subgraph Server
159
- upload --> mode{store-as?}
198
+ upload --> kind{source format?}
199
+ kind -- mszx --> keep["write .mszx as-is"]
200
+ kind -- mzML / msz --> mode{store-as?}
160
201
  mode -- msz --> write["write to disk"]
161
202
  mode -- mzml --> temp["write temp .msz"]
162
203
  temp --> decompress["decompress"]
@@ -5,6 +5,8 @@
5
5
 
6
6
  Transfer mass spectrometry files (mzML / MSZ) between machines over HTTP. Files are always transported in compressed MSZ format using [mscompress](https://github.com/chrisagrams/mscompress) — mzML sources are compressed on-the-fly without temp files, and the receiving end can optionally decompress back to mzML.
7
7
 
8
+ **Documentation:** https://chrisagrams.github.io/mstransfer/
9
+
8
10
  ## Install
9
11
 
10
12
  ```bash
@@ -48,7 +50,7 @@ mstransfer serve [--host 0.0.0.0] [--port 1319] [--output-dir ./received] [--sto
48
50
  | `--host` | `0.0.0.0` | Bind address |
49
51
  | `--port` | `1319` | Listen port |
50
52
  | `--output-dir` | `./received` | Where received files are written |
51
- | `--store-as` | `msz` | Store as `msz` (compressed) or `mzml` (decompress on arrival) |
53
+ | `--store-as` | `msz` | Store as `msz` (compressed) or `mzml` (decompress on arrival). `.mszx` archives are always stored as-is. |
52
54
 
53
55
  ### `mstransfer upload`
54
56
 
@@ -68,6 +70,40 @@ Supported file types: `.mzML`, `.msz`, `.mszx`.
68
70
  - **mzML files** are compressed to MSZ on-the-fly via `compress_stream()` and streamed directly into the HTTP request — no temp files on the sender.
69
71
  - **MSZ / MSZX files** are streamed as-is.
70
72
 
73
+ The client sends the format in an `X-Source-Format` header (`mzML`, `msz` or `mszx`). The server stores `.mszx` uploads untouched as `<stem>.mszx`, whatever `--store-as` says.
74
+
75
+ The server names each stored file after the upload's stem, so `run1.mzML` and `run1.msz` both become `run1.msz`. It refuses an upload with **409 Conflict** if that output file already exists or another transfer is still writing it. The refused file counts as failed, and the CLI exits non-zero.
76
+
77
+ ### `mstransfer download`
78
+
79
+ Download files from a server by URL, e.g. `http://remote-host:1319/v1/files/run1.msz`.
80
+
81
+ ```
82
+ mstransfer download <urls...> [--output-dir ./downloads] [--parallel 4] [--store-as msz|mzml|mszx] [--skip-existing] [--force] [--no-resume]
83
+ ```
84
+
85
+ | Flag | Default | Description |
86
+ |------|---------|-------------|
87
+ | `--output-dir`, `-o` | `./downloads` | Where downloaded files are written |
88
+ | `--parallel`, `-p` | `4` | Number of concurrent downloads |
89
+ | `--store-as` | as-is | Convert each download to `msz`, `mzml` or (for `.mszx` only) `mszx` |
90
+ | `--skip-existing` | off | Skip files whose output already exists |
91
+ | `--force` | off | Download again even if the output exists, discarding any partial download |
92
+ | `--no-resume` | off | Start interrupted downloads over instead of resuming them |
93
+
94
+ If a download is interrupted (for example by a dropped connection or Ctrl-C), running the same command again picks up where it left off instead of starting over. If the file changed on the server in the meantime, or the server can't resume downloads, it starts from the beginning.
95
+
96
+ ### Authentication
97
+
98
+ `serve`, `upload` and `download` all take `--api-key`. On `serve` it makes the server require that key; on `upload` and `download` it is sent as `Authorization: Bearer <key>`. When `--api-key` is not given, each command reads the `MS_API_KEY` environment variable instead. If neither is set (or `MS_API_KEY` is empty), no key is used.
99
+
100
+ ```
101
+ export MS_API_KEY=secret
102
+ mstransfer serve # requires the key
103
+ mstransfer upload run1.mzML remote-host # sends the key
104
+ mstransfer download http://remote-host:1319/v1/files/run1.msz
105
+ ```
106
+
71
107
  ## Programmatic access
72
108
 
73
109
  You can use mstransfer as a library to send files from your own Python code:
@@ -124,6 +160,7 @@ app = create_app(output_dir="/data/ms", store_as="mzml")
124
160
 
125
161
  # Mount in an existing FastAPI app
126
162
  from fastapi import FastAPI
163
+
127
164
  main_app = FastAPI()
128
165
  main_app.mount("/transfer", create_app())
129
166
  ```
@@ -141,7 +178,9 @@ flowchart LR
141
178
  read --> upload
142
179
 
143
180
  subgraph Server
144
- upload --> mode{store-as?}
181
+ upload --> kind{source format?}
182
+ kind -- mszx --> keep["write .mszx as-is"]
183
+ kind -- mzML / msz --> mode{store-as?}
145
184
  mode -- msz --> write["write to disk"]
146
185
  mode -- mzml --> temp["write temp .msz"]
147
186
  temp --> decompress["decompress"]
@@ -0,0 +1,22 @@
1
+ # --- Benchmark mode ---
2
+ # "per-file" = time each file individually, "batch" = time all files as one batch
3
+ BENCHMARK_MODE=per-file
4
+
5
+ # --- mstransfer ---
6
+ MSTRANSFER_HOST=http://localhost:1319
7
+ MS_API_KEY= # optional, leave blank if no auth
8
+
9
+ # --- SFTP ---
10
+ SFTP_HOST=example.com
11
+ SFTP_PORT=22
12
+ SFTP_USER=username
13
+ SFTP_KEY_PATH=~/.ssh/id_rsa # path to private key
14
+ SFTP_DEST_DIR=/upload # remote directory
15
+
16
+ # --- S3 ---
17
+ AWS_ACCESS_KEY_ID=
18
+ AWS_SECRET_ACCESS_KEY=
19
+ AWS_REGION=us-east-1
20
+ S3_ENDPOINT_URL= # custom endpoint for MinIO, etc. (e.g. http://localhost:9000)
21
+ S3_BUCKET=my-bucket
22
+ S3_PREFIX=benchmark/ # optional prefix/folder in bucket
@@ -0,0 +1,11 @@
1
+ # Downloaded datasets
2
+ data/
3
+
4
+ # Secrets
5
+ .env
6
+
7
+ # Benchmark results
8
+ results/
9
+
10
+ # Generated plots
11
+ plots/
@@ -0,0 +1,12 @@
1
+ FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/aspnet:8.0
2
+
3
+ RUN apt-get update \
4
+ && apt-get install -y --no-install-recommends wget unzip \
5
+ && wget -q https://github.com/CompOmics/ThermoRawFileParser/releases/download/v.2.0.0-dev/ThermoRawFileParser-v.2.0.0-dev-net8.zip -O /tmp/trfp.zip \
6
+ && unzip /tmp/trfp.zip -d /opt/ThermoRawFileParser \
7
+ && rm /tmp/trfp.zip \
8
+ && apt-get purge -y wget unzip \
9
+ && apt-get autoremove -y \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ ENTRYPOINT ["dotnet", "/opt/ThermoRawFileParser/ThermoRawFileParser.dll"]
@@ -0,0 +1,15 @@
1
+ .PHONY: all download benchmark plot
2
+
3
+ all: download benchmark plot
4
+
5
+ download:
6
+ ./download.sh
7
+
8
+ benchmark:
9
+ ./benchmark.sh -b 40
10
+ ./benchmark.sh -b 100
11
+ ./benchmark.sh -b 1000
12
+ ./benchmark.sh
13
+
14
+ plot:
15
+ uv run plot.py