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

Add task and challenge endpoints #45

Merged
merged 8 commits into from
Jun 24, 2020

Conversation

mattmanley
Copy link
Collaborator

Description:

This PR adds a bunch of new /task and /challenge endpoints. It also reorganizes the examples into a smaller number of files. There will not be an example for every endpoint, just those that seem worth showing examples for.

Potential Impact:

Adds to the overall list of supported endpoints.

Unit Test Approach:

Tox

Test Results:

Tox tests passed.

Copy link
Collaborator

@danielduhh danielduhh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, nice job getting these out. I learned a lot about the MapRoulette API today 😄

"""Method to retrieve challenge information via the corresponding challenge name and parent (project) ID

:param project_id: the ID of the parent project
:param challenge_name: the ID corresponding to the challenge
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The challenge name is a string right?

@@ -42,6 +72,48 @@ def get_challenge_statistics_by_id(self, challenge_id):
response = self.get(endpoint=f"/data/challenge/{challenge_id}")
return response

def get_challenge_listing(self, project_ids="", limit=10, page=0, only_enabled='true'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! I didn't know this existed.....

)
return response

def get_tasks_by_tags(self, tags, limit=10, page=0):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+100 ! @dcastrowa

@mattmanley mattmanley merged commit 2a0ae49 into osmlab:dev Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants