Giter Club home page Giter Club logo

wiserfunding_api's Introduction

WiserFunding API

Build and run

Dockers

docker-compose build && docker-compose up

Pure Python

source venv/bin/activate
pip install -r requirements.txt

export PYTHONPATH='./api'
python3 api/v1/app.py

Test

From root project:

export PYTHONPATH='./api'
pytest

Goals

Basic

Implement basic API:

  • One resource:
    company/<country_iso_code>/<id>
    
  • One method: PUT
  • JSON payload: financials for 5 years
  • Response: Z-Score formula (explained later)

Complete example:

INPUT:
PUT /company/gb/10149809
{“financials”: [
{“year”: 2020, “ebit”: 123.45, “equity”: 234.56, “retained_earnings”: 345.67, “sales”:
1234.56, “total_assets”: 345.67, “total_liabilities”: 456.78, “working_capital”: 23.45},
{“year”: 2019, “ebit”: 122.63, “equity”: 224.56, “retained_earnings”: 325.33, “sales”:
1214.99, “total_assets”: 325.04, “total_liabilities”: 426.78, “working_capital”: 23.45},
{“year”: 2018, “ebit”: 120.17, “equity”: 214.06, “retained_earnings”: 225.00, “sales”:
1204.01, “total_assets”: 305.11, “total_liabilities”: 426.78, “working_capital”: 23.45},
{“year”: 2017, “ebit”: 118.23, “equity”: 204.96, “retained_earnings”: 125.97, “sales”:
1200.00, “total_assets”: 290.75, “total_liabilities”: 426.78, “working_capital”: 23.45},
{“year”: 2016, “ebit”: 116.05, “equity”: 234.56, “retained_earnings”: 105.11, “sales”:
1010.82, “total_assets”: 250.13, “total_liabilities”: 426.78, “working_capital”: 23.45}]}

OUTPUT:
{“scores”: [{“year”: 2020, “zscore”: xxx}, {“year”: 2019, “zscore”: xxx}, {“year”: 2018,
“zscore”: xxx}, {“year”: 2017, “zscore”: xxx}, {“year”: 2016, “zscore”: xxx}]}

Z-Score formula

Z = 1.2X1 + 1.4X2 + 3.3X3 + 0.6X4 + 1.0X5
X1 = working_capital / total_assets
X2 = retained_earnings / total_assets
X3 = ebit / total_assets
X4 = equity / total_liabilities
X5 = sales / total_assets

Plus

Additional endpoints to return previously generated reports:

  • Database models in postgres or sqlite, mysql etc.
  • Build and deploy to free cloud tier on AWS, GCP, Azure etc.
  • Docker compose up to run locally
  • API documentation and examples
  • Use of pre-commit, black, mypy, isort etc.
  • Test coverage of 100%
  • CI/CD with Travis or similar

wiserfunding_api's People

Contributors

asacristani avatar

Watchers

James Cloos 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.