masquer


Namemasquer JSON
Version 1.3.3 PyPI version JSON
download
home_pageNone
SummaryA tool to generate random user-agent and referer data for HTTP requests
upload_time2024-11-13 14:31:23
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2024 Elliott Steer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords header data requests user-agents
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center" id="title">Masquer</h1>

<p align="center">
  <a href="https://github.com/essteer/masquer/actions/workflows/test.yaml"><img src="https://github.com/essteer/masquer/actions/workflows/test.yaml/badge.svg"></a>
  <a href="https://pypi.org/project/masquer/"><img src="https://img.shields.io/pypi/v/masquer?style=flat&logo=PyPI&logoColor=white&label=PyPI&labelColor=555&color=3776AB"></a>
  <a href="https://pypi.org/project/masquer/"><img src="https://img.shields.io/badge/Python-3.9_~_3.13-3776AB.svg?style=flat&logo=Python&logoColor=white"></a>
  <a href="https://snyk.io/test/github/essteer/masquer"><img src="https://snyk.io/test/github/essteer/masquer/badge.svg?name=Snyk&style=flat&logo=Snyk"></a>
</p>

<p align="center">
  <a href="https://astral.sh"><img src="https://img.shields.io/badge/Astral-261230.svg?style=flat&logo=Astral&labelColor=555&logoColor=white"></a>
  <a href="https://hub.docker.com/r/essteer/masquer"><img src="https://img.shields.io/badge/Docker-2496ED.svg?flat&logo=Docker&labelColor=555&logoColor=white"></a>
  <a href="https://github.com/tiangolo/fastapi"><img src="https://img.shields.io/badge/FastAPI-009688?style=flat&logo=FastAPI&labelColor=555&logoColor=white"></a>
  <a href="https://masquer.fly.dev/docs"><img src="https://img.shields.io/badge/Fly.io-24175B.svg?style=flat&labelColor=555&logo=flydotio&logoColor=white"></a>
  <a href="https://github.com/pypa/hatch"><img src="https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg"></a>
</p>

<p align="center">
A tool to generate random user-agent and referer data for HTTP requests.
</p>

## Overview

Use `masquer` to obtain any combination of a random user-agent, referer or header data template, then use this with a library like [`requests`](https://github.com/psf/requests) to control the session data you send to other services.

The user-agent data is drawn from [this list](https://www.useragents.me/) of the most common desktop user-agents, and referer data is taken from [this list](https://gs.statcounter.com/search-engine-market-share/desktop/worldwide) of search engines with the largest global market share.

Weighted random selections are made from those lists to approximate authentic header data patterns.

A basic header template with common attributes — like [`"Upgrade-Insecure-Requests": "1"`](https://stackoverflow.com/questions/31950470/what-is-the-upgrade-insecure-requests-http-header/32003517#32003517) — is also provided and defaults to the most common referer and user-agent data from the above lists.

### Note on privacy

Controlling header data in this way can help to preserve privacy and hinder third-party tracking behaviour by blending part of your web profile with the most common configurations. 

It does not provide anonymity — that is a much more complex topic, and the open-source [Privacy Guides](https://www.privacyguides.org/en/) are a good place to start.

## Documentation

The sections that follow describe different ways to use `masquer`.

For development purposes see the `docs` directory for notes on development, deployment and Docker.

- [API](#api)
- [Python package](#python-package)
  - [Installation](#installation)
  - [Operation](#operation)
  - [Examples](#examples)
- [Git repository](#git-repository)
- [Docker image](#docker-image)

## API

[![FastAPI](https://img.shields.io/badge/FastAPI-masquer-009688?style=flat&logo=FastAPI&logoColor=white)](https://masquer.fly.dev/docs)

An API for `masquer` is in deployment at `https://masquer.fly.dev/masq` &mdash; try it out with the interactive [Swagger UI](https://masquer.fly.dev/docs) or [ReDoc](https://masquer.fly.dev/redoc) documentation.

The API returns a JSON array, making it compatible with any language that can make HTTP requests and parse JSON.

Here is an example using `curl` from the command line to get a random user-agent and referer:

```console
$ curl -X GET 'https://masquer.fly.dev/api/v1/masq?ua=true&rf=true' -H 'accept: application/json'
[
  {
    "Referer":"https://www.google.com",
    "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.3"
  }
]
```

The optional `count` parameter specifies the number of objects to return in the response. The default value is `1`.

Refer to the [API docs](`https://masquer.fly.dev/docs`) for other examples, or see [more details below](#examples) in the package documentation.

<h3 align="center">
  <a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Python package

[![PyPI](https://img.shields.io/badge/PyPI-masquer-3775A9.svg?style=flat&logo=PyPI&logoColor=white)](https://pypi.org/project/masquer/)

### Installation

To use the `masquer` Python package, create and activate a virtual environment then install `masquer` using a package manager.

The below example uses [Astral's](https://docs.astral.sh/uv) `uv` &mdash; substitute `pip` by dropping "`uv`" or use another package manager as preferred:

```console
$ uv venv
$ source .venv/bin/activate
$ uv pip install masquer
```

The core tool obtained this way has no dependencies.

### Operation

Interact with `masquer` via the `masq` method:

```python
>>> from masquer import masq
```

The `masq` function accepts up to three boolean parameters...

```python
>>> useragent = masq(
  ua = True,  # user-agent, defaults to True
  rf = False,  # referer, defaults to False
  hd = False  # header-data, defaults to False
)
```

...and returns the response as a dict object:

```python
{
  'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.'
}
```

### Examples

#### User-agent

By default only the `ua` parameter is set to `True`, so each of the following methods may be used to obtain just one randomly selected user-agent:

```python
>>> masq()
{"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.3"}
>>> masq(True)
{"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0."}
>>> masq(ua=True)
{"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.3"}
```

#### Referer

By the same logic, the following methods will each return one randomly selected referer:

```python
>>> masq(False, True)
{"Referer": "https://www.google.com/"}
>>> masq(ua=False, rf=True)
{"Referer": "https://www.google.com/"}
>>> masq(ua=False, rf=True, hd=False)
{"Referer": "https://bing.com/"}
```

#### Header-data with default user-agent and referer

The default header-data template supplies the most common user-agent and refer values as fixed values, and can be accessed via the following methods:

```python
>>> masq(False, False, True)
>>> masq(ua=False, hd=True)
>>> masq(ua=False, rf=False, hd=True)
```

Each of the above function calls would return the following:

```python
>>> default_header = masq(ua=False, rf=False, hd=True)
>>> default_header
{
  "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", 
  "Accept-Encoding": "gzip, deflate, br", 
  "Accept-Language": "en-US,en;q=0.5;", 
  "Referer": "https://www.google.com/", 
  "Sec-Fetch-Dest": "document", 
  "Sec-Fetch-Mode": "navigate", 
  "Sec-Fetch-Site": "none", 
  "Sec-Fetch-User": "?1", 
  "Upgrade-Insecure-Requests": "1", 
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.3"
}
```

#### Header-data with random user-agent and referer

To get the header-data with randomly selected user-agent and/or referer data, pass those arguments as `True` in addition to the `hd` parameter as per the below examples:

```python
>>> random_header = masq(rf=True, hd=True)  # ua=True by default
>>> random_header
{
  # ...
  "Referer": "https://duckduckgo.com",
  # ...
  "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113."
}
```

<h3 align="center">
  <a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Git repository

[![GitHub](https://img.shields.io/badge/GitHub-masquer-181717.svg?flat&logo=GitHub&logoColor=white)](https://github.com/essteer/masquer)

Clone the `masquer` repo for the full source code, including the FastAPI app used to host the [API](#api) introduced above. 

The repo includes the JSON source files used to generate the header data, a script to update the JSON content to the latest data, and a test suite.

```console
$ git clone git@github.com:essteer/masquer
```

The package code within the `src/masquer` directory has no dependencies beyond built-in Python modules, so can be run right away in a virtual environment.

The `update.sh` shell script in the root directory updates the `header.json` and `referer.json` files in the `assets` directory to the latest versions, then uses this data to update the `assets.py` file used by the `masquer` package.

To use the `update.sh` script first install Beautiful Soup into the virtual environment:

```console
$ source .venv/bin/activate
$ uv pip install beautifulsoup4==4.12.3
```

Then grant execution permissions to `update.sh` and run it &mdash; the output should appear similar to that displayed below:

```console
$ chmod +x update.sh
$ ./update.sh
2024-09-17 14:34:03 - INFO - update.py:29 - Fetched user-agent data
2024-09-17 14:34:04 - INFO - update.py:74 - Fetched referer data
2024-09-17 14:34:04 - INFO - update.py:133 - Saved user-agent and referer JSON data to assets.py
2024-09-17 14:34:04 - INFO - update.sh - Asset update OK
```

If interested in making changes to the repo, see the `development notes` for additional details.

### FastAPI

[![FastAPI](https://img.shields.io/badge/FastAPI-masquer-009688?style=flat&logo=FastAPI&logoColor=white)](https://masquer.fly.dev/docs)

The Git repo includes the [FastAPI version](#api) of `masquer` that is introduced above and hosted at [`https://masquer.fly.dev`](https://masquer.fly.dev/docs) &mdash; the relevant code is located at `src/api`.

To self-host the API, install the `FastAPI` optional dependency as declared in the `pyproject.toml` file. 

```console
$ source .venv/bin/activate
$ uv pip install fastapi==0.111.0
```

FastAPI runs on localhost port `8000` by default &mdash; to amend this change the relevant uvicorn argument in `src/api/main.py`:

```python
if __name__ == "__main__":
    import uvicorn

    uvicorn.run(app, host="127.0.0.1", port=8000)
```

Run the app from the root directory via:

```console
$ fastapi run src/api/main.py
```

Then follow the instructions FastAPI provides in the terminal.

To view the API's interactive documentation, run the app and navigate to `http://127.0.0.1:8000/docs` or `http://127.0.0.1:8000/redoc`.

<h3 align="center">
  <a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

## Docker image

[![Docker](https://img.shields.io/badge/Docker-masquer-2496ED.svg?flat&logo=Docker&labelColor=555&logoColor=white)](https://hub.docker.com/r/essteer/masquer)

A Docker image for `masquer` has been developed for production use, and is publicly available.

To run `masquer` from a container, first pull the image from [DockerHub](https://hub.docker.com/r/essteer/masquer):

```console
$ docker pull essteer/masquer
```

Launch a container using the `masquer` image as follows:

```console
$ docker run -d --name masquer -p 8000:8000 essteer/masquer
```

Then interact as per the [API instructions](#api) above.

<h3 align="center">
  <a href="#title"><img src="https://img.shields.io/badge/▲%20Top%20▲-0466c8.svg?style=flat"></a>
</h3>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "masquer",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "header data, requests, user-agents",
    "author": null,
    "author_email": "Elliott Steer <essteer@pm.me>",
    "download_url": "https://files.pythonhosted.org/packages/73/83/07073c0af23da6b82fe88a7ececbfe0cbaf6ffd905369ac6bd19b2bce2ea/masquer-1.3.3.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\" id=\"title\">Masquer</h1>\n\n<p align=\"center\">\n  <a href=\"https://github.com/essteer/masquer/actions/workflows/test.yaml\"><img src=\"https://github.com/essteer/masquer/actions/workflows/test.yaml/badge.svg\"></a>\n  <a href=\"https://pypi.org/project/masquer/\"><img src=\"https://img.shields.io/pypi/v/masquer?style=flat&logo=PyPI&logoColor=white&label=PyPI&labelColor=555&color=3776AB\"></a>\n  <a href=\"https://pypi.org/project/masquer/\"><img src=\"https://img.shields.io/badge/Python-3.9_~_3.13-3776AB.svg?style=flat&logo=Python&logoColor=white\"></a>\n  <a href=\"https://snyk.io/test/github/essteer/masquer\"><img src=\"https://snyk.io/test/github/essteer/masquer/badge.svg?name=Snyk&style=flat&logo=Snyk\"></a>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://astral.sh\"><img src=\"https://img.shields.io/badge/Astral-261230.svg?style=flat&logo=Astral&labelColor=555&logoColor=white\"></a>\n  <a href=\"https://hub.docker.com/r/essteer/masquer\"><img src=\"https://img.shields.io/badge/Docker-2496ED.svg?flat&logo=Docker&labelColor=555&logoColor=white\"></a>\n  <a href=\"https://github.com/tiangolo/fastapi\"><img src=\"https://img.shields.io/badge/FastAPI-009688?style=flat&logo=FastAPI&labelColor=555&logoColor=white\"></a>\n  <a href=\"https://masquer.fly.dev/docs\"><img src=\"https://img.shields.io/badge/Fly.io-24175B.svg?style=flat&labelColor=555&logo=flydotio&logoColor=white\"></a>\n  <a href=\"https://github.com/pypa/hatch\"><img src=\"https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg\"></a>\n</p>\n\n<p align=\"center\">\nA tool to generate random user-agent and referer data for HTTP requests.\n</p>\n\n## Overview\n\nUse `masquer` to obtain any combination of a random user-agent, referer or header data template, then use this with a library like [`requests`](https://github.com/psf/requests) to control the session data you send to other services.\n\nThe user-agent data is drawn from [this list](https://www.useragents.me/) of the most common desktop user-agents, and referer data is taken from [this list](https://gs.statcounter.com/search-engine-market-share/desktop/worldwide) of search engines with the largest global market share.\n\nWeighted random selections are made from those lists to approximate authentic header data patterns.\n\nA basic header template with common attributes \u2014 like [`\"Upgrade-Insecure-Requests\": \"1\"`](https://stackoverflow.com/questions/31950470/what-is-the-upgrade-insecure-requests-http-header/32003517#32003517) \u2014 is also provided and defaults to the most common referer and user-agent data from the above lists.\n\n### Note on privacy\n\nControlling header data in this way can help to preserve privacy and hinder third-party tracking behaviour by blending part of your web profile with the most common configurations. \n\nIt does not provide anonymity \u2014 that is a much more complex topic, and the open-source [Privacy Guides](https://www.privacyguides.org/en/) are a good place to start.\n\n## Documentation\n\nThe sections that follow describe different ways to use `masquer`.\n\nFor development purposes see the `docs` directory for notes on development, deployment and Docker.\n\n- [API](#api)\n- [Python package](#python-package)\n  - [Installation](#installation)\n  - [Operation](#operation)\n  - [Examples](#examples)\n- [Git repository](#git-repository)\n- [Docker image](#docker-image)\n\n## API\n\n[![FastAPI](https://img.shields.io/badge/FastAPI-masquer-009688?style=flat&logo=FastAPI&logoColor=white)](https://masquer.fly.dev/docs)\n\nAn API for `masquer` is in deployment at `https://masquer.fly.dev/masq` &mdash; try it out with the interactive [Swagger UI](https://masquer.fly.dev/docs) or [ReDoc](https://masquer.fly.dev/redoc) documentation.\n\nThe API returns a JSON array, making it compatible with any language that can make HTTP requests and parse JSON.\n\nHere is an example using `curl` from the command line to get a random user-agent and referer:\n\n```console\n$ curl -X GET 'https://masquer.fly.dev/api/v1/masq?ua=true&rf=true' -H 'accept: application/json'\n[\n  {\n    \"Referer\":\"https://www.google.com\",\n    \"User-Agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.3\"\n  }\n]\n```\n\nThe optional `count` parameter specifies the number of objects to return in the response. The default value is `1`.\n\nRefer to the [API docs](`https://masquer.fly.dev/docs`) for other examples, or see [more details below](#examples) in the package documentation.\n\n<h3 align=\"center\">\n  <a href=\"#title\"><img src=\"https://img.shields.io/badge/\u25b2%20Top%20\u25b2-0466c8.svg?style=flat\"></a>\n</h3>\n\n## Python package\n\n[![PyPI](https://img.shields.io/badge/PyPI-masquer-3775A9.svg?style=flat&logo=PyPI&logoColor=white)](https://pypi.org/project/masquer/)\n\n### Installation\n\nTo use the `masquer` Python package, create and activate a virtual environment then install `masquer` using a package manager.\n\nThe below example uses [Astral's](https://docs.astral.sh/uv) `uv` &mdash; substitute `pip` by dropping \"`uv`\" or use another package manager as preferred:\n\n```console\n$ uv venv\n$ source .venv/bin/activate\n$ uv pip install masquer\n```\n\nThe core tool obtained this way has no dependencies.\n\n### Operation\n\nInteract with `masquer` via the `masq` method:\n\n```python\n>>> from masquer import masq\n```\n\nThe `masq` function accepts up to three boolean parameters...\n\n```python\n>>> useragent = masq(\n  ua = True,  # user-agent, defaults to True\n  rf = False,  # referer, defaults to False\n  hd = False  # header-data, defaults to False\n)\n```\n\n...and returns the response as a dict object:\n\n```python\n{\n  'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.'\n}\n```\n\n### Examples\n\n#### User-agent\n\nBy default only the `ua` parameter is set to `True`, so each of the following methods may be used to obtain just one randomly selected user-agent:\n\n```python\n>>> masq()\n{\"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.3\"}\n>>> masq(True)\n{\"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.\"}\n>>> masq(ua=True)\n{\"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.3\"}\n```\n\n#### Referer\n\nBy the same logic, the following methods will each return one randomly selected referer:\n\n```python\n>>> masq(False, True)\n{\"Referer\": \"https://www.google.com/\"}\n>>> masq(ua=False, rf=True)\n{\"Referer\": \"https://www.google.com/\"}\n>>> masq(ua=False, rf=True, hd=False)\n{\"Referer\": \"https://bing.com/\"}\n```\n\n#### Header-data with default user-agent and referer\n\nThe default header-data template supplies the most common user-agent and refer values as fixed values, and can be accessed via the following methods:\n\n```python\n>>> masq(False, False, True)\n>>> masq(ua=False, hd=True)\n>>> masq(ua=False, rf=False, hd=True)\n```\n\nEach of the above function calls would return the following:\n\n```python\n>>> default_header = masq(ua=False, rf=False, hd=True)\n>>> default_header\n{\n  \"Accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7\", \n  \"Accept-Encoding\": \"gzip, deflate, br\", \n  \"Accept-Language\": \"en-US,en;q=0.5;\", \n  \"Referer\": \"https://www.google.com/\", \n  \"Sec-Fetch-Dest\": \"document\", \n  \"Sec-Fetch-Mode\": \"navigate\", \n  \"Sec-Fetch-Site\": \"none\", \n  \"Sec-Fetch-User\": \"?1\", \n  \"Upgrade-Insecure-Requests\": \"1\", \n  \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.3\"\n}\n```\n\n#### Header-data with random user-agent and referer\n\nTo get the header-data with randomly selected user-agent and/or referer data, pass those arguments as `True` in addition to the `hd` parameter as per the below examples:\n\n```python\n>>> random_header = masq(rf=True, hd=True)  # ua=True by default\n>>> random_header\n{\n  # ...\n  \"Referer\": \"https://duckduckgo.com\",\n  # ...\n  \"User-Agent\": \"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.\"\n}\n```\n\n<h3 align=\"center\">\n  <a href=\"#title\"><img src=\"https://img.shields.io/badge/\u25b2%20Top%20\u25b2-0466c8.svg?style=flat\"></a>\n</h3>\n\n## Git repository\n\n[![GitHub](https://img.shields.io/badge/GitHub-masquer-181717.svg?flat&logo=GitHub&logoColor=white)](https://github.com/essteer/masquer)\n\nClone the `masquer` repo for the full source code, including the FastAPI app used to host the [API](#api) introduced above. \n\nThe repo includes the JSON source files used to generate the header data, a script to update the JSON content to the latest data, and a test suite.\n\n```console\n$ git clone git@github.com:essteer/masquer\n```\n\nThe package code within the `src/masquer` directory has no dependencies beyond built-in Python modules, so can be run right away in a virtual environment.\n\nThe `update.sh` shell script in the root directory updates the `header.json` and `referer.json` files in the `assets` directory to the latest versions, then uses this data to update the `assets.py` file used by the `masquer` package.\n\nTo use the `update.sh` script first install Beautiful Soup into the virtual environment:\n\n```console\n$ source .venv/bin/activate\n$ uv pip install beautifulsoup4==4.12.3\n```\n\nThen grant execution permissions to `update.sh` and run it &mdash; the output should appear similar to that displayed below:\n\n```console\n$ chmod +x update.sh\n$ ./update.sh\n2024-09-17 14:34:03 - INFO - update.py:29 - Fetched user-agent data\n2024-09-17 14:34:04 - INFO - update.py:74 - Fetched referer data\n2024-09-17 14:34:04 - INFO - update.py:133 - Saved user-agent and referer JSON data to assets.py\n2024-09-17 14:34:04 - INFO - update.sh - Asset update OK\n```\n\nIf interested in making changes to the repo, see the `development notes` for additional details.\n\n### FastAPI\n\n[![FastAPI](https://img.shields.io/badge/FastAPI-masquer-009688?style=flat&logo=FastAPI&logoColor=white)](https://masquer.fly.dev/docs)\n\nThe Git repo includes the [FastAPI version](#api) of `masquer` that is introduced above and hosted at [`https://masquer.fly.dev`](https://masquer.fly.dev/docs) &mdash; the relevant code is located at `src/api`.\n\nTo self-host the API, install the `FastAPI` optional dependency as declared in the `pyproject.toml` file. \n\n```console\n$ source .venv/bin/activate\n$ uv pip install fastapi==0.111.0\n```\n\nFastAPI runs on localhost port `8000` by default &mdash; to amend this change the relevant uvicorn argument in `src/api/main.py`:\n\n```python\nif __name__ == \"__main__\":\n    import uvicorn\n\n    uvicorn.run(app, host=\"127.0.0.1\", port=8000)\n```\n\nRun the app from the root directory via:\n\n```console\n$ fastapi run src/api/main.py\n```\n\nThen follow the instructions FastAPI provides in the terminal.\n\nTo view the API's interactive documentation, run the app and navigate to `http://127.0.0.1:8000/docs` or `http://127.0.0.1:8000/redoc`.\n\n<h3 align=\"center\">\n  <a href=\"#title\"><img src=\"https://img.shields.io/badge/\u25b2%20Top%20\u25b2-0466c8.svg?style=flat\"></a>\n</h3>\n\n## Docker image\n\n[![Docker](https://img.shields.io/badge/Docker-masquer-2496ED.svg?flat&logo=Docker&labelColor=555&logoColor=white)](https://hub.docker.com/r/essteer/masquer)\n\nA Docker image for `masquer` has been developed for production use, and is publicly available.\n\nTo run `masquer` from a container, first pull the image from [DockerHub](https://hub.docker.com/r/essteer/masquer):\n\n```console\n$ docker pull essteer/masquer\n```\n\nLaunch a container using the `masquer` image as follows:\n\n```console\n$ docker run -d --name masquer -p 8000:8000 essteer/masquer\n```\n\nThen interact as per the [API instructions](#api) above.\n\n<h3 align=\"center\">\n  <a href=\"#title\"><img src=\"https://img.shields.io/badge/\u25b2%20Top%20\u25b2-0466c8.svg?style=flat\"></a>\n</h3>\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Elliott Steer  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A tool to generate random user-agent and referer data for HTTP requests",
    "version": "1.3.3",
    "project_urls": {
        "docker": "https://hub.docker.com/r/essteer/masquer",
        "documentation": "https://github.com/essteer/masquer/blob/main/README.md",
        "issues": "https://github.com/essteer/masquer/issues",
        "repository": "https://github.com/essteer/masquer"
    },
    "split_keywords": [
        "header data",
        " requests",
        " user-agents"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7938addf79afb04c5620bf0ed0aac47421f7714f11974b695f663f22362c814d",
                "md5": "3921bdd78f122d0edf15cc36b78b42d1",
                "sha256": "fc85bc6940abdbe2e1f4b97aa19cf91c2d8f024a5cae356f3a6c9871d3c26720"
            },
            "downloads": -1,
            "filename": "masquer-1.3.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3921bdd78f122d0edf15cc36b78b42d1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 10149,
            "upload_time": "2024-11-13T14:31:18",
            "upload_time_iso_8601": "2024-11-13T14:31:18.975521Z",
            "url": "https://files.pythonhosted.org/packages/79/38/addf79afb04c5620bf0ed0aac47421f7714f11974b695f663f22362c814d/masquer-1.3.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "738307073c0af23da6b82fe88a7ececbfe0cbaf6ffd905369ac6bd19b2bce2ea",
                "md5": "9ab12ada10b7d030cd3bf04b4c2bb741",
                "sha256": "7e995f7a13473307cfad5a398ad4110355fb75946105187251061b25680d027e"
            },
            "downloads": -1,
            "filename": "masquer-1.3.3.tar.gz",
            "has_sig": false,
            "md5_digest": "9ab12ada10b7d030cd3bf04b4c2bb741",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 9028,
            "upload_time": "2024-11-13T14:31:23",
            "upload_time_iso_8601": "2024-11-13T14:31:23.482590Z",
            "url": "https://files.pythonhosted.org/packages/73/83/07073c0af23da6b82fe88a7ececbfe0cbaf6ffd905369ac6bd19b2bce2ea/masquer-1.3.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-13 14:31:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "essteer",
    "github_project": "masquer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "masquer"
}
        
Elapsed time: 0.34716s