Skip to content

Fridman/points-tax-calculator-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tax Calculator API app

This Flask-based REST API calculates one's owed taxes based on tax bracket information retrieved from The Points Interview Test Server

Installation

  1. Clone this repository onto your local machine.
  2. Install The Points Interview Test Server and run it locally.
  3. Set up a virtual environment.
  4. Install all requirements using pip3 install requirements.txt.
  5. Run the server with flask run or test with pytest.

Request

The app is configured to send requests to http://127.0.0.1:5000/ which is the default address for the The Points Interview Test Server.

GET requests to the app should be structured as follows:

    /api/v1/calculate-tax/<tax_year>/?income=<income_value>

where the parameters are defined as

  • income_value - the value of one's annual income represented in cents.
  • tax_year - the year for which the tax information should be retrieved.

Return

The API will return a JSON response structured as follows:

{
    "effective_rate": 0.15,
    "income": 5000000,
    "tax_brackets": [
        {
            "max": 5019700,
            "min": 0,
            "owed": 750000.0,
            "rate": 0.15
        },
        {
            "max": null,
            "min": 5019700,
            "owed": 0,
            "rate": 0.205
        },
    ],
    "total_owed": 750000.0
}

Once again, all monetary values are represented in cents.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages