Giter VIP home page Giter VIP logo

fairtally's Introduction

fairtally

Python application to analyze multiple GitHub and GitLab repositories compliance with the fair-software.eu recommendations.

fair-software.nl recommendations Badges
1. Code repository GitHub Badge
2. License License Badge
3. Community Registry PyPI Badge Research Software Directory Badge
4. Enable Citation Zenodo Badge
5. Checklist CII Best Practices Badge
Other best practices  
Continuous integration Python Build Linter
DockerHub Docker Pulls

Installation

To install fairtally, do:

pip3 install --user fairtally

Usage

To use fairtally to check the compliance of multiple repositories, one can use the command below.

fairtally https://github.com/fair-software/fairtally https://github.com/fair-software/howfairis

This command will generate a html report called tally.html which will contain the results of the checks for each repository.

Then open the analysis in a web-browser, for example Firefox:

firefox tally.html

The report will look similar to the example below:

docs/_static/fairtally_example.png

You can sort the table by clicking on the table headers. The purple plus signs provide access to log messages of each repository.

Checking many repositories will quickly exceed the rate limit of the APIs of GitLab and GitHub and resulting in all remaining repositories to be fully non-compliantly. See howfairis docs how setup environment variables to increase the rate limit.

Using Docker image

You can run fairtally Docker image using the command below.

docker pull fairsoftware/fairtally

You can run fairtally Docker image using the command below.

docker run --rm fairsoftware/fairtally --help

--rm argument will remove Docker container after execution.

To tally 2 URLs and save the report as tally.html in the current working directory you can run the command below.

docker run --rm fairsoftware/fairtally -o - https://github.com/fair-software/fairtally https://github.com/fair-software/howfairis > tally.html

See developer documentation to learn how to modify the Docker image.

Research Software Directory

To FAIR tally the software listed on the Research Software Directory of the Netherlands eScience Center.

First download a list of software by calling RSD API

curl https://research-software.nl/api/software > software.json

Next, extract the repository URLs with jq.

cat software.json | jq -r '[.[].repositoryURLs.github] | flatten | .[]' > urls.txt

Finally run fairtally to generate a report.

fairtally --output-file report.html --input-file urls.txt

Documentation

Command line interface help can be retrieved with

fairtally --help

The output of the command will be something like:

Usage: fairtally [OPTIONS] [URLS]...

Options:
  -o, --output-file TEXT     Filename of where to write the results. Use `-`
                             to write to standard out.  [default: tally.html]

  -i, --input-file FILENAME  Check URLs in file. One URL per line. Use `-` to
                             read from standard input.

  --format [html|json]       Format of output.  [default: html]
  --version                  Show the version and exit.
  --help                     Show this message and exit.

Contributing

If you want to contribute to the development of fairtally, have a look at the contribution guidelines.

License

Copyright (c) 2021, Netherlands eScience Center

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Credits

This package was created with Cookiecutter and the NLeSC/python-template.

Instructions for developers

The developer documentation can be found in README.dev.rst.

fairtally's People

Contributors

eriktks avatar fdiblen avatar jspaaks avatar sverhoeven avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fairtally's Issues

Prep release 0.1.0

Add fairtally to

  • pypi
  • DockerHub
  • Update the Changelog
  • Make a GitHub release
  • Check Zenodo entry and add the badge

progressbar text left behind when done

noticable with short pwd strings like tmp

# assume fairtally is installed in user space or global
cd $(mktemp -d --tmpdir demo.XXXXXX)

then

┌─ 07:38:27 /tmp/demo.ALTn18 
└─ $ fairtally `cat rsd-urls.txt | tail -n 5`
fairtally progress: |████████████████████████████████████████████| 5/5
Completed fairtally on 5 URLs and written report to tally.html
┌─ 07:38:42 /tmp/demo.ALTn18  and written report to tally.html
└─ $ 

Add .zenodo.json

While working on dev documentation I realized we don't have a .zenodo.json yet.

Add summary statistics to the report

The report should show some statistics.

Example:

  • How many of the repositories have full compliance
  • How many of the repositories are citable etc.
  • Statistics on the badge color, e.g. how many of them have a green badge

Render the report data

Initial choice is to write index.html using jinja2 templating with a complete static page.

Improve make a release docs

In make a release preps

  • First step should be to decide which version you are going to release, major, minor or batch
  • swap version up (step 2) and CITATION.cff (step 3) as version needs to be updated in CITATION.cff
  • last step should be to update DOI in CITATION.cff after Zenodo entry is updated.
  • step 3 should link to versioning chapter
  • Besides updating example report also test if reports dynamic features (sort/search/paging) still work
  • Instead of doing test installation with OS python use a virtual environment so OS python or ~/bin is not polluted
  • pypitest should be test.pypi.org
  • document what version/title/description to use during GitHub release creation
  • After docker build test whether image works with for example docker run fairsoftware/fairtally --version

Fix PyPi publish action

PR #78 changes when PyPi publish workflow is triggered. We need to use a token to automated automatic PyPi publishing and update the developer documentation.

Include HTML template in distribution

Building either #24 or #25 will result in the HTML template from being excluded from the source distribution or wheel distribution.

pip install -e .[publishing]
python setup.py sdist bdist_wheel
unzip -l dist/fairtally-0.1.0-py3-none-any.whl |grep index.html
tar -zvtf dist/fairtally-0.1.0.tar.gz |grep index.html

Hide expand button

If stdout and stderr are both empty, expand button should not appear.

Supply URLs in file or on standard input

I have a list of URLs I would like to check with fairtally. To do this I need concatenate the list with a space char and pass that long string to the cli. It would be nice if I could directly give it my list of URLs as file or on stdin. Where each URL would be on it own line.

For example a file named urls.txt

https://github.com/fair-software/howfairis
https://gitlab.com/jspaaks/howfairis-livetest

I would like to be able to call

fairtally --urls urls.txt
# or
fairtally < urls.txt
# or
cat urls.txt | fairtally

It would be nice option to have next to #3

Add timestamp to report

When a report HTML page starts circulating or is found somewhere it would be nice to know when it was run. Can a timestamp be added to the report?

Make HTML report default

At the moment you can call the script in 3 ways to get output:

  1. fairtally https://github.com/fair-software/repo1, will print JSON to stdout
  2. fairtally --html results.html https://github.com/fair-software/repo1, will write HTML formatted results.html file
  3. fairtally --json results.json https://github.com/fair-software/repo1, will write JSON formatted results.json file

As the main purpose of fairtally is to generate a HTML report I would like that it does so by default. My proposed CLI arguments would be

  1. fairtally https://github.com/fair-software/repo1, will write tally.html
  2. fairtally --output-file results.html https://github.com/fair-software/repo1, will write results.html
  3. fairtally --format html https://github.com/fair-software/repo1, will write tally.html
  4. fairtally --format json https://github.com/fair-software/repo1, will write tally.json
  5. fairtally --format json --output-file results.json https://github.com/fair-software/repo1, will write results.json

PS. Not sure about tally.* as default output file name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.