dotlas

Dotlas Python Package


Keywords
boundaries, census-data, python, rest-api, restaurants-listings
License
MIT
Install
pip install dotlas==1.0.4

Documentation

Dotlas Python Client

The Dotlas REST API enables you to:

    Integrate data & insights with your own web or mobile apps 📲

    Consume information that supplements in-house data analysis and visualization 📊

    Enhance the functionality of your tech stack 🖥

    Leverage alternative data in your data pipeline 🏗

License Python version

WebsiteAPI DocumentationEmailLinkedIn

Setup

Pip

To install Dotlas from PyPi run the following command:

$ pip install dotlas

Local

To setup dotlas from GitHub:

Usage

Basic Calls

import dotlas

dot = dotlas.App(api_key="<YOUR API KEY>")

cities = dot.list_cities()
houston_city_stats = dot.city_stats(city="Houston")

restaurants_near_empire_state_bldg = dot.nearby_competition(
    latitude=40.74861114520377,
    longitude=-73.98560002111566,
    city="New York",
    commercial_type="Restaurant",
)

esb_insights = restaurants_near_empire_state_bldg.response.insights
esb_data = restaurants_near_empire_state_bldg.response.data

Mapping

pip install folium if you don't have it already. MAPBOX_ACCESS_TOKEN can be obtained from mapbox.com

import folium
MAPBOX_MAP: str = "https://api.mapbox.com/styles/v1/mapbox/light-v10/tiles/{z}/{x}/{y}?access_token={MAPBOX_ACCESS_TOKEN}"


empire_state_building_profile = dot.sales_territory(
    latitude=40.74861114520377,
    longitude=-73.98560002111566,
    city="New York",
    time_minutes=10,
    mode_of_mobility="driving"
)

folMap: folium.Map = folium.Map(
    location=[
        empire_state_building_stats.request.latitude, 
        empire_state_building_stats.request.longitude, 
    ],
    tiles=MAPBOX_MAP,
    attr='mapbox',
    zoom_start=12
)

folium.GeoJson(
    empire_state_building_stats.response.geometry.dict()
).add_to(folMap)