Giter VIP home page Giter VIP logo

almost_flask's Introduction

Almost Flask

A Flask near-implementation in less than 10 lines. Written with zero dependencies. Works only with Python 3.

Heavily inspired by almost-sinatra.

Features:

  • simplified Flask class
  • decorator routing syntax
  • subset of route parameter syntax
  • GET, POST, PUT, DELETE methods
  • request object (args, path, method)
  • stand alone usage
  • thread safe

Perhaps after you've finished playing with almost_flask you should take a look at Flask for real, because it's quite rad.

Installation

Copy the contents of almost_flask.py into your app file (at the top), that way you also avoid running the wrong version by accident.

Try it

$ python3 example.py
What Flask implementation should I use?
[R]eal Flask
[A]lmost Flask
>>> A

Performance??

$ sloccount almost_flask.py
Total Physical Source Lines of Code (SLOC)                = 5
Development Effort Estimate, Person-Years (Person-Months) = 0.00 (0.01)
 (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months)                         = 0.04 (0.42)
 (Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule)  = 0.02
Total Estimated Cost to Develop                           = $ 104
 (average salary = $56,286/year, overhead = 2.40).

$ sloccount flask/ tests/
Total Physical Source Lines of Code (SLOC)                = 6,618
Development Effort Estimate, Person-Years (Person-Months) = 1.45 (17.46)
 (Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months)                         = 0.62 (7.41)
 (Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule)  = 2.36
Total Estimated Cost to Develop                           = $ 196,519
 (average salary = $56,286/year, overhead = 2.40).

Generated using David A. Wheeler's 'SLOCCount'.

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.