Giter Site home page Giter Site logo

code100-python's Introduction

Code100 Competition - Python Sample

This codebase contains everything you need to complete coding challenges of the Code100 competition in Python. The code example of communicating with the API is already present in the code100.py file.

If you need additional information regarding the API you may find it in the rest of this document.

Running the project

Open the terminal and run:

pip install -r requirements.txt
python code100.py

API Base URL

https://challenger.code100.dev

Swagger Documentation

https://challenger.code100.dev/doc/

Login

In order to request the coding puzzle or submit the solution, you first need to retrieve the JSON Web Token by logging into the API:

Request

POST /login

Body

{
  "email": <email here>,
  "password": <password here>
}

Response

{
   ...
   "token": <JWT token>
   ...
}

The token given in this response needs to be supplied for the Request Puzzle and Submit Solution requests.

Request Puzzle

Request

GET /getpuzzle

Headers

Authorization: Bearer <JWT token>

Response

{
  "name": <name of the puzzle>,
  "input": <coding challenge>
}

(coding challenge depends from round to round)

Submit Solution

Request

POST /postanswer

Headers

Authorization: Bearer <JWT token>

Body

{
  "answer": <your solution to the posted puzzle>
}

Response

There is a 15 seconds delay for you to receive the answer for this request.

{
  "message": <information if solution was correct or not>,
}

code100-python's People

Contributors

metcalfc avatar totipu avatar

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.