fake-traffic


Namefake-traffic JSON
Version 2.2 PyPI version JSON
download
home_page
SummaryInternet traffic generator.
upload_time2024-02-24 07:47:20
maintainer
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 Turkey, who speaks Kurdish and is interested in hot stories
fake_traffic -c tr -l ku-tr -ca h
# 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),
    category = сategory of interest of a user (defaults to 'h'):
               'all' (all), 'b' (business), 'e' (entertainment), 
               'm' (health), 's' (sports), 't' (sci/tech), 'h' (top stories);
    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 and is interested in hot stories

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>

Set the category ('h', because the user in the example is interested in hot stories):
  - category = 'h'

Starting in none-headless mode:
  - headless=False
```python3
from fake_traffic import FakeTraffic

ft = FakeTraffic(country="TR", language="ku-TR", category='h', 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", category='b')` |
India     | English   | `FakeTraffic(country="IN", language="en-IN", category='all')` |
India     | Hindi     | `FakeTraffic(country="IN", language="hi-IN")` |
Russia    | English   | `FakeTraffic(country="RU", language="en-US", category='b', headless=False)` |
Russia    | Russian   | `FakeTraffic(country="RU", language="ru-RU")` |
Brazil | Portuguese | `FakeTraffic(country="BR", language="pt-BR", category='s')` |
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": "",
    "name": "fake-traffic",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "python,traffic generator,fake traffic",
    "author": "deedy5",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/6a/e4/03382f6130ab078e96b22c1d89bcf87d8777f3543b6c84d1fba9b927f9f8/fake_traffic-2.2.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 Turkey, who speaks Kurdish and is interested in hot stories\nfake_traffic -c tr -l ku-tr -ca h\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    category = \u0441ategory of interest of a user (defaults to 'h'):\n               'all' (all), 'b' (business), 'e' (entertainment), \n               'm' (health), 's' (sports), 't' (sci/tech), 'h' (top stories);\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 and is interested in hot stories\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\nSet the category ('h', because the user in the example is interested in hot stories):\n  - category = 'h'\n\nStarting in none-headless mode:\n  - headless=False\n```python3\nfrom fake_traffic import FakeTraffic\n\nft = FakeTraffic(country=\"TR\", language=\"ku-TR\", category='h', 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\", category='b')` |\nIndia     | English   | `FakeTraffic(country=\"IN\", language=\"en-IN\", category='all')` |\nIndia     | Hindi     | `FakeTraffic(country=\"IN\", language=\"hi-IN\")` |\nRussia    | English   | `FakeTraffic(country=\"RU\", language=\"en-US\", category='b', headless=False)` |\nRussia    | Russian   | `FakeTraffic(country=\"RU\", language=\"ru-RU\")` |\nBrazil | Portuguese | `FakeTraffic(country=\"BR\", language=\"pt-BR\", category='s')` |\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": "2.2",
    "project_urls": {
        "Homepage": "https://github.com/deedy5/fake_traffic"
    },
    "split_keywords": [
        "python",
        "traffic generator",
        "fake traffic"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "61a244be8985e4089fb88c2d5a5005336b514f1f6825066bae5204315f9ab553",
                "md5": "ee6cb7d75d6a930627d4c94365650fb0",
                "sha256": "1d1e923b8ab0ec695a96bd144fbe8a380d02572779336d48da6bced96fb47ed5"
            },
            "downloads": -1,
            "filename": "fake_traffic-2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ee6cb7d75d6a930627d4c94365650fb0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7040,
            "upload_time": "2024-02-24T07:47:18",
            "upload_time_iso_8601": "2024-02-24T07:47:18.939801Z",
            "url": "https://files.pythonhosted.org/packages/61/a2/44be8985e4089fb88c2d5a5005336b514f1f6825066bae5204315f9ab553/fake_traffic-2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6ae403382f6130ab078e96b22c1d89bcf87d8777f3543b6c84d1fba9b927f9f8",
                "md5": "b1cbbed9c43a6218d2f1ef10994f7280",
                "sha256": "8659758e1693729a34e9c9cbaea33b2304012095be8ae92bd295e10056752f99"
            },
            "downloads": -1,
            "filename": "fake_traffic-2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "b1cbbed9c43a6218d2f1ef10994f7280",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5699,
            "upload_time": "2024-02-24T07:47:20",
            "upload_time_iso_8601": "2024-02-24T07:47:20.601351Z",
            "url": "https://files.pythonhosted.org/packages/6a/e4/03382f6130ab078e96b22c1d89bcf87d8777f3543b6c84d1fba9b927f9f8/fake_traffic-2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-24 07:47:20",
    "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.19749s