Code Monkey home page Code Monkey logo

populartimes's People

Contributors

m-wrzr avatar mfkaptan avatar mpomeroy avatar ondronr avatar porter97 avatar riedmaph avatar sarmstr5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

populartimes's Issues

Fix current popularity

After updates to google.com/search the location of the current popularity field has changed.

Live information changed

Hello.

I think google has changed the position of the live information. I am trying to search the information in the endpoint that the module creates and makes a request but I think they don't response with the correct Live info anymore.

the past week, it seems like google was making changes to this system because it didn't work for some days.

Maybe the Protobuf is not valid anymore for the live information.

Someone an idea?

Thank you

Improve covering algorithm

The algorithm to fill the search area with circles for radar/nearby search (get_circle_centers) is suboptimal. Since the pricing for the Google Places API changes and the free quota will be reduced significantly, we should look into options to minimize the number of required requests.
I found an interesting discussion on this topic here (although this would neglect the curvature of the earth): https://stackoverflow.com/questions/7716460/fully-cover-a-rectangle-with-minimum-amount-of-fixed-radius-circles
A hexagonal (honeycomb) pattern for the circle centers seems to be a good solution (although not perfect for small search areas).

help for installing please

hi, Im really bad at this so Im stuck. I think i have everything set up. What do you mean with "run pip install" or "import populartimes" ?
My goal is to use the populartimes data for my Chatbot.

New places API pricing

How is populartimes data requests affected by the new Places API usage pricing?

From the document, it says that requesting place details + basic data costs $17 per 1k calls after the first 11k sessions. Is populartimes data considered as 'basic data'? However, when I read the pricing for basic data (link) it says the first 100,000 calls is free.

Hence in this case I'm not sure about

  1. Is populartimes data considered basic data? The page says places data can fall under basic, contact and atmosphere. Hence the type of data affects the billing.
  2. Fetching populartimes data is considered a session or call?
  3. Which billing category does using your package to get place details falls under?

Thanks!

'populartimes' is not defined

Hi,

everytime i'm trying to run your script i get the following error:
'populartimes' is not defined

what am i doing wrong?

Huge amount of requests being sent to Google?

When I'm trying to do a request for a small area there are thousands of requests being made to Google. For instance:

lat1 = 36.150182
long1 = -86.783909
lat2 = 36.152166
long2 = -86.779082

data = populartimes.get(apiKey,["bar"], (lat1, long1), (lat2, long2))
print(data)

I would expect a few calls since there should be at most 20 bars in that area. But in just a few minutes of trying I already hit the error: "You exceeded your Query Limit for Google Places API Web Service"

When I checked the Google console I had a 1000 requests. I upgraded my Google Account to the free limit of 150.000
But it looks like the request above makes at least 1000 requests? What am I doing wrong? Within minutes I suddenly already made 65,000 requests.
I do see correct data coming back, so it's working great. But I would like to just make the right amount of calls to Google to not create a huge bill.

Multiple types does not work.

If I key in multiple types, populartimes.get() will only return results of the first type. For example:
populartimes.get(api_key = API_KEY,
types = ['gym','bar'],
p1 = (l1, l2),
p2 = (l3, l4),
all_places=False)
This will only return places of type "gym", whereas
populartimes.get(api_key = API_KEY,
types = ['bar','gym'],
p1 = (l1, l2),
p2 = (l3, l4),
all_places=False)
This will only return places of type "bar". How do I use the codes to return all places as long as it has type of either "bar" or "gym"?

JSON parsing errors

Hi,

it appears Google sometimes return multiple response for a given place_identifier, in get_populartimes and get_current_popularity. Multiple entries are separated with /*""*/. It seems that only the first entry is relevant.

I encountered this problem with place_identifier = "'Osteria Amici Miei 信義區仁愛路四段502號之一, 信義區台北市 Taiwan 110'", but I can't consistently reproduce this behavior.

A fix is to patch the get_populartimes and get_current_popularity function when decoding the response:

data = resp.read().decode('utf-8').split('/*""*/')[0]

I'm happy to make a pull request, I do not know the API well enough to know if this is a satisfactory fix though.

UnicodeEncodeError: 'charmap' codec can't encode characters

Hello,

I tried running your example request and got the error mentioned above. Here is my entire test.py:

import populartimes

mylist = populartimes.get("api-key", ["bar"], (48.132986, 11.566126), (48.142199, 11.580047))
print(mylist);

Full output as follows:

$ py test.py
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    print(mylist);
  File "C:\Users\chris\AppData\Local\Programs\Python\Python35-32\lib\encodings\cp437.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 121875-121880: character maps to <undefined>

Not Working any more?

Don't know if I'm just stupid, but I just get an empty array for popular times, by searching it with ID's. example "düsseldorf main station" got popular times but the array in it is just empty.

How you shown current_popularity

How you shown current_popularity from following array, please tell me what is the current popularity filed,
from your python code and response we thought, 61 is current_popularity, is it right?
[12,61,"Usually busy","Up to 30 mins","12 PM"]

[[7,[[6,0,"","None","6 AM"],[7,0,"","None","7 AM"],[8,0,"","None","8 AM"],[9,8,"Usually busy","Up to 30 mins","9 AM"],[10,25,"Usually busy","Up to 30 mins","10 AM"],[11,46,"Usually busy","Up to 30 mins","11 AM"],[12,61,"Usually busy","Up to 30 mins","12 PM"],[13,60,"Usually busy","Up to 30 mins","1 PM"],[14,49,"Usually busy","Up to 30 mins","2 PM"],[15,40,"Usually busy","Up to 30 mins","3 PM"],[16,41,"Usually busy","Up to 30 mins","4 PM"],[17,46,"Usually busy","Up to 30 mins","5 PM"],[18,52,"Usually busy","Up to 30 mins","6 PM"],[19,53,"Usually busy","Up to 30 mins","7 PM"],[20,51,"Usually busy","Up to 30 mins","8 PM"],[21,44,"Usually busy","Up to 30 mins","9 PM"],[22,35,"Usually busy","Up to 30 mins","10 PM"],[23,25,"Usually not too busy","Up to 15 mins","11 PM"],[0,16,"Usually not too busy","Up to 15 mins","12 AM"],[1,9,"Usually not too busy","Up to 15 mins","1 AM"]],0,["Peak wait up to 30 mins from 5:00 PM–10:30 PM",[[16,23,[[5]]]]]],[1,[[6,0,"","None","6 AM"],[7,0,"","None","7 AM"],[8,0,"","None","8 AM"],[9,0,"","None","9 AM"],[10,0,"","None","10 AM"],[11,6,"Usually busy","Up to 30 mins","11 AM"],[12,14,"Usually not too busy","Up to 15 mins","12 PM"],[13,21,"Usually not too busy","Up to 15 mins","1 PM"],[14,20,"Usually not too busy","None","2 PM"],[15,17,"Usually not too busy","Up to 15 mins","3 PM"],[16,23,"Usually not too busy","Up to 15 mins","4 PM"],[17,40,"Usually not too busy","Up to 15 mins","5 PM"],[18,60,"Usually busy","Up to 30 mins","6 PM"],[19,71,"Usually busy","Up to 45 mins","7 PM"],[20,66,"Usually busy","Up to 45 mins","8 PM"],[21,54,"Usually busy","Up to 45 mins","9 PM"],[22,44,"Usually busy","Up to 30 mins","10 PM"],[23,37,"Usually busy","Up to 30 mins","11 PM"],[0,26,"Usually not too busy","Up to 15 mins","12 AM"],[1,13,"Usually not busy","None","1 AM"]],0,["Peak wait up to 45 mins from 7:30 PM–10:00 PM",[[16,23,[[5]]]]]],[2,[[6,0,"","None","6 AM"],[7,0,"","None","7 AM"],[8,0,"","None","8 AM"],[9,0,"","None","9 AM"],[10,0,"","None","10 AM"],[11,8,"Usually not too busy","Up to 15 mins","11 AM"],[12,12,"Usually not too busy","Up to 15 mins","12 PM"],[13,16,"Usually not busy","None","1 PM"],[14,17,"Usually not too busy","Up to 15 mins","2 PM"],[15,18,"Usually not too busy","Up to 15 mins","3 PM"],[16,23,"Usually not too busy","Up to 15 mins","4 PM"],[17,30,"Usually not too busy","Up to 15 mins","5 PM"],[18,39,"Usually not too busy","Up to 15 mins","6 PM"],[19,45,"Usually busy","Up to 30 mins","7 PM"],[20,45,"Usually busy","Up to 30 mins","8 PM"],[21,39,"Usually busy","Up to 30 mins","9 PM"],[22,29,"Usually not too busy","Up to 15 mins","10 PM"],[23,18,"Usually not too busy","Up to 15 mins","11 PM"],[0,10,"Usually not too busy","Up to 15 mins","12 AM"],[1,4,"Usually not too busy","Up to 15 mins","1 AM"]],0,["Peak wait up to 30 mins from 7:00 PM–10:00 PM",[[16,23,[[5]]]]]],[3,[[6,0,"","None","6 AM"],[7,0,"","None","7 AM"],[8,0,"","None","8 AM"],[9,0,"","None","9 AM"],[10,0,"","None","10 AM"],[11,6,"Usually not too busy","Up to 15 mins","11 AM"],[12,12,"Usually not busy","None","12 PM"],[13,16,"Usually not busy","None","1 PM"],[14,16,"Usually not too busy","Up to 15 mins","2 PM"],[15,15,"Usually not too busy","Up to 15 mins","3 PM"],[16,19,"Usually not too busy","Up to 15 mins","4 PM"],[17,33,"Usually not too busy","Up to 15 mins","5 PM"],[18,52,"Usually busy","Up to 30 mins","6 PM"],[19,62,"Usually busy","Up to 30 mins","7 PM"],[20,57,"Usually busy","Up to 45 mins","8 PM"],[21,44,"Usually busy","Up to 45 mins","9 PM"],[22,31,"Usually busy","Up to 30 mins","10 PM"],[23,21,"Usually not too busy","Up to 15 mins","11 PM"],[0,14,"Usually not busy","None","12 AM"],[1,7,"Usually not busy","Usually none","1 AM"]],0,["Peak wait up to 45 mins from 8:00 PM–9:30 PM",[[16,23,[[5]]]]]],[4,null,1,[""]],[5,[[0,19,"Usually not too busy","Up to 15 mins","12 AM"],[1,7,"Usually not busy","None","1 AM"],[2,0,"","None","2 AM"],[3,0,"","None","3 AM"],[4,0,"","None","4 AM"],[5,0,"","None","5 AM"],[6,0,"","None","6 AM"],[7,0,"","None","7 AM"],[8,0,"","None","8 AM"],[9,0,"","None","9 AM"],[10,0,"","None","10 AM"],[11,11,"Usually not too busy","Up to 15 mins","11 AM"],[12,21,"Usually not too busy","None","12 PM"],[13,27,"Usually not too busy","Up to 15 mins","1 PM"],[14,28,"Usually not too busy","Up to 15 mins","2 PM"],[15,28,"Usually not too busy","Up to 15 mins","3 PM"],[16,37,"Usually busy","Up to 30 mins","4 PM"],[17,59,"Usually busy","Up to 30 mins","5 PM"],[18,83,"Usually busy","Up to 1 hour","6 PM"],[19,98,"Usually busy","Up to 1 hour","7 PM"],[20,100,"Usually busy","Up to 1h 15m","8 PM"],[21,92,"Usually busy","Up to 1h 15m","9 PM"],[22,79,"Usually busy","Up to 1 hour","10 PM"],[23,60,"Usually busy","Up to 45 mins","11 PM"]],0,["Peak wait up to 1h 15m from 8:00 PM–10:00 PM",[[16,22,[[5]]]]]],[6,[[6,0,"","None","6 AM"],[7,0,"","None","7 AM"],[8,0,"","None","8 AM"],[9,6,"Usually busy","Up to 30 mins","9 AM"],[10,14,"Usually busy","Up to 30 mins","10 AM"],[11,24,"Usually not too busy","Up to 15 mins","11 AM"],[12,34,"Usually not too busy","Up to 15 mins","12 PM"],[13,40,"Usually not too busy","Up to 15 mins","1 PM"],[14,39,"Usually not too busy","Up to 15 mins","2 PM"],[15,37,"Usually not too busy","Up to 15 mins","3 PM"],[16,38,"Usually not too busy","Up to 15 mins","4 PM"],[17,46,"Usually busy","Up to 30 mins","5 PM"],[18,60,"Usually busy","Up to 45 mins","6 PM"],[19,74,"Usually busy","Up to 45 mins","7 PM"],[20,81,"Usually busy","Up to 1 hour","8 PM"],[21,77,"Usually busy","Up to 1 hour","9 PM"],[22,64,"Usually busy","Up to 45 mins","10 PM"],[23,45,"Usually busy","Up to 45 mins","11 PM"],[0,28,"Usually busy","Up to 30 mins","12 AM"],[1,14,"Usually not too busy","Up to 15 mins","1 AM"]],0,["Peak wait up to 1 hour from 8:30 PM–10:00 PM",[[16,22,[[5]]]]]]]

Problem with the basic example : populartimes.get(...)

Hello,
The example provided doesn't work. I have to stop the execution of the function
This error appears :
urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:645)>
I install pyOpenSSL, but i still have the issue.

Does populartimes.get() still work?

Following the example for populartimes.get(), the only thing I've gotten this to do is infinite loop in the console with coordinates until it surpasses the Google Places API quota.

How to cite

Hi, m-wrzr!
Many thanks for your great package.
Could you provide how to cite information of your populartimes package?
I will cite your package in our paper.

Best regards,
Mat

react-native

Is there a way to use this with react-native?

Radar search is deprecated

Radar search will be turned down on June 30, 2018. We should switch to the new Nearby Search or Text Search. The request looks quite similar, so it should be easy to change. It also returns more information about the places, so we probably can get rid of the additional detail search.
However, it will return far less results: 20 per request instead of 200 with radar search. Up to 60 places for a given location & radius can be obtained with repeated calls using a pagetoken (20 per page).
This means we have to reduce the search radius to obtain all results.

Frequency of current PopTime updates @ Google

This is more of a question, at most a lack of documentation, but I couldn't find it:

How often does current_popularity get updated on the Google Place? As in, how often, or when (is it at the whole hour?) should it be queried using the API?

Syntaxerror for unexpected word

Hey,

I cloned and installed it, however when I run the populartimes.get_id() it stops at the api key and gives out a syntaxerror for unexpected word.

How can I fix this? Is this common?

Module 'populartimes' has no attribute

I'm tryin the example and I keep geting the same error, no matter if I use populartimes.get, populartimes.get_id or populartimes.get_current.

Always getting the same error:

AttributeError: module 'populartimes' has no attribute 'get_id'

Someone could help with this?

Tutorial

Hello - I am extremely new to Python and crawler execution, so I am unsure of how to run this code. Would it be possible for you to record a brief video tutorial on:

  1. How to install the required software (if any) required to run your code
  2. How to properly place all of the code in a directory that can be accessed for running the code
  3. How to install the wheel file
  4. Where/how to run the the final file

I'm hoping this request isn't too difficult or time consuming!

Thank you!

GUI with Request

@m-wrzr , thank you for this. Populartimes is great for amateur business intelligence gathering. I'm using your tool as my base for learning Python. This is my first little bit of code for a GUI using the get.id function. I'm going to constantly update this and plan on doing the following:
Creating a drop-down menu to choose different requests
Converting returned JSON to CSV
Not submitting when user has not entered information
Much more

For now, I'd love for you to try out my get.id "program"

`from tkinter import *
from tkinter import Entry

import populartimes

def submit():
api_key = entry_1.get()
place_id = entry_2.get()
print(api_key)
print(place_id)
result = populartimes.get_id(api_key, place_id)
print(result)

root = Tk()

label_1 = Label(text="API Key")
label_2 = Label(text="Place ID")
entry_1 = Entry()
entry_2 = Entry()

label_1.grid(row=0)
label_2.grid(row=1)

entry_1.grid(row=0, column=1)
entry_2.grid(row=1, column=1)

button_1 = Button(text="Submit", command=submit)
button_1.grid()

root.mainloop()
`

populartimes.get_id() is not producing output as described

I used populartimes.get_id(" ","ChIJ979SFFKkJoYR_yaR-wY55bs") with the option show here. But when i execute the code I get the following response with additional parameters that I cannot copy and paste here. I am executing the code on a Windows machine in Anaconda environment. Could you please tell me what am I doing wrong ?

"!4m12!1m3!1d4005.9771522653964!2d-122.42072974863942!3d37.8077459796541!2m3!1f0!2f0!3f0!3m2!1i1125!2i976"
"!4f13.1!7i20!10b1!12m6!2m3!5m1!6e2!20e3!10b1!16b1!19m3!2m2!1i392!2i106!20m61!2m2!1i203!2i100!3m2!2i4!5b1"
"!6m6!1m2!1i86!2i86!1m2!1i408!2i200!7m46!1m3!1e1!2b0!3e3!1m3!1e2!2b1!3e2!1m3!1e2!2b0!3e3!1m3!1e3!2b0!3e3!"
"1m3!1e4!2b0!3e3!1m3!1e8!2b0!3e3!1m3!1e3!2b1!3e2!1m3!1e9!2b1!3e2!1m3!1e10!2b0!3e3!1m3!1e10!2b1!3e2!1m3!1e"
"10!2b0!3e4!2b1!4b1!9b0!22m6!1sa9fVWea_MsX8adX8j8AE%3A1!2zMWk6Mix0OjExODg3LGU6MSxwOmE5ZlZXZWFfTXNYOGFkWDh"
"qOEFFOjE!7e81!12e3!17sa9fVWea_MsX8adX8j8AE%3A564!18e15!24m15!2b1!5m4!2b1!3b1!5b1!6b1!10m1!8e3!17b1!24b1!"
"25b1!26b1!30m1!2b1!36b1!26m3!2m2!1i80!2i92!30m28!1m6!1m2!1i0!2i0!2m2!1i458!2i976!1m6!1m2!1i1075!2i0!2m2!"
"1i1125!2i976!1m6!1m2!1i0!2i0!2m2!1i1125!2i20!1m6!1m2!1i0!2i956!2m2!1i1125!2i976!37m1!1e81!42b1!47m0!49m1"
"!3b1"

Help with using the sccript.

Hi, I have been wanting to use something like this in my upcoming project but am unfamiliar with using python. It would be great if you could work with me for that.

Deprecation warning: Vincencty is deprecated

It seems geopy deprecated Vincencty and they propose using something else:

DeprecationWarning: Vincenty is deprecated and is going to be removed in geopy 2.0. 
Use `geopy.distance.geodesic` (or the default `geopy.distance.distance`) instead, 
which is more accurate and always converges.

Possibility to get current popular time

I'm using your library for getting the average popular times, but is it possible to get the current popular time of the place?

current

I tried to reverse engineer the response of google but didn't find a way to retrieve the current popular time.

populartimes.get does not work anymore, even with your example

populartimes.get function does not work anymore.

populartimes.get(API_KEY9, ["bar"], (48.132986, 11.566126), (48.142199, 11.580047))
Exception in thread Thread-41:
Traceback (most recent call last):
File "C:\Anaconda3\envs\spider\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "C:\Anaconda3\envs\spider\lib\threading.py", line 864, in run
self._target(*self._args, **self.kwargs)
File "C:\Anaconda3\envs\spider\lib\site-packages\populartimes\crawler.py", line 130, in worker_detail
get_detail(item)
File "C:\Anaconda3\envs\spider\lib\site-packages\populartimes\crawler.py", line 174, in get_detail
popularity, rating, rating_n = get_populartimes(searchterm)
File "C:\Anaconda3\envs\spider\lib\site-packages\populartimes\crawler.py", line 237, in get_populartimes
jdata = json.loads(data)["d"]
File "C:\Anaconda3\envs\spider\lib\json_init
.py", line 354, in loads
return _default_decoder.decode(s)
File "C:\Anaconda3\envs\spider\lib\json\decoder.py", line 342, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 10910 (char 10909)

Exception in thread Thread-32:
Traceback (most recent call last):
File "C:\Anaconda3\envs\spider\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "C:\Anaconda3\envs\spider\lib\threading.py", line 864, in run
self._target(*self._args, **self.kwargs)
File "C:\Anaconda3\envs\spider\lib\site-packages\populartimes\crawler.py", line 130, in worker_detail
get_detail(item)
File "C:\Anaconda3\envs\spider\lib\site-packages\populartimes\crawler.py", line 174, in get_detail
popularity, rating, rating_n = get_populartimes(searchterm)
File "C:\Anaconda3\envs\spider\lib\site-packages\populartimes\crawler.py", line 237, in get_populartimes
jdata = json.loads(data)["d"]
File "C:\Anaconda3\envs\spider\lib\json_init
.py", line 354, in loads
return _default_decoder.decode(s)
File "C:\Anaconda3\envs\spider\lib\json\decoder.py", line 342, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 25613 (char 25612)

Exception in thread Thread-46:
Traceback (most recent call last):
File "C:\Anaconda3\envs\spider\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "C:\Anaconda3\envs\spider\lib\threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "C:\Anaconda3\envs\spider\lib\site-packages\populartimes\crawler.py", line 130, in worker_detail
get_detail(item)
File "C:\Anaconda3\envs\spider\lib\site-packages\populartimes\crawler.py", line 199, in get_detail
_, _, , current_popularity = get_current_popularity(place_identifier)
File "C:\Anaconda3\envs\spider\lib\site-packages\populartimes\crawler.py", line 295, in get_current_popularity
jdata = json.loads(data)["d"]
File "C:\Anaconda3\envs\spider\lib\json_init
.py", line 354, in loads
return _default_decoder.decode(s)
File "C:\Anaconda3\envs\spider\lib\json\decoder.py", line 342, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 21583 (char 21582)

Strange because it worked 3 days ago (3rd April 2018).

populartimes.get_id() still works though

Handle NOT_FOUND Response when a place ID is retired

It is possible for PlaceIDs to be retired, and if you send a retired or old place ID it will currently crash if you don't handle the exception.

For instance ChIJC6oqSkyIqYkRi6X_yDbiKQk

TypeError: get_id() missing 1 required positional argument: 'place_id'
Traceback (most recent call last):
File "test.py", line 3, in
g = populartimes.get_id(API_KEY,"ChIJC6oqSkyIqYkRi6X_yDbiKQk")
File "/home/seanwohltman/florence/lib/python3.5/site-packages/populartimes/init.py", line 56, in get_id
return get_populartimes(api_key, place_id)
File "/home/seanwohltman/florence/lib/python3.5/site-packages/populartimes/crawler.py", line 374, in get_populartimes
check_response_code(resp)
File "/home/seanwohltman/florence/lib/python3.5/site-packages/populartimes/crawler.py", line 423, in check_response_code
"Unidentified error with the Places API, please check the response code")
populartimes.crawler.PopulartimesException: ('Google Places NOT_FOUND', 'Unidentified error with the Places API, please check the response code')

Install not working

Hello "m-wrzr",

I was just trying to start the download of the data.

I already donwloaded the repository and made a Google API. Now I ran the command you provide in your README.

https://imgur.com/a/CS9gD

Location Name

Is there a quick way to change the source code to pull based upon a location name rather than a location type?

No longer working

Even the most basic queries return this even using a new google account and API key

Traceback (most recent call last):

  File "C:\Python3\lib\site-packages\populartimes\__init__.py", line 56, in get_id
    return get_populartimes(api_key, place_id)
  File "C:\Python3\lib\site-packages\populartimes\crawler.py", line 374, in get_populartimes
    check_response_code(resp)
  File "C:\Python3\lib\site-packages\populartimes\crawler.py", line 413, in check_response_code
    "You exceeded your Query Limit for Google Places API Web Service, "
populartimes.crawler.PopulartimesException: ('Google Places OVER_QUERY_LIMIT', 'You exceeded your Query Limit for Google Places API Web Service, check https://developers.google.com/places/web-service/usage to upgrade your quota.')

Anyone worked this out?

Thanks

Information Downloaded is the same for every request

I tried using the following command with different inputs but I got the same result regardless of whatever input I provided. It always showed result for the same place in New York City. Am I doing something wrong or does anybody know what the problem is ?

populartimes.get(api_key, types, bound_lower, bound_upper, n_threads (opt), radius (opt), all_places (opt))

A little help :)

Hi, first of all thank you for such a good work. I have been trying to use it however i think I am doing something wrong because when I try to execute below code it looks forever (I have left it over night) and does not give a result. If you can take a look at tell me what I am doing wrong I would be glad. Also I have one more question when we execute populartimes.get how many request are made?

bound_lower = (40.702195412680979, -73.94647996722307)
bound_upper = (40.705036825361958, -73.94273259403137)
result = populartimes.get(api_key, "cafe", bound_lower, bound_upper, False)

A more graceful result for a failed request.

I use populartimes.getid() and periodically pull the populartimes data using a list of place_ids I have saved. At times, a place_id may get depreciated. This will cause a problem because as long as either the API KEY or the place id cannot be recognized by google, the API call will breakdown and the following error msg printed:
ERROR:root:The query string is malformed, check params.json if your formatting for lat/lng and radius is correct.
Kernel died, restarting

Reproducible example:
populartimes.get_id(API_KEY1,"hoho")

Is there a way to make the function fail more gracefully? For example, just output an empty list?

do not work for all populartimes

Thank you for this module. Very cool!
But when can't get popularity from all shops and malls
In google maps i can see graphics of the popularity, but can't get it. What's wrong?

Regarding current_popularity field

Hello, first of all, thanks for the API. When I use populartimes.get_current("API-Key", "Place_ID"), one of the fields returned is current_popularity. I was wondering if there is any guide to what the returned numbers actually mean. I did a call "populartimes.get_current("MY_API_KEY", "ChIJQV94FwYZqwcR3p4mqAgqg-8") and it returned 25 for the field current_popularity. First of all, this is live data, correct? Second, how is it possible to translate this number to know how busy it actually is or not in the establishment? Thanks so much for the help and I apologize if this was a "stupid" question.

Simplified function to reduce work

Hello, first thanks for this amazing feature! It's really, really useful since it sounds like Big G doesn't want to share PopTimes with us via API. I was wondering if it would be possible to add a simplified function to this repo, for cases in which you only need PopTimes for one place and you already have place ID. It could be something like populartimes.IDget(api_key, ID). It would save time by reducing the amount of code to be executed with many benefits. I'm not familiar enough with Python, but I think that it wouldn't be hard to add it, since it should use only a part of what's already there. Thanks again.

How to change crawler.py

Hello - I am trying to change some stuff on my own in crawler.py, but when I do the changes are not reflected in my results. Is there something I need to do to make those edits fill into my running code. Basically, I'm trying to make current popularity unavailable = -1 as it was in the prior version, but when I turn this code:

try:
    # get info from result array, has to be adapted if backend api changes
    info = jdata[0][1][0][14]
    return info[84][7][1]

# ignore, there is either no info available or no popular times
# TypeError: rating/rating_n/populartimes in None
# IndexError: info is not available
except (TypeError, IndexError):
    return None

into this code:

try:
    # get info from result array, has to be adapted if backend api changes
    info = jdata[0][1][0][14]
    return info[84][7][1]

# ignore, there is either no info available or no popular times
# TypeError: rating/rating_n/populartimes in None
# IndexError: info is not available
except (TypeError, IndexError):
    return -1

it still returns none and has no "current_popularity" in the json object.

populartimes values

I can't find information on this but what exactly are 'populartimes' values? More importantly, is this normalized for all Places?

License?

Is there any sort of MIT or GNU licensing on this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.