Skip to content

danyeaw/sharedstreets-python

 
 

Repository files navigation

SharedStreets (Python)

🚧WIP -- commits/comments welcome! 🚧

Python implementation of SharedStreets Reference System.

Install

  1. Install from PyPI with Pip.

    pip install sharedstreets
    
  2. Try downloading a single tile to GeoJSON.

    sharedstreets-get-tile 16 10509 25324 > 16-10509-25324.geojson
    

Use

  • Retrieve a tile and convert to GeoJSON in Python.

    import sharedstreets.tile
    tile = sharedstreets.tile.get_tile(16, 10508, 25324)
    geojson = sharedstreets.tile.make_geojson(tile)
    
  • Run a debug webserver and request a tile at /tile/16/10508/25324.geojson.

    sharedstreets-debug-webapp
    
  • Run a production webserver under Gunicorn.

    gunicorn sharedstreets.webapp:app
    

Develop

Install for local development.

  1. Clone the SharedStreets-Python git repository and prepare a Python virtual environment running Python 3.

  2. Install the sharedstreets module, keeping it editable, and run test suite.

    pip install --editable .
    python setup.py test
    

Protobufs

Current .proto files can can be found at sharedstreets/sharedstreets-ref-system.

Install protoc and follow Python directions to regenerate sharedstreets/sharedstreets_pb2.py if necessary:

protoc -I=sharedstreets-ref-system/proto/ \
    --python_out=sharedstreets/ \
    sharedstreets-ref-system/proto/sharedstreets.proto

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%