GithubHelp home page GithubHelp logo

jicruz96 / presupuestospr Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.09 MB

codebase for presupuestospr.com -- an API and website that makes Puerto Rico municipal budget data accessible and easy to use.

Home Page: http://about.presupuestospr.com/

Python 90.62% CSS 6.06% HTML 3.32%

presupuestospr's Introduction

presupuestospr.com - A Puerto Rico Municipal Budget API

This was my final project for my Full-Stack Software Engineer certification from Holberton School.

It consists of:

  • Many, many hours of work scraping, cleaning, and organizing the municipal budget data for all 78 municipalities in Puerto Rico, using an assortment of python scripts and helper libraries, such as pyPDF.
  • A Flask API to serve the cleaned data.

The API

The API is straightforward. Just write the name of a municipality.

# Replace <municipality> with a municipality name
presupuestospr.com/api/<municipality>/

This request returns a JSON-formatted dictionary of the following information:

{
    'municipio': # municipality name,
    'gastos': # expenses,
    'ingresos': # revenue,
    'deudas': # debt
    'departamentos': # municipal departments
}

The values of this dictionary are explained further below:

Key Key Description Value
municipio Municipality name string
gastos Expenses {"monto" (dollar amount): float, "departamento": string, "gasto" (expense description): string }
ingresos Revenue {"monto" (dollar amount): float, "departamento": string, "ingreso" (revenue description): string })
deudas Public debt {"monto" (dollar amount): float, "departamento": string, "deuda" (debt description): string }
departamentos Municipal departments Dictionary of departments: { {'departamento': string, 'id': int, 'palabra clave' (keyword): string}, ... }

You can also choose to receive only one of these keys:

presupuestospr.com/api/<municipality>/ingresos # Returns revenue only
presupuestospr.com/api/<municipality>/gastos # Returns expenses only
presupuestospr.com/api/<municipality>/departamentos # Returns departments only

# Note: filtering for debt unavaiable as of 10-30-2020

You can also receive a department's specific expenses by using the following route:

# Replace <municipality> with a municipality and <departamentos> with a department name
presupuestospr.com/api/<municipality>/<departament>

Don't know your municipalities or city departments? Use the following endpoints:

presupuestospr.com/api/municipios   # Returns list of ALL municipalities
presupuestospr.com/api/departamentos # Returns list of ALL departments

presupuestospr's People

Contributors

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