Skip to main content

A command-line application for scoring US cities and towns.

Project description

City Score

City Score is a command-line application for scoring cities based on your personal preferences. Here's an example:

City Population Zillow® ZHVI PeopleForBikes Yelp "gay bars" Nearby ski resorts Score
Portland, OR 647,176 $547,999 56 9 Mount Hood Ski Bowl (42 miles) and 2 more 100
Detroit, MI 645,658 $64,414 42 7 Mt Brighton, MI (41 miles) and 1 more 86
Cambridge, MA 116,892 $959,032 58 6 Wachusett Mountain (40 miles) and 5 more 84

Technologies

  • Python 3

Features

  • Ranks all 29,880 cities and towns in the United States
  • Includes multiple built-in data providers
  • Designed to allow users to easily add and remix data
  • Outputs prettified to the console or to CSV, HTML, JSON, JSONL

Design

City Score uses a three-step process:

  1. Qualification: criteria identify cities that meet your minimum standard.
  2. Scoring: scorers score facets of your choosing at various weights.
  3. Generation: dimensions appear in the final output.

Quick start

  1. Download City Score from PyPI:
    $ python3 -m pip install city_score
    
  2. Create a script (myscore.py) like this:
    from city_score import run
    from city_score.sources.core import *
    from city_score.sources.peopleforbikes import *
    from city_score.sources.zillow import *
    
    sources = (
        PeopleForBikes,
        Zillow,
    )
    
    criteria = (
        minimum_bike_score(25),
        minimum_population(60000),
        maximum_median_home_price(1000000),
        prohibited_states(('TX', 'FL', 'CO', )),
    )
    
    scorers = (
        median_home_price_scorer(lower=350000, upper=800000),
        bike_score_scorer(lower=40, upper=80, weight=2),
    )
    
    dimensions = (
        population,
        median_home_price,
        median_rent,
        bike_score,
    )
    
    run(sources, criteria, scorers, dimensions)
    
  3. Run your script:
    $ python3 myscore.py --sort=score --scale-scores
    

Data sources

  • 🚲 PeopleForBikes provides a score for biking infrastructure.
  • 🏂 Snowpak provides the name and location of most ski resorts.
  • 🏃🏻 TrailLink provides the number of nearby trail miles.
  • 🍕 Yelp provides data on many points of interest, including businesses.
  • 🏡 Zillow provides estimates for home and rent prices.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

city_score-0.2.0.tar.gz (12.5 kB view hashes)

Uploaded Source

Built Distribution

city_score-0.2.0-py3-none-any.whl (15.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page