Git Product home page Git Product logo

todopy's Introduction

TodoPy

Python Todo Servers

If you've ever used a "RESTful" API and thought it would be awesome to create your own, you're in the right place. This project's goal is to show you how easy it can be to accomplish just that in Python with the most popular libraries.

Inspired by the popular TodoMVC, I would like to thank Addy Osmani for allowing me to use his interface utilizing the Backbone.js library. (My favorite...)

Server Examples included:

  • web.py : (pip install web.py | easy_install web.py)

Data Storage

All of the servers in this project require sqlite3 library to be installed.

Starting the servers

All of the servers can be located in their respective directories inside ./servers/. Start the server by running the following command.

$ python main.py
http://0.0.0.0:8080/

browse to http://localhost:8080 view the server in action.

Server API SPEC

  • create → POST
  • read → GET
  • update → PUT
  • delete → DELETE

GET ALL TODOS

  • GET /todos/ will return all available todos.
[ 
    {
        "id":547201,
        "title":"Take out the trash",
        "completed":true
    },
    {
        "id":547202,
        "title":"Play HoN",
        "completed":false,
    }
]

GET SINGLE TODO

  • GET /todos/547201 will return the todo with the specified ID.
{
    "id":547201,
    "title":"Take out the trash",
    "completed":true
}

CREATE TODO

  • POST /todos/ will create a new todo from the parameters passed.
{
    "title":"Write HoN Bot",
}

This must return 201 Created, with the current JSON representation of the todo if the creation was a success.

UPDATE TODO

  • PUT /todos/547202 will update the todo from the parameters passed.
{
    "completed":true
}

This must return 200 OK if the update was a success along with the current JSON representation of the todo.

DELETE TODO

  • DELETE /todos/547202 will delete the todo specified and return 204 No Content if that was successful

todopy's People

Watchers

 avatar  avatar  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.