Skip to content

rahulunair/shapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SHApi - Software Herritage API client

himalayan_thar

A python client to query Software Heritage API for:

  • archived repo
  • submit request to archive repo

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

  • Check if the API is alive.
shapi status_check
  • Check if a repo is already archived and get the latest snapshot URI
shapi check <url>
  • Submit a repo to be archived by Software Heritage.
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
=======================================================================

Releases

No releases published

Packages

No packages published

Languages