GithubHelp home page GithubHelp logo

ode's Introduction

ode

This is a demo Flask app showcasing an API that returns GeoJSON from attribute and simple spatial queries. It works on both Python 2 and 3.

If I have more time, I'll probably:

  • add some functionality to limit the size of returned requests, or add pagination.
  • add more spatial functionality, like filtering listing requests by custom AOI polygons.
  • add more tests for 100% test coverage.
  • add more backend scripts, and enhance the existing import_listings.py.

Prerequisites

ode uses PostgreSQL/PostGIS as its backend, so it's important to have that installed on the system. Configuration is pretty minimal. For demo and testing purposes, I use the postgres user and create a database called listings.

Installation

From source:

$ ./setup.py install

setup.py should fetch all required Python dependencies, which are specified in requirements.txt:

Flask==0.10.1
GeoAlchemy2==0.2.5
itsdangerous==0.24
Jinja2==2.8
MarkupSafe==0.23
psycopg2==2.6.1
SQLAlchemy==1.0.8
Werkzeug==0.10.4

Scripts

usage: import_listings.py [-h] [--engine_url ENGINE_URL] [--append] csv

This script imports listing information from a csv file and inserts the data
into a spatially-enabled listings table within a PostgreSQL database.

positional arguments:
  csv                   path to the listing csv file

optional arguments:
  -h, --help            show this help message and exit
  --engine_url ENGINE_URL
                        string that indicates database dialect and connection
                        arguments
  --append              append listing data to an existing table

Directory tree

.
|-- ez_setup.py
|-- ode
|   |-- data
|   |   `-- listings.csv
|   |-- __init__.py
|   `-- models.py
|-- README.rst
|-- requirements.txt
|-- scripts
|   `-- import_listings.py
|-- setup.py
`-- tests
    `-- test_get_request.py

ode's People

Contributors

allanadair avatar

Watchers

 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.