Coder Social home page Coder Social logo

ubicajeros-api's Introduction

Ubicajeros API

black

HTTP API for getting ATMs (Cajeros) available in Mexico. If gets the information from calls to the ubicajeros app from Banco de Mexico (BANXICO). There's a bunch of wrong lat/lon but those need to be reported in the BANXICO app and fixed from there.

Dependencies:

  • flask
  • pynamodb
  • zappa for serverless deployment

Installation

Docker

git clone https://github.com/ivansabik/ubicajeros-api.git
cd ubicajeros-api
source .venv/bin/activate
pip install -r requirements-deploy.txt
zappa deploy dev

In AWS using zappa

git clone https://github.com/ivansabik/ubicajeros-api.git
cd ubicajeros-api
zappa deploy

Manual

git clone https://github.com/ivansabik/ubicajeros-api.git
cd ubicajeros-api
virtualenv .venv #optional
source .venv/bin/activate #optional
pip install -r requirements.txt
python ubicajeros/api.py

To update the db:

python bin/update_db.py -h
usage: update_db.py [-h] [-r RADIUS] [-l LATLON]

Update db with Cajeros

optional arguments:
  -h, --help            show this help message and exit
  -r RADIUS, --radius RADIUS
                        Search radius (this is in km.)
  -l LATLON, --latlon LATLON
                        Latitude/Logitude separated by comma

You can run a demo client app at /cajeros.html

Endpoints

  • /cajeros
  • /cajero/ID_CAJERO

/cajero/J16621

{
  "address": "FRANCISCO_I_MADERO, 20, CENTRO, Cuauht\u00e9moc, Distrito Federal",
  "id": "A00044",
  "lat": 19.433838,
  "lon": -99.138858,
  "open_hours": "06:00-14:00",
  "org_code": 40042,
  "org_name": "MIFEL",
  "updated_at": "Sun, 16 Jul 2017 05:14:36 GMT",
  "zip_code": "6000"
}

/cajeros

{
  "cajeros": [
    {
      "address": "BOLIVAR No 38, 38, CENTRO, Venustiano Carranza, Distrito Federal",
      "id": "2775",
      "lat": 19.431813,
      "lon": -99.138561,
      "open_hours": "00:00-24:00",
      "org_code": 40012,
      "org_name": "BBVA BANCOMER",
      "updated_at": "Sun, 16 Jul 2017 05:14:36 GMT",
      "zip_code": "15000"
    },
    {
      "address": "Francisco I. Madero, No 6, Centro, Cuauht\u00e9moc, Distrito Federal",
      "id": "QMXS75",
      "lat": 19.434148,
      "lon": -99.138034,
      "open_hours": "08:00-22:00",
      "org_code": 40036,
      "org_name": "INBURSA",
      "updated_at": "Sun, 16 Jul 2017 05:14:36 GMT",
      "zip_code": "6500"
    }
  ]
}

/cajeros?estado=tabasco

Returns only values for this state

ubicajeros-api's People

Contributors

dependabot[bot] avatar ivansabik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ubicajeros-api's Issues

Zappatize!

Usar zappa para serverless con AWS, schedule actualizaciones, dynamodb o archivo JSON a s3 para persistencia

Handle zipped response

The API started returning a zipped response, currently module is broken until it handles that appropriately

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.