DailyTrends-5.0
توضیحات
A package to receive full-range daily Google Trends data
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | DailyTrends-5.0 |
| نام | DailyTrends |
| نسخه کتابخانه | 5.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Leonard Vorbeck |
| ایمیل نویسنده | leomxyy@googlemail.com |
| آدرس صفحه اصلی | https://github.com/le0x99/DailyTrends/ |
| آدرس اینترنتی | https://pypi.org/project/DailyTrends/ |
| مجوز | - |
# ✨ DailyTrends 5.0 (final/stable) ✨
[](https://pepy.tech/project/dailytrends)
🚨 ALL BUGS FIXED🚨 - Update to version 5.0
- Fully operational after new versions of pandas broke the restructuring pipe.
- Google API change, so the code was adjusted (again).
- The timerange can now be specified approximately.
- The region (geo) can now be specified.
### Purpose
This lightweight API solves the problem of getting only monthly-based data for large time series when collecting Google Trends data. No login required.
### Installation
Install via PyPi:
```bash
$ pip install DailyTrends
```
### Usage
```python3
>>> from DailyTrends.collect import collect_data
```
Queries are submitted in a gentle manner, which can be slow (but safe) for very large series.
```python3
>>> data = collect_data("AMD stock",start="2004-01-01", end="2019-07-06",
geo="", save=False, verbose=False)
```
```python3
>>> 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
```
- The returned dataframe is already indexed and ready for storage/analysis.
- The end of the series defaults to "TODAY".
- The start of the series defaults to "2004-01-01".
- The geo parameter defaults to "", which yields global results.
```python
# 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
```python3
# In this case the 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
```python
>>> data = collect_data(["Intel", "AMD"],start="2004-01-01", end="TODAY",
geo="DE", save=False, verbose=False)
```
### To-Do
- Add Tor-Network-based requests
## **Disclaimer**
This API is *not* supported by Google and is for experimental purposes only.
نیازمندی
| مقدار | نام |
|---|---|
| >=0.24.2 | pandas |
| >=1.16.4 | numpy |
| >=2.22.0 | requests |
| >=4.35.0 | tqdm |
نحوه نصب
نصب پکیج whl DailyTrends-5.0:
pip install DailyTrends-5.0.whl
نصب پکیج tar.gz DailyTrends-5.0:
pip install DailyTrends-5.0.tar.gz