soca

Software Catalog Creator (soca)

Project Status: Active: The project has reached a stable, usable state and is being actively developed.

logo

A python package that given an organization/user name, it will create a software catalog for browsing all repositories or just a single repository in a minimalist card.

Sample result

Click here to see an interactive example generated by using the oeg-upm organization as input for SOCA.

Click here to see an interactive example generated by using the KnowledgeCaptureAndDiscovery and mintproject organization as input for SOCA.

Click here to see an interactive example generated by using the LinkedEarth organization as input for SOCA.

Command used:

soca fetch -i oeg-upm --org -o oeg-upm_repos.csv -na &&
soca extract -i oeg-upm_repos.csv -o oeg-upm_metadata -i4p &&
soca portal -i oeg-upm_metadata -o oeg-upm_portal

This is an example of a single card using the command:

soca card https://github.com/oeg-upm/soca --png

soca-card

Requirements

Install from GitHub

git clone https://github.com/dakixr/soca
cd soca
pip install -e .

Highly recommended step:

somef configure

And you will be asked to provide the following:

Usage

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

  SOCA (Software Catalog Creator)

  Automatically generates a searchable portal for every repository of an
  organization/s or user/s, which is easy to host.

  Usage:

  1. (fetch) Fetch all repos from the desired organization/s
  2. (extract) Extract all metadata for every repo
  3. (portal) Generate a searchable portal for all the retrieved data

Options:
  -h, --help  Show this message and exit.

Commands:
  card     Create a stand-alone card ready to be embedded in a website
  extract  Fetch and save metadata from introduced repos
  portal   Build a portal with a minimalist design
  fetch    Retrieve all organization/s or user/s repositories

In order to use SOCA you will need to follow the next steps:

1 - Fetch

First thing to do is gather all repositories pointers that we want to use. We’ll use the fetch command to ease this task.

  -i, --input <name-or-path>  Organization or user name  [required]
  -o, --output <path>         Output csv file  [default: repos.csv]
  --org                       Extracting from a organization  [default: True]
  --user                      Extracting from a user  [default: False]
  -na, --not_archived         Fetch only repos that are not archived
                              [default: False]
  -nf, --not_forked           Fetch only repos that are not forked  [default:
                              False]
  -nd, --not_disabled         Fetch only repos that are not disabled
                              [default: False]
  -h, --help                  Show this message and exit.

Is important to determine if the name belongs to a user or a organization by using the –user or –org flag, additionally you can specify an output path with the flag -o.

Example:

soca fetch -i dakixr --user
soca fetch -i oeg-upm --org -o oeg-upm_repos.csv --not_archived

This command also accepts a file as input (names separated by a new-line) for ingesting multiple names at a time.

Example:
soca fetch -i multiple-users.csv --user -o multiple-users_repos.csv
soca fetch -i multiple-orgs.csv --org -o multiple-orgs_repos.csv --not_archived

The output of this command is a csv file with all the repos of the selected users/orgs. At this moment is a good time to clean this file (remove all repos that you don’t want to use). Note: you can add manually any other repository.

2 - Extract

Then we use the extract command to extract all the metadata required from each repository. If you want a more in-depth analysis on Python repositories use the flag -i4p or –inspect4py.

  -i, --input <csv-repos>  Pointers to the repositories in csv format
                           [required]
  -o, --output <path>      Dir where repositories metadata will be saved
  -i4p, --inspect4py       Use inspect4py to extract additional metadata from
                           Python repositories
  -h, --help               Show this message and exit.

Example:
soca extract -i oeg-upm_repos.csv -o oeg-upm_metadata

3 - Portal

This is the last step in the pipeline. For building the portal we need to use the command portal, it will take as input the directory created by the command extract.

  -i, --input <dir-json-metadata>
                                  Dir repositories metadata in json format
                                  [required]
  -o, --output <path>             Dir where Software Catalog Portal will be
                                  saved  [default: portal]
  -t, --title <title>             Portal's title  [default: Software Catalog]
  -fi, --favicon <path-icon.ico>  Portal's favicon  [default: img/soca-
                                  logo.ico]
  -h, --help                      Show this message and exit.

Example:
soca portal -i oeg-upm_metadata -o dir_portal --title '[Portal's title]'

If everything worked fine now a new dir should have been created with all the assets and code to deploy this portal.

Create a stand-alone card

SOCA also gives the option to create a single card in one of two different formats:

  -i, --input <url>    Repository URL  [required]
  -o, --output <path>  Output file where the html will be saved  [default:
                       card]
  --html               Save card as html  [default: True]
  --png                Save card as a png  [default: False]
  -h, --help           Show this message and exit.

As input you will need a github repository url and use one of the flags: –html or –png.
Note: if no flag is used the default is html.

Example:
soca card -i https://github.com/oeg-upm/soca --html
soca card -i https://github.com/oeg-upm/soca --png

Styling the portal

In case you want to change the default style of the portal, SOCA decouples the .css files from the code-base. So in the resulting portal directory there will be two .css files are available for further tinkering and styling to everyone needs.