Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylatesttrends-0.1.2.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylatesttrends-0.1.2-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

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

Hashes for pylatesttrends-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1ec23ed35ad5deec8c06e5819edc47b8a19c068b67454d4682959119451220a1
MD5 73f6c4dc3242e02aee46f5773a404f6c
BLAKE2b-256 d6106f195017b1774d70226bb626d02b06d9d8939d5e891234b0a8db1a4a91c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylatesttrends-0.1.2.tar.gz:

Publisher: publish.yml on faraasat/pylatesttrends

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pylatesttrends-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a30bd130d5629bc11d16ada417a402332628d9a7609684c0df84217d740cb055
MD5 a14c67ad427479a0db118cc7603a537c
BLAKE2b-256 0540c5be014d68676d3d1dbf3779c97d53dc1e79f171f2ccf42de2d2b4cca07a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pylatesttrends-0.1.2-py3-none-any.whl:

Publisher: publish.yml on faraasat/pylatesttrends

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page