Metadata-Version: 2.4
Name: trendspull
Version: 0.1.0
Summary: Collect Google Trends timelines as a tidy pandas DataFrame
Author-email: "Maxwell A. Konnaris" <maxwellkonnaris@gmail.com>
License-Expression: MIT
Project-URL: Repository, https://github.com/maxwellkonnaris/googletrends
Project-URL: Issues, https://github.com/maxwellkonnaris/googletrends/issues
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28
Requires-Dist: pandas>=1.5
Provides-Extra: plot
Requires-Dist: matplotlib>=3.8; extra == "plot"
Provides-Extra: test
Requires-Dist: pytest<10,>=7; extra == "test"
Requires-Dist: matplotlib>=3.8; extra == "test"
Dynamic: license-file

# trendspull

Collect Google Trends timelines as a pandas DataFrame. Up to five terms share
one Google comparison; larger sets use G-TAB calibration. Raw values, dates,
quality flags and request metadata are preserved.

```python
from trendspull import pull_trends, selected_proportions, plot_trends

data = pull_trends(
    ["wildfire", "smoke", "air quality", "asthma", "inhaler", "cough"],
    start="2021-01-01", end="2025-12-31", geo="US-CA",
)
proportions = selected_proportions(data)  # Terms × dates; each column sums to 1.
figure = plot_trends(data)  # Requires the optional plot extra.
```

Python 3.11+ is required. Install the plotting extra with
`python -m pip install 'trendspull[plot]'`.

Values measure relative search interest, not search counts. G-TAB's
`calibrated_value` uses the reference term's peak as 1; selected-term proportions
have a different denominator at each date. Plots use one common maximum across
all supplied terms and dates. Select one geography before using either helper.

Collection uses undocumented Google website endpoints, which can change or block
access. Offline tests do not establish live availability. See the
[README](https://github.com/maxwellkonnaris/googletrends#readme) and
[data contract](https://github.com/maxwellkonnaris/googletrends/blob/main/docs/data-contract.md)
for options, interpretation and limitations. A separate native R package is in
the same repository.

G-TAB calculation: West (2020), *Calibration of Google Trends Time Series*,
[doi:10.1145/3340531.3412075](https://doi.org/10.1145/3340531.3412075).

MIT license. Source and issues:
[github.com/maxwellkonnaris/googletrends](https://github.com/maxwellkonnaris/googletrends).
