Get the latest trends from Google Trends
Reason this release was yanked:
initial release with bugs
Project description
pylatesttrends
A Python package that scrapes Google Trends.
Installation
pip install pylatesttrends
Usage
You can pass mandatory geo which takes ISO country code to get the trends from google. Other parameters are optional but follow a proper structure which is give under the Examples headings. The result value will be the pandas dataframe.
from pylatesttrends import generate_payload, get_trends
payload = generate_payload("US")
result = get_trends(payload)
The get_trends also takes another optional argument which is a minimal logging that takes one of two values print or logging. When given print it prints logs using the native python print while logging uses the logging package.
result = get_trends(payload, "print")
Examples for Payload
1. Started Trending
payload = generate_payload("US", start_trending="48h")
Following values can be used:
4h, 24h, 48h, 7d,
2. Category
payload = generate_payload("US", category="Beauty and Fashion")
Following values can be used:
Autos and Vehicles, Beauty and Fashion, Business and Finance, Climate, Entertainment, Food and Drink, Games, Health, Hobbies and Leisure, Jobs and Education, Law and Government, Other, Pets and Animals, Politics, Science, Shopping, Sports, Technology, Travel and Transportation
3. Trend Status Active Trends
payload = generate_payload("US", trend_status_active_trends=False) # value can be boolean
4. Sort By
payload = generate_payload("US", sort_by="Beauty and Fashion")
Following values can be used:
title, search-volume, recency, relevance
5. Geo
payload = generate_payload(geo="US")
Following values can be used:
AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, CV, KH, CM, CA, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, SZ, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, KR, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MK, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW,
5. BaseUrl
Base Url can also be updated
payload = generate_payload(geo="US", base_url="https://")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylatesttrends-0.1.2.tar.gz.
File metadata
- Download URL: pylatesttrends-0.1.2.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ec23ed35ad5deec8c06e5819edc47b8a19c068b67454d4682959119451220a1
|
|
| MD5 |
73f6c4dc3242e02aee46f5773a404f6c
|
|
| BLAKE2b-256 |
d6106f195017b1774d70226bb626d02b06d9d8939d5e891234b0a8db1a4a91c5
|
Provenance
The following attestation bundles were made for pylatesttrends-0.1.2.tar.gz:
Publisher:
publish.yml on faraasat/pylatesttrends
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylatesttrends-0.1.2.tar.gz -
Subject digest:
1ec23ed35ad5deec8c06e5819edc47b8a19c068b67454d4682959119451220a1 - Sigstore transparency entry: 208121374
- Sigstore integration time:
-
Permalink:
faraasat/pylatesttrends@2894b584524e58f6ae3de2a464941da4158fdf66 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/faraasat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2894b584524e58f6ae3de2a464941da4158fdf66 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pylatesttrends-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pylatesttrends-0.1.2-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a30bd130d5629bc11d16ada417a402332628d9a7609684c0df84217d740cb055
|
|
| MD5 |
a14c67ad427479a0db118cc7603a537c
|
|
| BLAKE2b-256 |
0540c5be014d68676d3d1dbf3779c97d53dc1e79f171f2ccf42de2d2b4cca07a
|
Provenance
The following attestation bundles were made for pylatesttrends-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on faraasat/pylatesttrends
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylatesttrends-0.1.2-py3-none-any.whl -
Subject digest:
a30bd130d5629bc11d16ada417a402332628d9a7609684c0df84217d740cb055 - Sigstore transparency entry: 208121381
- Sigstore integration time:
-
Permalink:
faraasat/pylatesttrends@2894b584524e58f6ae3de2a464941da4158fdf66 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/faraasat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2894b584524e58f6ae3de2a464941da4158fdf66 -
Trigger Event:
push
-
Statement type: