The WalkScore Library¶
(Unofficial) Python Bindings for the WalkScore API
Branch |
Unit Tests |
---|---|
The WalkScore Library is a Python library that provides Python bindings for the WalkScore API. It enables you to retrieve WalkScores, TransitScores, and BikeScores from the API within your Python code.
Warning
The WalkScore Library is completely unaffiliated with WalkScore. It is entirely unofficial and was developed based on publicly available documentation of the WalkScore APIs published to the WalkScore website. Use of WalkScore is subject to WalkScore’s licenses and terms of service, and this library is not endorsed by WalkScore or any affiliates thereof.
Contents
Installation¶
To install WalkScore, just execute:
$ pip install walkscore-api
Dependencies¶
Validator-Collection v1.3.0 or higher
Backoff-Utils v.1.0.0 or higher
Key WalkScore Features¶
Python representation of WalkScores, TransitScores, and BikeScores
Easy serialization and deserialization of API responses to Python objects,
dict
objects or JSONBuilt-in back-off/retry logic if the WalkScore API is unstable at any moment in time
Robust error handling to surface meaningful information to help you debug your code.
Hello, World and Basic Usage¶
1. Import the WalkScore API¶
from walkscore import WalkScoreAPI
2. Initialize the API¶
You can either use a single object to communicate with all of the available WalkScore APIs, or initialize a single object for each API:
api_key = 'YOUR API KEY GOES HERE'
score_api = WalkScoreAPI(api_key = api_key)
3. Retrieve a Score¶
address = '123 Anyplace St Anywhere, AK 12345'
result = score_api.get_score(longitude = 123.45, latitude = 54.321, address = address)
# the WalkScore for the location
result.walk_score
# the TransitScore for the location
result.transit_score
# the BikeScore for the location
result.bike_score
Questions and Issues¶
You can ask questions and report issues on the project’s Github Issues Page
Contributing¶
We welcome contributions and pull requests! For more information, please see the Contributor Guide
Testing¶
We use TravisCI for our build automation and ReadTheDocs for our documentation.
Detailed information about our test suite and how to run tests locally can be found in our Testing Reference.
License¶
WalkScore is made available under an MIT License.