Skip to content
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

Create a basic Flask application wrapping the "commands" module #14

Open
4 tasks
havanagrawal opened this issue Oct 5, 2020 · 1 comment
Open
4 tasks
Assignees
Labels
hacktoberfest Issues that are good candidates for Hacktobeerfest participants

Comments

@havanagrawal
Copy link
Owner

Problem

There are a few functions that are exposed by the commands module (see its __init__.py). They are currently exposed via the cli module on the command line, via Click.

Expose these functions over HTTP by setting up a simple Flask webapp. Create a POST endpoint against each of these functions.

Prerequisites

  • You know basic git, i.e. how to fork this repo, clone this repo, work on a branch and send a PR
  • You have basic working knowledge of Python
  • You are able to run Python on your machine
  • You know, or are willing to learn through a few simple tutorials, how to set up a basic Flask app and write a minimal unit test for it.

Details

  • The Flask app file should live in the webapp directory.
  • It should import the functions from the commands module
  • It should expose these functions via HTTP POST
  • You DO NOT need to create any UI/HTML for this webapp.

How to Test

  • You can write a super simple unit test by patching the underlying functions as mocks, and asserting that they are invoked. See test_cli.py for an example, and how to test Flask applications
  • If you are familiar with curl/Postman/any other similar tool, feel free to spin up the Flask app and test it using one of these. Be aware though that you'll most likely see errors from the Wikidata API about missing username/password/auth, this is fine.

Hints

@havanagrawal havanagrawal added hacktoberfest Issues that are good candidates for Hacktobeerfest participants good first issue Good for newcomers and removed good first issue Good for newcomers labels Oct 5, 2020
@THeinemann
Copy link

Hey,
I'd like to work on this ticket if it's okay with you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issues that are good candidates for Hacktobeerfest participants
Projects
None yet
Development

No branches or pull requests

2 participants