Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/vejnar/LabxPipe
02 May 2023, 09:53:20 UTC
  • Code
  • Branches (1)
  • Releases (8)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    • v0.6.0
    • v0.5.0
    • v0.4.0
    • v0.3.0
    • v0.2.0
    • v0.1.2
    • v0.1.1
    • v0.1.0
  • ae9f289
  • /
  • src
  • /
  • labxpipe_scripts
  • /
  • lxpipe.py
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
  • release
origin badgecontent badge
swh:1:cnt:92aa6e712f5e8808988d20a8e7331ca5f2337b1a
origin badgedirectory badge
swh:1:dir:33402c9544163a26dfdba55f5b8be0205e5bcf04
origin badgerevision badge
swh:1:rev:c502eb99dbb211d00afb9fd97fcff06b86c01c08
origin badgesnapshot badge
swh:1:snp:cc771c9e970c5a9ae56f266e0d2aa3ecec08a923
origin badgerelease badge
swh:1:rel:309aeefead703dea4fc70832924257ff8a480d87

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
  • release
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: c502eb99dbb211d00afb9fd97fcff06b86c01c08 authored by vejnar on 14 March 2023, 17:19:25 UTC
Add extract command
Tip revision: c502eb9
lxpipe.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

#
# Copyright © 2013 Charles E. Vejnar
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://www.mozilla.org/MPL/2.0/.
#

import argparse
import sys

import labxpipe_scripts.lxpipe_demultiplex
import labxpipe_scripts.lxpipe_extract
import labxpipe_scripts.lxpipe_generate
import labxpipe_scripts.lxpipe_merge_count
import labxpipe_scripts.lxpipe_profile
import labxpipe_scripts.lxpipe_run
import labxpipe_scripts.lxpipe_report
import labxpipe_scripts.lxpipe_trackhub

subcommands = {
    'run': labxpipe_scripts.lxpipe_run,
    'report': labxpipe_scripts.lxpipe_report,
    'extract': labxpipe_scripts.lxpipe_extract,
    'merge-count': labxpipe_scripts.lxpipe_merge_count,
    'generate': labxpipe_scripts.lxpipe_generate,
    'profile': labxpipe_scripts.lxpipe_profile,
    'trackhub': labxpipe_scripts.lxpipe_trackhub,
    'demultiplex': labxpipe_scripts.lxpipe_demultiplex
}

def generate_help(subcommands):
    helpmsg = ''
    for k, m in subcommands.items():
        doc = ''
        if m.__doc__ is not None:
            for l in m.__doc__.split('\n'):
                if len(l.strip()) > 0:
                    doc = l.strip()
                    break
        helpmsg += f'{k:<13}{doc}\n'
    return helpmsg

class _HelpAction(argparse._HelpAction):
    def __call__(self, parser, namespace, values, option_string=None):
        if 'command' in namespace and namespace.command in subcommands:
            subcommands[namespace.command].main([f'{parser.prog} {namespace.command}', '-h'])
        else:
            parser.print_help()
            parser.exit()

def main(argv=None):
    if argv is None:
        argv = sys.argv
    parser = argparse.ArgumentParser(description='LabxPipe', formatter_class=argparse.RawTextHelpFormatter, add_help=False)
    parser.add_argument('-h', '--help', action=_HelpAction, help='help for help if you need some help')
    parser.add_argument('command', metavar='command', action='store', choices=subcommands.keys(), help=generate_help(subcommands))
    # One command is required
    if len(argv) < 2:
        parser.print_help()
        return 1
    # Parse arguments
    args, rest = parser.parse_known_args(argv[1:])
    # Run
    subcommands[args.command].main(argv)

if __name__ == '__main__':
    sys.exit(main())

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API