Skip to main content

Internet traffic generator.

Project description

Python >= 3.9

fake_traffic

Internet traffic generator. Utilizes real-time google search trends by specified parameters.


Install

pip install -U fake_traffic

Install chromium browser with dependencies

playwright install --with-deps chromium

CLI version

fake_traffic -h

CLI examples:

# user located in Austria, who speaks German, using comma separated keywords.
fake_traffic -c at -l de-at -k "Olympiade, Medaille, Beste Leistung"
# user located in Turkey, who speaks Kurdish, using google trends.
fake_traffic -c tr -l ku-tr
# save logs into 'fake_traffic.log'
fake_traffic -c ru -l ru-ru -lf
# use none-headless mode
fake_traffic -c en -l en-us -nh
# limit the number of tabs in the browser to 2
fake_traffic -c en -l en-us -t 2
# add an random delay (30-120 seconds) between requests
fake_traffic -c en -l en-us -t 1 -dmin 30 -dmax 120

Simple usage

from fake_traffic import FakeTraffic

FakeTraffic(country="US", language="en-US").crawl()

Advanced usage

from fake_traffic import FakeTraffic

ft = FakeTraffic(country="US", language="en-US", category="h", headless=True)
    """Internet traffic generator. Utilizes real-time google search trends by specified parameters.
    country (str): Country code ISO 3166-1 Alpha-2 code (https://www.iso.org/obp/ui/), Defaults to "US".
    language (str): Country-language code ISO-639 and ISO-3166 (https://www.fincher.org/Utilities/CountryLanguageList.shtml). Defaults to "en-US".
    keywords (str | None): Comma separated queries for Google searches. If not specified, Google trending is used. Defaults to None.
    headless (bool): Whether to run the browser in headless mode. Defaults to True.
    tabs (int): Limit the number of tabs in browser. Defaults to 3.
    delay_min (float | None): Minimum delay between requests in seconds. Defaults to None.
    delay_max (float | None): Maximum delay between requests in seconds. Defaults to None.
    """

ft.crawl()

Example

Using realtime search trends of a user located in Turkey, who speaks Kurdish

Find Turkey country code (ISO 3166-1 Alpha-2 code):

  • country = "TR"

Find Turkey country-language code (ISO-639 and ISO-3166):

  • english "en-TR",
  • kurdish "ku-TR",
  • turkish "tr-TR".

Starting in none-headless mode:

  • headless=False
from fake_traffic import FakeTraffic

ft = FakeTraffic(country="TR", language="ku-TR", keywords=None, headless=False)
ft.crawl()

P.S. you can select language from other country. For example, such combinations are also correct:

FakeTraffic(country="TR", language="ar-TR").crawl()
FakeTraffic(country="US", language="he-IL").crawl()
FakeTraffic(country="DE", language="hi-IN").crawl()

Other examples

Country Language Function
France French FakeTraffic(country="FR", language="fr-FR")
Germany German FakeTraffic(country="DE", language="de-DE", keywords="Audi")
India English FakeTraffic(country="IN", language="en-IN")
India Hindi FakeTraffic(country="IN", language="hi-IN")
Russia English FakeTraffic(country="RU", language="en-US", headless=False)
Russia Russian FakeTraffic(country="RU", language="ru-RU")
Brazil Portuguese FakeTraffic(country="BR", language="pt-BR")
United Kingdom English FakeTraffic(country="GB", language="en-GB")
United States English FakeTraffic(country="US", language="en-US", tabs=4)
United States Hebrew Israel FakeTraffic(country="US", language="he-IL")

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

fake_traffic-3.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

fake_traffic-3.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file fake_traffic-3.2.tar.gz.

File metadata

  • Download URL: fake_traffic-3.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for fake_traffic-3.2.tar.gz
Algorithm Hash digest
SHA256 39672c1976bbe5b555deae301e98a1a4b10a32d2a14619d823607a08594d9b32
MD5 71008482055b8300e7738f11e2b6eccc
BLAKE2b-256 25a824ab0e7b1f60d6e390d3b62fbda08fe3def92dd4d313e49fb33391e154d7

See more details on using hashes here.

File details

Details for the file fake_traffic-3.2-py3-none-any.whl.

File metadata

  • Download URL: fake_traffic-3.2-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for fake_traffic-3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6af9165b77d6ae8dd38b7059d27611b4d34bb1bb4a034fb1146cc75b28b449a8
MD5 3055542a444c6da0e5f816f9181ca412
BLAKE2b-256 1e3296b59e24474fef33852a55a790e6692e1065b81dfde5c1a48f65225d4e44

See more details on using hashes here.

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