A package to receive full-range daily Google Trends data
Project description
✨ DailyTrends V2 ✨
This lightweight API solves the problem of getting only monthly-based data for large time series when collecting Google Trends data. No login required. For unlimited requests, I will implement a Tor-based solution soon.
Installation
$ pip install DailyTrends
How to use
>>> from DailyTrends.collect import collect_data
# Get the data directly into python.
# The returned dataframe is already indexed and ready for storage/analysis.
>>> data = collect_data("AMD stock",
save=False, verbose=False)
>>> data.info()
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 5666 entries, 2004-01-01 to 2019-07-06
Freq: D
Data columns (total 1 columns):
AMD stock: (Worldwide) 5666 non-null float64
dtypes: float64(1)
memory usage: 88.5 KB
#Plotting some rolling means of the daily data
>>> ax=data.rolling(10).mean().plot();
data.rolling(25).mean().plot(ax=ax);
data.rolling(50).mean().plot(ax=ax)
Add your own data
# In this case the actual historic prices of the stock
>>> import pandas as pd
>>> price_data = pd.read_csv("price_data.csv")
>>> merged = pd.merge(price_data, data,
left_index=True, right_index=True)
>>> merged[["AMD stock: (Worldwide)", "Open"]].rolling(30).mean().plot()
Load multiple queries
>>> data = collect_data(["Intel", "AMD"],
save=False, verbose=False)
To-Do
- Add rescale capabilities
- Optimze multi-query search by combining it to a single request
- Add time range
- Add Tor-Network-based requests
- Add unique identifiers
- Add tqdm
- Prevent Null-Overlaps
Disclaimer
This API is not supported by Google and is for experimental purposes only.
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
DailyTrends-3.0.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for DailyTrends-3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92a4aa90946077d39918c0b3ca6d442c6752db7b3fe744f700fac7c0264fb5a1 |
|
MD5 | 797c6efaa02e3fd95533c348d63cc0a3 |
|
BLAKE2b-256 | 14700d912980b53be90474eb1dcb22b3dce74240e6ba3236ea921d6663370efd |