fake-traffic


Namefake-traffic JSON
Version 3.0 PyPI version JSON
download
home_pageNone
SummaryInternet traffic generator.
upload_time2024-09-17 11:02:39
maintainerNone
docs_urlNone
authordeedy5
requires_python>=3.8
licenseMIT License
keywords python traffic generator fake traffic
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Python >= 3.8](https://img.shields.io/badge/python->=3.8-red.svg)](https://www.python.org/downloads/) [![](https://badgen.net/github/release/deedy5/fake_traffic)](https://github.com/deedy5/fake_traffic/releases) [![](https://badge.fury.io/py/fake-traffic.svg)](https://pypi.org/project/fake-traffic) 
# fake_traffic
Internet traffic generator. Utilizes real-time google search trends by specified parameters.

---
### Install

```python3
pip install -U fake_traffic
```
Install chromium browser with dependencies
```python3
playwright install --with-deps chromium
```

---
### CLI version
```python3
fake_traffic -h
```
CLI examples:
```python3
# user located in Austria, who speaks German and raves about the Austro-Hungarian Empire.
fake_traffic -c at -l de-at -k 'Österreich-Ungarn, Jugend, inspirieren, Nationalismus, Zwietracht, Ressourcen, Bandera, Zhiznevsky, Lukaschenko, Putin'
# user located in German, who speaks German and enjoys life.
fake_traffic -c de -l de-de -k 'Dresden, Gott, Wiederherstellung, Industrie, Geschenk, deutsche Wiedervereinigung, Erinnerung, Dekarbonisierung'
# user located in USA, who speaks English and spreads democracy.
fake_traffic -c us -l en-us -k 'Harassment, Escape, Sea, Liberty, Gun, Aid, Misunderstanding, Confusion, Grave, Danger, China'
# user located in Russia, who speaks Russian and lives well.
fake_traffic -c ru -l ru-ru -k 'Абырвалг, Стучать, Откосить, Выродок, 2+2=, По головам, Карьера, Отжать, Обмануть, Докажи, Купить, Откат, Взятка'
# user located in Ukraine, who speaks Russian and has a clear mind.
fake_traffic -c ua -l ru-ua -k 'Заблуждение, Жертва, Деиндустриализация, Война, Экспорт ресурсов, Рынок сбыта, Аналитик'
# user located in Turkey, who speaks Kurdish and don't know what to look for (using google trends).
fake_traffic -c tr -l ku-tr

# save logs into 'fake_traffic.log'
fake_traffic -c ru -l ru-ru -ca s -lf
# use none-headless mode
fake_traffic -c en -l en-us -ca t -nh
# limit the number of tabs in the browser to 2 
fake_traffic -c en -l en-us -ca t -t 2
```
---
### Simple usage
```python3
from fake_traffic import FakeTraffic

FakeTraffic(country="US", language="en-US").crawl()
```
---
### Advanced usage
```python3
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 = country code ISO 3166-1 Alpha-2 code (https://www.iso.org/obp/ui/),
    language = country-language code ISO-639 and ISO-3166 (https://www.fincher.org/Utilities/CountryLanguageList.shtml),
    keywords = comma separated queries for Google searches, if not specified, Google trending is used,
    headless = True/False (defaults to True);
    tabs = limit the number of tabs in browser (defaults to 3).
    """
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](https://www.iso.org/obp/ui/)):</br>
  - country = "TR" </br>

Find Turkey country-language code ([ISO-639 and ISO-3166](https://www.fincher.org/Utilities/CountryLanguageList.shtml)): </br>
  - english  "en-TR", </br>
  - kurdish  "ku-TR", </br>
  - turkish  "tr-TR". </br>

Starting in none-headless mode:
  - headless=False
```python3
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:
```python3
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")` |


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "fake-traffic",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "python, traffic generator, fake traffic",
    "author": "deedy5",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/06/13/6487d64234a93e6d18fc27983ad51b63a71082be50b9567c2d9d5a06667a/fake_traffic-3.0.tar.gz",
    "platform": null,
    "description": "[![Python >= 3.8](https://img.shields.io/badge/python->=3.8-red.svg)](https://www.python.org/downloads/) [![](https://badgen.net/github/release/deedy5/fake_traffic)](https://github.com/deedy5/fake_traffic/releases) [![](https://badge.fury.io/py/fake-traffic.svg)](https://pypi.org/project/fake-traffic) \n# fake_traffic\nInternet traffic generator. Utilizes real-time google search trends by specified parameters.\n\n---\n### Install\n\n```python3\npip install -U fake_traffic\n```\nInstall chromium browser with dependencies\n```python3\nplaywright install --with-deps chromium\n```\n\n---\n### CLI version\n```python3\nfake_traffic -h\n```\nCLI examples:\n```python3\n# user located in Austria, who speaks German and raves about the Austro-Hungarian Empire.\nfake_traffic -c at -l de-at -k '\u00d6sterreich-Ungarn, Jugend, inspirieren, Nationalismus, Zwietracht, Ressourcen, Bandera, Zhiznevsky, Lukaschenko, Putin'\n# user located in German, who speaks German and enjoys life.\nfake_traffic -c de -l de-de -k 'Dresden, Gott, Wiederherstellung, Industrie, Geschenk, deutsche Wiedervereinigung, Erinnerung, Dekarbonisierung'\n# user located in USA, who speaks English and spreads democracy.\nfake_traffic -c us -l en-us -k 'Harassment, Escape, Sea, Liberty, Gun, Aid, Misunderstanding, Confusion, Grave, Danger, China'\n# user located in Russia, who speaks Russian and lives well.\nfake_traffic -c ru -l ru-ru -k '\u0410\u0431\u044b\u0440\u0432\u0430\u043b\u0433, \u0421\u0442\u0443\u0447\u0430\u0442\u044c, \u041e\u0442\u043a\u043e\u0441\u0438\u0442\u044c, \u0412\u044b\u0440\u043e\u0434\u043e\u043a, 2+2=, \u041f\u043e \u0433\u043e\u043b\u043e\u0432\u0430\u043c, \u041a\u0430\u0440\u044c\u0435\u0440\u0430, \u041e\u0442\u0436\u0430\u0442\u044c, \u041e\u0431\u043c\u0430\u043d\u0443\u0442\u044c, \u0414\u043e\u043a\u0430\u0436\u0438, \u041a\u0443\u043f\u0438\u0442\u044c, \u041e\u0442\u043a\u0430\u0442, \u0412\u0437\u044f\u0442\u043a\u0430'\n# user located in Ukraine, who speaks Russian and has a clear mind.\nfake_traffic -c ua -l ru-ua -k '\u0417\u0430\u0431\u043b\u0443\u0436\u0434\u0435\u043d\u0438\u0435, \u0416\u0435\u0440\u0442\u0432\u0430, \u0414\u0435\u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0412\u043e\u0439\u043d\u0430, \u042d\u043a\u0441\u043f\u043e\u0440\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0420\u044b\u043d\u043e\u043a \u0441\u0431\u044b\u0442\u0430, \u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a'\n# user located in Turkey, who speaks Kurdish and don't know what to look for (using google trends).\nfake_traffic -c tr -l ku-tr\n\n# save logs into 'fake_traffic.log'\nfake_traffic -c ru -l ru-ru -ca s -lf\n# use none-headless mode\nfake_traffic -c en -l en-us -ca t -nh\n# limit the number of tabs in the browser to 2 \nfake_traffic -c en -l en-us -ca t -t 2\n```\n---\n### Simple usage\n```python3\nfrom fake_traffic import FakeTraffic\n\nFakeTraffic(country=\"US\", language=\"en-US\").crawl()\n```\n---\n### Advanced usage\n```python3\nfrom fake_traffic import FakeTraffic\n\nft = FakeTraffic(country=\"US\", language=\"en-US\", category=\"h\", headless=True)\n    \"\"\"Internet traffic generator. Utilizes real-time google search trends by specified parameters.\n    country = country code ISO 3166-1 Alpha-2 code (https://www.iso.org/obp/ui/),\n    language = country-language code ISO-639 and ISO-3166 (https://www.fincher.org/Utilities/CountryLanguageList.shtml),\n    keywords = comma separated queries for Google searches, if not specified, Google trending is used,\n    headless = True/False (defaults to True);\n    tabs = limit the number of tabs in browser (defaults to 3).\n    \"\"\"\nft.crawl()\n```\n---\n### Example\nUsing realtime search trends of a user located in Turkey, who speaks Kurdish\n\nFind Turkey country code ([ISO 3166-1 Alpha-2 code](https://www.iso.org/obp/ui/)):</br>\n  - country = \"TR\" </br>\n\nFind Turkey country-language code ([ISO-639 and ISO-3166](https://www.fincher.org/Utilities/CountryLanguageList.shtml)): </br>\n  - english  \"en-TR\", </br>\n  - kurdish  \"ku-TR\", </br>\n  - turkish  \"tr-TR\". </br>\n\nStarting in none-headless mode:\n  - headless=False\n```python3\nfrom fake_traffic import FakeTraffic\n\nft = FakeTraffic(country=\"TR\", language=\"ku-TR\", keywords=None, headless=False)\nft.crawl()\n```\nP.S. you can select language from other country. \nFor example, such combinations are also correct:\n```python3\nFakeTraffic(country=\"TR\", language=\"ar-TR\").crawl()\nFakeTraffic(country=\"US\", language=\"he-IL\").crawl()\nFakeTraffic(country=\"DE\", language=\"hi-IN\").crawl()\n```\n---\n### Other examples\nCountry   | Language  | Function                                     |\n----------|---------- | ---------------------------------------------|\nFrance    | French    | `FakeTraffic(country=\"FR\", language=\"fr-FR\")` |\nGermany   | German    | `FakeTraffic(country=\"DE\", language=\"de-DE\", keywords=\"Audi\")` |\nIndia     | English   | `FakeTraffic(country=\"IN\", language=\"en-IN\")` |\nIndia     | Hindi     | `FakeTraffic(country=\"IN\", language=\"hi-IN\")` |\nRussia    | English   | `FakeTraffic(country=\"RU\", language=\"en-US\", headless=False)` |\nRussia    | Russian   | `FakeTraffic(country=\"RU\", language=\"ru-RU\")` |\nBrazil | Portuguese | `FakeTraffic(country=\"BR\", language=\"pt-BR\")` |\nUnited Kingdom | English   | `FakeTraffic(country=\"GB\", language=\"en-GB\")` |\nUnited States  | English   | `FakeTraffic(country=\"US\", language=\"en-US\", tabs=4)` |\nUnited States  | Hebrew Israel   | `FakeTraffic(country=\"US\", language=\"he-IL\")` |\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Internet traffic generator.",
    "version": "3.0",
    "project_urls": {
        "Homepage": "https://github.com/deedy5/fake_traffic"
    },
    "split_keywords": [
        "python",
        " traffic generator",
        " fake traffic"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c5e0221203ba6e847615325f69aa0e7f062bd958d22f1cb86e22ff7504a79e9d",
                "md5": "73b608da53cadfb486c84635f71acee7",
                "sha256": "cdab8205c3dc90a06a1bb1ff9796b1d05c4afce885d5e05b8996a0f574b118e9"
            },
            "downloads": -1,
            "filename": "fake_traffic-3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "73b608da53cadfb486c84635f71acee7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7495,
            "upload_time": "2024-09-17T11:02:37",
            "upload_time_iso_8601": "2024-09-17T11:02:37.806992Z",
            "url": "https://files.pythonhosted.org/packages/c5/e0/221203ba6e847615325f69aa0e7f062bd958d22f1cb86e22ff7504a79e9d/fake_traffic-3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "06136487d64234a93e6d18fc27983ad51b63a71082be50b9567c2d9d5a06667a",
                "md5": "b134f074b33905efa6a948e162636093",
                "sha256": "4696ee918a8225be0f4563f7dc026cd096137f68bb76f8648529feaee97bcb32"
            },
            "downloads": -1,
            "filename": "fake_traffic-3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "b134f074b33905efa6a948e162636093",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 6257,
            "upload_time": "2024-09-17T11:02:39",
            "upload_time_iso_8601": "2024-09-17T11:02:39.528564Z",
            "url": "https://files.pythonhosted.org/packages/06/13/6487d64234a93e6d18fc27983ad51b63a71082be50b9567c2d9d5a06667a/fake_traffic-3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-17 11:02:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "deedy5",
    "github_project": "fake_traffic",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "fake-traffic"
}
        
Elapsed time: 0.39347s