Software Heritage Tarball Loader
Project description
SWH Tarball Loader
The Software Heritage Tarball Loader is in charge of ingesting the directory representation of the tarball into the Software Heritage archive.
Configuration
This is the loader's (or task's) configuration file.
{/etc/softwareheritage | ~/.config/swh | ~/.swh}
/loader/tar.yml:
working_dir: /home/storage/tmp/
storage:
cls: remote
args:
url: http://localhost:5002/
API
local
Load local tarball directly from code or python3's toplevel:
# Fill in those
repo = '8sync.tar.gz'
tarpath = '/home/storage/tar/%s' % repo
origin = {'url': 'file://%s' % repo, 'type': 'tar'}
visit_date = 'Tue, 3 May 2017 17:16:32 +0200'
last_modified = 'Tue, 10 May 2016 16:16:32 +0200'
import logging
logging.basicConfig(level=logging.DEBUG)
from swh.loader.tar.tasks import LoadTarRepository
l = LoadTarRepository()
l.run_task(origin=origin, visit_date=visit_date,
last_modified=last_modified)
remote
Load remote tarball is the same sample
url = 'https://ftp.gnu.org/gnu/8sync/8sync-0.1.0.tar.gz'
origin = {'url': url, 'type': 'tar'}
visit_date = 'Tue, 3 May 2017 17:16:32 +0200'
last_modified = '2016-04-22 16:35'
import logging
logging.basicConfig(level=logging.DEBUG)
from swh.loader.tar.tasks import LoadTarRepository
l = LoadTarRepository()
l.run_task(origin=origin, visit_date=visit_date,
last_modified=last_modified)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
swh.loader.tar-0.0.37.tar.gz
(10.7 kB
view hashes)
Built Distribution
Close
Hashes for swh.loader.tar-0.0.37-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba1bd6904d01fc41175e6a4ef1ea626008a5d25489eae833db8bd2b7f803e254 |
|
MD5 | 91c6475b85edeaf921ba35cdd72aed54 |
|
BLAKE2b-256 | 83d9b43e61f6e8616e64eed3f5ccfba0ebc9a4efcec16ac07e773d7848036991 |