archivefs 0.2.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 (137) hide show
  1. archivefs-0.2.0/.github/workflows/ci.yml +45 -0
  2. archivefs-0.2.0/.github/workflows/publish.yml +61 -0
  3. archivefs-0.2.0/.gitignore +18 -0
  4. archivefs-0.2.0/CHANGELOG.md +50 -0
  5. archivefs-0.2.0/LICENSE +202 -0
  6. archivefs-0.2.0/NOTICE +4 -0
  7. archivefs-0.2.0/PKG-INFO +226 -0
  8. archivefs-0.2.0/README.md +180 -0
  9. archivefs-0.2.0/RELEASING.md +65 -0
  10. archivefs-0.2.0/conda-recipe/meta.yaml +65 -0
  11. archivefs-0.2.0/docs/README.md +115 -0
  12. archivefs-0.2.0/docs/archive-capabilities.md +137 -0
  13. archivefs-0.2.0/docs/chiro-protocol.md +101 -0
  14. archivefs-0.2.0/docs/cli-cache.md +184 -0
  15. archivefs-0.2.0/docs/cli-check.md +134 -0
  16. archivefs-0.2.0/docs/cli-confirm.md +89 -0
  17. archivefs-0.2.0/docs/cli-dvc.md +139 -0
  18. archivefs-0.2.0/docs/cli-get.md +138 -0
  19. archivefs-0.2.0/docs/cli-info.md +94 -0
  20. archivefs-0.2.0/docs/cli-ls.md +190 -0
  21. archivefs-0.2.0/docs/cli-manifest.md +161 -0
  22. archivefs-0.2.0/docs/cli-ping.md +84 -0
  23. archivefs-0.2.0/docs/cli-stat.md +125 -0
  24. archivefs-0.2.0/docs/cli-update.md +78 -0
  25. archivefs-0.2.0/docs/cli-verify.md +139 -0
  26. archivefs-0.2.0/docs/cli-versions.md +69 -0
  27. archivefs-0.2.0/docs/concepts-and-versions.md +160 -0
  28. archivefs-0.2.0/docs/configuration.md +189 -0
  29. archivefs-0.2.0/docs/credentials.md +309 -0
  30. archivefs-0.2.0/docs/decisions.md +3004 -0
  31. archivefs-0.2.0/docs/design.md +383 -0
  32. archivefs-0.2.0/docs/evidence/bia-access-model-2026-08-17.md +123 -0
  33. archivefs-0.2.0/docs/evidence/ega-checksum-check-2026-08-17.log +26 -0
  34. archivefs-0.2.0/docs/evidence/zenodo-concurrency-vs-piece-2026-08-25.py +72 -0
  35. archivefs-0.2.0/docs/evidence/zenodo-connection-churn-2026-08-25.py +102 -0
  36. archivefs-0.2.0/docs/evidence/zenodo-key-slashes-2026-08-21.py +33 -0
  37. archivefs-0.2.0/docs/evidence/zenodo-piece-size-2026-08-25.md +183 -0
  38. archivefs-0.2.0/docs/evidence/zenodo-piece-size-2026-08-25.py +70 -0
  39. archivefs-0.2.0/docs/evidence/zenodo-plain-cold-objects-2026-08-26.log +10 -0
  40. archivefs-0.2.0/docs/evidence/zenodo-plain-cold-objects-2026-08-26.py +85 -0
  41. archivefs-0.2.0/docs/evidence/zenodo-plain-file-split-2026-08-26.log +23 -0
  42. archivefs-0.2.0/docs/evidence/zenodo-plain-file-split-2026-08-26.md +105 -0
  43. archivefs-0.2.0/docs/evidence/zenodo-plain-file-split-2026-08-26.py +102 -0
  44. archivefs-0.2.0/docs/evidence/zenodo-request-cost-2026-08-25.py +68 -0
  45. archivefs-0.2.0/docs/evidence/zenodo-split-before-after-2026-08-25.py +157 -0
  46. archivefs-0.2.0/docs/evidence/zenodo-split-cold-archives-2026-08-25.py +128 -0
  47. archivefs-0.2.0/docs/evidence/zenodo-zip-blocksize-2026-08-25.py +87 -0
  48. archivefs-0.2.0/docs/evidence/zenodo-zip-prevalence-2026-08-21.md +53 -0
  49. archivefs-0.2.0/docs/evidence/zenodo-zip-prevalence-2026-08-21.py +49 -0
  50. archivefs-0.2.0/docs/evidence/zenodo-zip-shape-2026-08-21.md +84 -0
  51. archivefs-0.2.0/docs/evidence/zenodo-zip-shape-2026-08-21.py +59 -0
  52. archivefs-0.2.0/docs/evidence/zip-member-md5-pull-probe-2026-08-21.md +68 -0
  53. archivefs-0.2.0/docs/evidence/zip-member-md5-pull-probe-2026-08-21.patch +16 -0
  54. archivefs-0.2.0/docs/ideas.md +609 -0
  55. archivefs-0.2.0/docs/importing-from-bia.md +397 -0
  56. archivefs-0.2.0/docs/plan.md +108 -0
  57. archivefs-0.2.0/docs/reviewer-access.md +272 -0
  58. archivefs-0.2.0/docs/using-with-dvc.md +551 -0
  59. archivefs-0.2.0/environment.yaml +37 -0
  60. archivefs-0.2.0/pyproject.toml +127 -0
  61. archivefs-0.2.0/scripts/ega_checksum_check.py +244 -0
  62. archivefs-0.2.0/setup.cfg +4 -0
  63. archivefs-0.2.0/src/archivefs/__init__.py +61 -0
  64. archivefs-0.2.0/src/archivefs/backends/__init__.py +0 -0
  65. archivefs-0.2.0/src/archivefs/backends/bia.py +868 -0
  66. archivefs-0.2.0/src/archivefs/backends/cbioportal.py +415 -0
  67. archivefs-0.2.0/src/archivefs/backends/chiro.py +257 -0
  68. archivefs-0.2.0/src/archivefs/backends/dbgap.py +134 -0
  69. archivefs-0.2.0/src/archivefs/backends/ega.py +594 -0
  70. archivefs-0.2.0/src/archivefs/backends/geo.py +408 -0
  71. archivefs-0.2.0/src/archivefs/backends/mendeley.py +430 -0
  72. archivefs-0.2.0/src/archivefs/backends/zenodo.py +1031 -0
  73. archivefs-0.2.0/src/archivefs/base.py +1395 -0
  74. archivefs-0.2.0/src/archivefs/blockcache.py +619 -0
  75. archivefs-0.2.0/src/archivefs/bundle.py +808 -0
  76. archivefs-0.2.0/src/archivefs/chiro.py +362 -0
  77. archivefs-0.2.0/src/archivefs/cli.py +1237 -0
  78. archivefs-0.2.0/src/archivefs/config.py +329 -0
  79. archivefs-0.2.0/src/archivefs/confirm.py +334 -0
  80. archivefs-0.2.0/src/archivefs/credentials.py +367 -0
  81. archivefs-0.2.0/src/archivefs/dvc_meta.py +140 -0
  82. archivefs-0.2.0/src/archivefs/dvcfs.py +451 -0
  83. archivefs-0.2.0/src/archivefs/dvcfs_hook.py +85 -0
  84. archivefs-0.2.0/src/archivefs/errors.py +225 -0
  85. archivefs-0.2.0/src/archivefs/from_dvc.py +233 -0
  86. archivefs-0.2.0/src/archivefs/ping.py +252 -0
  87. archivefs-0.2.0/src/archivefs/py.typed +0 -0
  88. archivefs-0.2.0/src/archivefs/registry.py +434 -0
  89. archivefs-0.2.0/src/archivefs/store.py +132 -0
  90. archivefs-0.2.0/src/archivefs/update.py +132 -0
  91. archivefs-0.2.0/src/archivefs/writer.py +214 -0
  92. archivefs-0.2.0/src/archivefs/zipsafe.py +276 -0
  93. archivefs-0.2.0/src/archivefs.egg-info/PKG-INFO +226 -0
  94. archivefs-0.2.0/src/archivefs.egg-info/SOURCES.txt +135 -0
  95. archivefs-0.2.0/src/archivefs.egg-info/dependency_links.txt +1 -0
  96. archivefs-0.2.0/src/archivefs.egg-info/entry_points.txt +12 -0
  97. archivefs-0.2.0/src/archivefs.egg-info/requires.txt +20 -0
  98. archivefs-0.2.0/src/archivefs.egg-info/scm_file_list.json +131 -0
  99. archivefs-0.2.0/src/archivefs.egg-info/scm_version.json +8 -0
  100. archivefs-0.2.0/src/archivefs.egg-info/top_level.txt +1 -0
  101. archivefs-0.2.0/tests/conftest.py +52 -0
  102. archivefs-0.2.0/tests/data/bia_S-BIAD599_files.json +175 -0
  103. archivefs-0.2.0/tests/data/bia_S-BIAD599_info.json +10 -0
  104. archivefs-0.2.0/tests/data/bia_s3_image_level.xml +1 -0
  105. archivefs-0.2.0/tests/data/bia_s3_study_level.xml +1 -0
  106. archivefs-0.2.0/tests/data/ega_EGAD00001009826_files.json +92 -0
  107. archivefs-0.2.0/tests/data/geo_GSE176078_filelist.txt +28 -0
  108. archivefs-0.2.0/tests/data/geo_GSE176078_index.html +14 -0
  109. archivefs-0.2.0/tests/data/zenodo_record_1486184.json +1 -0
  110. archivefs-0.2.0/tests/fake_http.py +191 -0
  111. archivefs-0.2.0/tests/test_bia.py +1302 -0
  112. archivefs-0.2.0/tests/test_blockcache.py +518 -0
  113. archivefs-0.2.0/tests/test_bundle.py +523 -0
  114. archivefs-0.2.0/tests/test_cbioportal.py +265 -0
  115. archivefs-0.2.0/tests/test_chiro.py +660 -0
  116. archivefs-0.2.0/tests/test_chiro_backend.py +176 -0
  117. archivefs-0.2.0/tests/test_cli.py +455 -0
  118. archivefs-0.2.0/tests/test_config.py +277 -0
  119. archivefs-0.2.0/tests/test_containers.py +291 -0
  120. archivefs-0.2.0/tests/test_credentials.py +283 -0
  121. archivefs-0.2.0/tests/test_dbgap.py +100 -0
  122. archivefs-0.2.0/tests/test_dvc_integration.py +617 -0
  123. archivefs-0.2.0/tests/test_dvc_meta.py +154 -0
  124. archivefs-0.2.0/tests/test_dvcfs.py +563 -0
  125. archivefs-0.2.0/tests/test_ega.py +581 -0
  126. archivefs-0.2.0/tests/test_errors_and_registry.py +253 -0
  127. archivefs-0.2.0/tests/test_from_dvc.py +187 -0
  128. archivefs-0.2.0/tests/test_fsspec_surface.py +89 -0
  129. archivefs-0.2.0/tests/test_geo.py +376 -0
  130. archivefs-0.2.0/tests/test_mendeley.py +225 -0
  131. archivefs-0.2.0/tests/test_ping.py +166 -0
  132. archivefs-0.2.0/tests/test_store.py +91 -0
  133. archivefs-0.2.0/tests/test_subtree_manifests.py +94 -0
  134. archivefs-0.2.0/tests/test_update.py +136 -0
  135. archivefs-0.2.0/tests/test_writer.py +166 -0
  136. archivefs-0.2.0/tests/test_zenodo.py +1768 -0
  137. archivefs-0.2.0/tests/test_zipsafe.py +233 -0
@@ -0,0 +1,45 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: ci-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ with:
25
+ # setuptools-scm derives the version from tags; it needs full history.
26
+ fetch-depth: 0
27
+ - uses: actions/setup-python@v5
28
+ with:
29
+ python-version: ${{ matrix.python-version }}
30
+ - name: Install
31
+ run: |
32
+ python -m pip install --upgrade pip
33
+ # Install everything except the [chiro] extra. chirograph is a private,
34
+ # pre-PyPI dependency, so CI cannot resolve chirograph>=0.1 (and cannot
35
+ # clone the private repo without credentials). Install the rest explicitly.
36
+ pip install -e ".[dbgap,dvc]" pytest pytest-cov responses ruff
37
+ # Then pull chirograph best-effort: the chiro:// and update tests
38
+ # importorskip it and skip cleanly when it is absent. Once chirograph is
39
+ # published this install succeeds and those tests run automatically — no
40
+ # further CI change needed.
41
+ pip install chirograph || echo "chirograph unavailable (private/pre-PyPI); chiro tests will skip"
42
+ - name: Lint
43
+ run: ruff check .
44
+ - name: Test (offline — skip network/credentialed archive tests)
45
+ run: pytest -m "not network and not credentials"
@@ -0,0 +1,61 @@
1
+ # Publish archivefs to PyPI via trusted publishing (OIDC — no API token).
2
+ #
3
+ # ARMED: a published GitHub Release triggers a build + upload via trusted publishing.
4
+ # The upload requires the PyPI side configured first (else the publish job fails at
5
+ # the OIDC exchange with `invalid-publisher`): a pending publisher
6
+ # (owner swarbricklab / repo archivefs / workflow publish.yml / environment pypi)
7
+ # and a `pypi` GitHub environment. See docs/releasing.md for the full walkthrough.
8
+ #
9
+ # The version comes from the git tag via setuptools-scm, so the build must run from
10
+ # the tagged commit. `fetch-depth: 0` lets setuptools-scm see tags, and the build
11
+ # checkout pins `ref` to the release tag so the version is derived from exactly that
12
+ # tag (not a post-release dev version). `workflow_dispatch` stays for manual re-runs.
13
+
14
+ name: publish
15
+
16
+ on:
17
+ workflow_dispatch: {}
18
+ release:
19
+ types: [published]
20
+
21
+ permissions:
22
+ contents: read
23
+
24
+ jobs:
25
+ build:
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ with:
30
+ # Build the exact tag on a release (setuptools-scm reads it); fall back to
31
+ # the dispatched ref for a manual workflow_dispatch run.
32
+ ref: ${{ github.event.release.tag_name || github.ref }}
33
+ fetch-depth: 0
34
+ - uses: actions/setup-python@v5
35
+ with:
36
+ python-version: "3.12"
37
+ - name: Build sdist and wheel
38
+ run: |
39
+ python -m pip install --upgrade pip build
40
+ python -m build --outdir dist .
41
+ - name: Check the distributions
42
+ run: |
43
+ python -m pip install --upgrade twine
44
+ python -m twine check --strict dist/*
45
+ - uses: actions/upload-artifact@v4
46
+ with:
47
+ name: dist
48
+ path: dist/
49
+
50
+ publish:
51
+ needs: build
52
+ runs-on: ubuntu-latest
53
+ environment: pypi
54
+ permissions:
55
+ id-token: write # trusted publishing
56
+ steps:
57
+ - uses: actions/download-artifact@v4
58
+ with:
59
+ name: dist
60
+ path: dist/
61
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,18 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .pytest_cache/
4
+ .ruff_cache/
5
+ .coverage
6
+ htmlcov/
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ src/archivefs/_version.py
11
+
12
+ # local, never committed: credentials and scratch download dirs
13
+ .dvc/config.local
14
+ egacheck/
15
+ *.credentials.json
16
+ # the per-machine config layer. `.archivefs.json` IS committed — that is the whole
17
+ # distinction (docs/configuration.md); this one names paths on one machine.
18
+ .archivefs.local.json
@@ -0,0 +1,50 @@
1
+ # Changelog
2
+
3
+ All notable changes to **archivefs** are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project aims to
5
+ follow [Semantic Versioning](https://semver.org/). The version is derived from git
6
+ tags by `setuptools-scm`.
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.2.0] — 2026-10-26
11
+
12
+ Adds four new access paths (`mendeley://`, `cbioportal://`, `chiro://`, and Chirograph
13
+ schema 2.0 containers), a batch of CLI verbs, and first-class packaging for PyPI /
14
+ conda-forge. Backward-compatible: every `0.1.0` URL and `.dvc` import keeps working.
15
+
16
+ ### Added
17
+
18
+ - **`mendeley://`** — Mendeley Data deposits by DOI or dataset id, versioned and
19
+ folder-aware (anonymous; **experimental**, sha256). See `docs/decisions.md` D44.
20
+ - **`cbioportal://`** — cBioPortal studies via the `cBioPortal/datahub` GitHub repo and
21
+ git-lfs, with version pinning by git ref (`cbioportal://<study>@<ref>`) and a
22
+ download-free sha256 for the LFS data files (**experimental**). See D44.
23
+ - **`chiro://`** — a committed `.chiro` manifest as a portable, self-verifying pin that
24
+ routes to the archive its concept names; digest-addressed manifest store.
25
+ - Chirograph **schema 2.0** adoption: `containers` + member `crc32` for ZIP deposits,
26
+ with a download-free `archivefs confirm`.
27
+ - New CLI verbs: `manifest` (incl. `--from-dvc`, fully offline), `update`, `confirm`,
28
+ `versions`, `ping`, `dvc-meta`; subtree and ZIP-subtree (relocated) pins.
29
+ - Per-file `concept` CURIEs and version-aware DVC pull-through (`push: false`), so a
30
+ reviewer can `dvc pull` straight from the archive with no DVC remote.
31
+ - Packaging: `LICENSE` (Apache-2.0), `NOTICE`, `py.typed`, a CHANGELOG, GitHub Actions
32
+ CI, and a dormant trusted-publishing release workflow.
33
+
34
+ ### Fixed
35
+
36
+ - Thread-safe concurrent ZIP member reads under DVC's default `--jobs` (#40).
37
+ - A `chiro://` pin fetches the pinned *version*, not the concept (found live).
38
+ - Python 3.9 compatibility: a runtime `int | str` union in the BIA backend's
39
+ `isinstance` raised `TypeError` on 3.9 (the first CI run across the matrix caught it).
40
+
41
+ ## [0.1.0] — 2026-08-19
42
+
43
+ First tagged release: the shared read-only base and the initial backends —
44
+ `ega://`, `zenodo://` (with ZIP transparency), `geo://`, `bia://` — addressable by
45
+ accession/DOI and consumable through fsspec and DVC's `import-url`. `dbgap://` is
46
+ registered but deferred.
47
+
48
+ [Unreleased]: https://github.com/swarbricklab/archivefs/compare/v0.2.0...HEAD
49
+ [0.2.0]: https://github.com/swarbricklab/archivefs/compare/v0.1.0...v0.2.0
50
+ [0.1.0]: https://github.com/swarbricklab/archivefs/releases/tag/v0.1.0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
archivefs-0.2.0/NOTICE ADDED
@@ -0,0 +1,4 @@
1
+ archivefs
2
+ Copyright 2026 Swarbrick Lab, Garvan Institute of Medical Research
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (see LICENSE).
@@ -0,0 +1,226 @@
1
+ Metadata-Version: 2.4
2
+ Name: archivefs
3
+ Version: 0.2.0
4
+ Summary: Read-only fsspec filesystems for scientific data archives (EGA, Zenodo, Mendeley Data, cBioPortal, GEO, BioImage Archive).
5
+ Author: Swarbrick Lab
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/swarbricklab/archivefs
8
+ Project-URL: Source, https://github.com/swarbricklab/archivefs
9
+ Project-URL: Issues, https://github.com/swarbricklab/archivefs/issues
10
+ Project-URL: Changelog, https://github.com/swarbricklab/archivefs/blob/main/CHANGELOG.md
11
+ Project-URL: Documentation, https://github.com/swarbricklab/archivefs/tree/main/docs
12
+ Keywords: fsspec,dvc,reproducibility,ega,zenodo,mendeley,cbioportal,geo,provenance
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
24
+ Classifier: Topic :: System :: Filesystems
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: >=3.9
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ License-File: NOTICE
30
+ Requires-Dist: fsspec>=2023.9.0
31
+ Requires-Dist: requests>=2.28
32
+ Provides-Extra: dbgap
33
+ Provides-Extra: chiro
34
+ Requires-Dist: chirograph>=0.1; extra == "chiro"
35
+ Provides-Extra: dvc
36
+ Requires-Dist: dvc>=3.0; extra == "dvc"
37
+ Provides-Extra: all
38
+ Requires-Dist: archivefs[chiro,dbgap,dvc]; extra == "all"
39
+ Provides-Extra: dev
40
+ Requires-Dist: archivefs[all]; extra == "dev"
41
+ Requires-Dist: pytest>=7; extra == "dev"
42
+ Requires-Dist: pytest-cov; extra == "dev"
43
+ Requires-Dist: responses; extra == "dev"
44
+ Requires-Dist: ruff; extra == "dev"
45
+ Dynamic: license-file
46
+
47
+ # archivefs
48
+
49
+ **Read-only [fsspec](https://filesystem-spec.readthedocs.io/) filesystems for
50
+ scientific data archives.**
51
+
52
+ `archivefs` lets you address data in scientific repositories by accession/DOI and
53
+ pull it through the fsspec ecosystem — including [DVC](https://dvc.org/) via
54
+ `dvc import-url`. A reviewer, collaborator, or student can then start from the *same
55
+ raw data* you used and reproduce your results, with checksum certainty and clear,
56
+ version-controlled provenance.
57
+
58
+ ```
59
+ ega://EGAD00001006673 # dataset → directory
60
+ ega://EGAD00001006673/EGAF00004908765 # single file
61
+ zenodo://1486184/data.zip # record id …
62
+ zenodo://10.5281/zenodo.1486184 # … or DOI (concept DOI → latest version)
63
+ mendeley://10.17632/yzxtxn4nmd/4 # Mendeley Data (anonymous; EXPERIMENTAL, sha256)
64
+ geo://GSE176078 # supplementary / processed files
65
+ bia://S-BIAD599 # BioImage Archive: imaging depositions
66
+ dbgap://<phs_id>/<SRR_accession> # deferred, registered, refuses clearly
67
+ cbioportal://brca_metabric # cBioPortal via GitHub+git-lfs (EXPERIMENTAL, sha256)
68
+ cbioportal://brca_metabric@v1.0.0 # … pinned to a release tag or commit SHA
69
+ ```
70
+
71
+ ## What it does today
72
+
73
+ ```console
74
+ $ archivefs ls -l zenodo://1486184 # -R to recurse
75
+ 853 B 49f6a914ea33912471512ac9228c6923 1486184/github-mark.zip
76
+
77
+ $ dvc import-url --no-download zenodo://1486184/github-mark.zip logo.zip
78
+ $ cat logo.zip.dvc
79
+ deps:
80
+ - md5: 49f6a914ea33912471512ac9228c6923 # download-free, from record metadata
81
+ size: 853
82
+ path: zenodo://1486184/github-mark.zip # an accession — never a secret
83
+ outs:
84
+ - path: logo.zip
85
+
86
+ $ dvc pull logo.zip.dvc # bytes on demand, verified by DVC
87
+ ```
88
+
89
+ That order matters. `--no-download` then `dvc pull` gives you the data locally *and*
90
+ leaves the committed `.dvc` in the one shape a reviewer can pull from the archive
91
+ without you hosting a copy — which is the point of the exercise.
92
+ [`docs/decisions.md`](docs/decisions.md) D17.
93
+
94
+ The same works for `ega://` with credentials resolved from the environment at pull
95
+ time, and for `geo://` and `bia://` anonymously. For imaging, BIA's own OME-Zarr
96
+ conversions carry real MD5s, so that tier is download-free too:
97
+
98
+ ```console
99
+ $ dvc import-url --no-download --fs-config view=derived -- \
100
+ bia://S-BIAD599/<image-uuid>/<image>-thumbnail-128-128.png t.png
101
+ # md5 recorded without fetching bytes
102
+ ```
103
+
104
+ Where an archive publishes *no* checksum (BIA's submitted files, bare GEO),
105
+ `--no-download` still records a correct md5 — but DVC computes it by streaming the
106
+ file, so it is not free. [`docs/decisions.md`](docs/decisions.md) D14.
107
+
108
+ ## Why
109
+
110
+ - **Reproducible provenance in one step.** `dvc import-url` someone's archived data
111
+ into your project and get download + a pinned, checksummed reference together.
112
+ - **Checksum certainty.** Once data is in the DVC ecosystem you get integrity
113
+ guarantees and version control over inputs.
114
+ - **Look before you leap.** `dvc list-url` / `archivefs ls` show what is in a record
115
+ before you download it.
116
+ - **Works on anyone's deposits**, whether or not our tooling was used to create them.
117
+
118
+ ## Install
119
+
120
+ ```
121
+ pip install archivefs # Zenodo, GEO, EGA, BIA, Mendeley, cBioPortal
122
+ pip install archivefs[chiro] # + read .chiro.json manifests
123
+ pip install archivefs[dvc] # + the DVC adaptor
124
+ ```
125
+
126
+ EGA needs no extra: the backend speaks EGA's REST API directly. (`pyega3` pins
127
+ `requests==2.26.0`, which would hold the whole environment hostage — see
128
+ [`docs/decisions.md`](docs/decisions.md) D2.)
129
+
130
+ ### Using it with DVC
131
+
132
+ DVC does **not** discover fsspec filesystems from entry points, so one extra step is
133
+ needed once per environment:
134
+
135
+ ```console
136
+ $ archivefs dvc enable # writes a .pth that registers our protocols with DVC
137
+ $ archivefs dvc status # check it works
138
+ ```
139
+
140
+ Why this is necessary, and what was tried instead, is
141
+ [`docs/decisions.md`](docs/decisions.md) D4. `archivefs dvc disable` undoes it;
142
+ `ARCHIVEFS_NO_DVC_HOOK=1` disables it for one command.
143
+
144
+ ## Design
145
+
146
+ A single package, a shared base, and thin per-backend byte-fetchers:
147
+
148
+ - **`archivefs.base`** — path grammar, retry/error contract, length-checked and
149
+ alignment-aware ranged reads, download-free `info()`, read-only enforcement.
150
+ - **`archivefs.credentials`** — one chain for every archive: environment → a
151
+ private on-disk file, and nothing else. Passing a credential as an option is
152
+ refused, and DVC's own validator rejects the keys, so "no secret in the committed
153
+ artifact" is a config parse error rather than a promise.
154
+ - **`archivefs.chiro`** — `.chiro`-first resolution: when a deposit carries a
155
+ manifest, the manifest *is* the listing and the checksums.
156
+ - **`archivefs.zipsafe`** — zip-slip, symlink, zip-bomb and corruption checks,
157
+ applied at listing time as well as on extraction.
158
+ - **`archivefs.backends.*`** — per-archive: how to list this repository, and where its
159
+ bytes live. That is all that is left.
160
+
161
+ Credentials are always resolved at **pull time** from the local environment and
162
+ **never** written into the committed `.dvc` file.
163
+
164
+ ## Status
165
+
166
+ All working backends run against the live archives, with the plan's blocking question
167
+ resolved; `mendeley://` and `cbioportal://` are new and marked **experimental**.
168
+
169
+ | backend | state | download-free checksum | notes |
170
+ |---|---|---|---|
171
+ | `zenodo://` | working | ✅ MD5 from record metadata | DOI + concept-DOI addressing; opt-in ZIP transparency |
172
+ | `ega://` | working | ✅ MD5 of the *decrypted* bytes (verified) | OAuth2 + refresh-on-401; 16-byte range alignment |
173
+ | `geo://` | working | ⚠️ none published — a `.chiro` sidecar fixes it | index-based listing; SRA seam drawn, not built |
174
+ | `bia://` | working | ⚠️ none for submitted files · ✅ MD5 for the OME-Zarr tier | two views; the imaging half of a split deposit |
175
+ | `mendeley://` | working · experimental | ✅ sha256 (published) | DOI/id, versioned, folder-aware; anonymous frontend API |
176
+ | `cbioportal://` | working · experimental | ✅ sha256 for git-lfs data files · ⚠️ derived for small metadata files | `cBioPortal/datahub` GitHub + git-lfs; version-pin by git ref |
177
+ | `dbgap://` | deferred | — | registered so the error explains itself |
178
+
179
+ Verified end to end against the live archives: `dvc list-url`, `dvc import-url
180
+ --no-download` (single file and directory), `dvc update`, `dvc pull`, and ZIP
181
+ transparency via `--fs-config` — including a controlled-access EGA pull whose `.dvc`
182
+ file contains neither username nor password, which DVC would now refuse to write in
183
+ any case. Plain `fsspec.open()` works with no adaptor at all, so pandas/Dask/Intake
184
+ reach the same data by the same path.
185
+
186
+ Live tests are opt-in (`ARCHIVEFS_TEST_{EGA,ZENODO,GEO,DVC}=1`); the default `pytest`
187
+ run is entirely offline.
188
+
189
+ **Read next:**
190
+
191
+ - **All the documentation, indexed:** [`docs/README.md`](docs/README.md) — a page per
192
+ subcommand, the storage-option tables, and the guides below.
193
+ - **Importing from BIA, step by step:**
194
+ [`docs/importing-from-bia.md`](docs/importing-from-bia.md) — a collaborator-facing
195
+ how-to, from `conda env update` to a committed `.dvc` file.
196
+ - **Using any archive with DVC:** [`docs/using-with-dvc.md`](docs/using-with-dvc.md) ·
197
+ **credentials:** [`docs/credentials.md`](docs/credentials.md)
198
+ **reviewer access:** [`docs/reviewer-access.md`](docs/reviewer-access.md)
199
+ - **Decisions and deviations:** [`docs/decisions.md`](docs/decisions.md) — thirty-three
200
+ entries, including the resolved EGA checksum question, several undocumented archive
201
+ behaviours worth knowing about, the credential routes closed off in D16, why a
202
+ reviewer can only pull from the archive for a *partial* import (D17), and the silent
203
+ bugs an adversarial review of the finished code turned up.
204
+ - **Ideas and extensions:** [`docs/ideas.md`](docs/ideas.md)
205
+ - **Architecture:** [`docs/design.md`](docs/design.md) · **checklist:**
206
+ [`docs/plan.md`](docs/plan.md)
207
+
208
+ ## Relationship to Chirograph
209
+
210
+ [**Chirograph**](https://github.com/swarbricklab/chirograph) is a separate project
211
+ defining the `.chiro.json` manifest format (portable, content-addressed checksums +
212
+ provenance). `archivefs` **optionally** reads Chirograph manifests to gain
213
+ download-free checksums, drift detection, and friendly workspace layout — but works
214
+ **without** them (native listing, native checksums). Chirograph is the manifest
215
+ format; `archivefs` is the data-access layer. Neither depends on the other to be
216
+ useful.
217
+
218
+ ## Development
219
+
220
+ ```console
221
+ $ conda env update -n archivefs -f environment.yaml
222
+ $ conda activate archivefs
223
+ $ pytest # offline
224
+ $ pytest -m network # add ARCHIVEFS_TEST_*=1 to actually run these
225
+ $ ruff check src tests scripts
226
+ ```