Skip to content

dotlas/api-client-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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 Code style: black Maintainability Codacy Badge Github Issues

Website β€’ API Documentation β€’ Email β€’ LinkedIn

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)

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages