| 1 |
# conda_package_streaming |
| 2 |
|
| 3 |
Fetch metadata from remote .conda or .tar.bz2 package. |
| 4 |
|
| 5 |
Try to fetch less than the whole file if possible. |
| 6 |
|
| 7 |
Zip (.conda) is made for this: |
| 8 |
|
| 9 |
``` |
| 10 |
$ python -m conda_package_streaming.url https://repo.anaconda.com/pkgs/main/osx-64/sqlalchemy-1.4.32-py310hca72f7f_0.conda /tmp/ |
| 11 |
DEBUG:conda_package_streaming.lazy_wheel:bytes=-10240 |
| 12 |
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443 |
| 13 |
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/main/osx-64/sqlalchemy-1.4.32-py310hca72f7f_0.conda HTTP/1.1" 206 10240 |
| 14 |
DEBUG:conda_package_streaming.lazy_wheel:bytes=43-38176 |
| 15 |
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/main/osx-64/sqlalchemy-1.4.32-py310hca72f7f_0.conda HTTP/1.1" 206 38134 |
| 16 |
DEBUG:conda_package_streaming.lazy_wheel:prefetch 43-38177 |
| 17 |
|
| 18 |
$ curl -s -I https://repo.anaconda.com/pkgs/main/osx-64/sqlalchemy-1.4.32-py310hca72f7f_0.conda | grep content-length |
| 19 |
content-length: 1984926 |
| 20 |
``` |
| 21 |
|
| 22 |
We fetch 10240 + 38134 = 48374 bytes in two requests of this 1984926-byte |
| 23 |
package. |
| 24 |
|
| 25 |
|
| 26 |
## Older format |
| 27 |
|
| 28 |
bzip2 has a very large block size, and we don't know if the info/ directory is |
| 29 |
finished before reading the entire archive. However if we only want certain |
| 30 |
files from info/ we can stop after we've seen them all. Fetching repodata and |
| 31 |
calling response.raw.tell() after each tar member: |
| 32 |
|
| 33 |
``` |
| 34 |
$ python -m metayaml.fetch_metadata \ |
| 35 |
https://repo.anaconda.com/pkgs/main/linux-64/absl-py-0.1.10-py27_0.tar.bz2 |
| 36 |
128948 info/hash_input.json |
| 37 |
128948 info/index.json |
| 38 |
128948 info/files |
| 39 |
128948 info/about.json |
| 40 |
128948 info/paths.json |
| 41 |
128948 info/LICENSE.txt |
| 42 |
128948 info/git |
| 43 |
128948 lib/python2.7/site-packages/absl_py-0.1.10-py2.7.egg-info/dependency_links.txt |
| 44 |
128948 lib/python2.7/site-packages/absl_py-0.1.10-py2.7.egg-info/requires.txt |
| 45 |
128948 lib/python2.7/site-packages/absl_py-0.1.10-py2.7.egg-info/top_level.txt |
| 46 |
128948 lib/python2.7/site-packages/absl/__init__.pyc |
| 47 |
128948 lib/python2.7/site-packages/absl/testing/__init__.pyc |
| 48 |
128948 info/test/run_test.py |
| 49 |
... |
| 50 |
``` |
| 51 |
|
| 52 |
A larger package: |
| 53 |
``` |
| 54 |
# Fetch https://repo.anaconda.com/pkgs/main/linux-64/airflow-1.10.10-py36_0.tar.bz2 |
| 55 |
# Printing bytes transferred after each archive member, |
| 56 |
286720 info/hash_input.json |
| 57 |
286720 info/has_prefix |
| 58 |
286720 info/index.json |
| 59 |
286720 info/about.json |
| 60 |
286720 info/git |
| 61 |
286720 info/files |
| 62 |
286720 info/paths.json |
| 63 |
286720 lib/python3.6/site-packages/airflow/alembic.ini |
| 64 |
286720 lib/python3.6/site-packages/airflow/www/templates/airflow/variables/README.md |
| 65 |
... |
| 66 |
286720 info/test/test_time_dependencies.json |
| 67 |
... |
| 68 |
634880 lib/python3.6/site-packages/airflow/www/static/ace.js |
| 69 |
634880 bin/airflow |
| 70 |
``` |
| 71 |
|
| 72 |
```{toctree} |
| 73 |
:maxdepth: 4 |
| 74 |
|
| 75 |
url |
| 76 |
s3 |
| 77 |
lazy_wheel |
| 78 |
package_streaming |
| 79 |
extract |
| 80 |
transmute |
| 81 |
create |
| 82 |
``` |