shapi

A Python client to interact with Software Heritage API

View the Project on GitHub

SHApi - Software Herritage API client

himalayan_thar

A python client to query Software Heritage API for:

Install SHApi

git clone https://github.com/rahulunair/shapi && cd shapi && pip install .

Usage

Usage: shapi [OPTIONS] COMMAND [ARGS]...

  SHApi - Software Heritage(SH) API.

  A Python client to interact with software heritage API to query for an
  object, upload new pkgs to the repo.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  check         Check if a repo url is archived in SH.
  status_check  API Health check.
  submit        Submit a repo to be archived in SH.

Available commands

shapi status_check
shapi check <url>
shapi submit <version_control_tool> <uri>

Examples

shapi status_check
=======================================================================
SH API is alive and kicking.
=======================================================================
shapi check https://github.com/tensorflow/tensorflow
=======================================================================
Archive found
Date: 2020-01-30T12:48:13.162613+00:00
Src URL: https://github.com/tensorflow/tensorflow
Archive URL: https://archive.softwareheritage.org/api/1/snapshot/50a5123ba58a352be71a143446e2021c8f0471c9/
=======================================================================
shapi submit git https://github.com/tensorflow/tensorflow
=======================================================================
Date: 2020-06-21T17:21:26.152749+00:00
Src URL: https://github.com/tensorflow/tensorflow
Save status: accepted
=======================================================================