-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can now pass urls to commandline fairtally with progressbar #24
Conversation
Co-authored-by: Faruk D. <[email protected]>
fairtally/cli.py
Outdated
|
||
@click.command() | ||
@click.argument("urls", nargs=-1) | ||
@click.option("-o", "--output-filename", "output_file", help="Where to write the results of the analysis.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mention output formats in the help text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split this up into a --html
and a --json
, each with separate help text; this also avoids having to run the tool twice if you happen to want both json and html output.
Co-authored-by: Faruk D. <[email protected]>
Co-authored-by: Faruk D. <[email protected]>
Co-authored-by: Faruk D. <[email protected]>
…m/fair-software/fairtally into 3-5-15-23-bootstrapping-fairtally
The pep8 linting check fails but that's because those rules aren't helping me write clean code. E.g. the linelength of 79, how function calls break over multiple lines, the fact that you cannot have an empty line after a function signature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests commands and pre-commit script ran correctly.
Spawned of some issues and left some inline comments for things that would otherwise never be done.
Great work.
Co-authored-by: Stefan Verhoeven <[email protected]>
Co-authored-by: Stefan Verhoeven <[email protected]>
committed the suggestions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing html output results in an error message:
$ pip install .
...
$ fairtally --html results.html https://github.com/fair-software/howfairis https://gitlab.com/jspaaks/howfairis-livetest
...
FileNotFoundError: [Errno 2] No such file or directory:
'/home/erikt/anaconda3/envs/python37/lib/python3.7/site-packages/fairtally/data/index.html.template'
True, but will be fixed by #25. See also #26. Do you want me to fix it here as well? My guess is we're eventually going to merge #25 anyway right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the missing file issue does not need to be fixed here if it is already fixed in another issue. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely. Thanks @jspaaks
Thanks for reviewing, merged on behalve of @jspaaks |
In this PR:
fairtally
accept urls via the commandline as arguments (Find how to pass list of URLs to fairtally #3)tqdm
(add progress bar #23)--html
and--json
options. If specified, fairtally will write to a json file or to an html file, respectively. html writing uses jinja2 templating anddata/index.html.template
.For testing, you can put in your own URLs, but for convenience, the snippet below gives you the 10 URLs from the Research Software Directory which were changed most recently:
To test:
Should show a progress bar and print results at the end
If you have
jq
installed, you can pipe the results into it, like so:or write to a json file:
or write to an html file:
Here's what that looks like in the browser: