Skip to main content

A Python module which does one thing: giving you a random User-Agent Header

Project description

useragents

A Python module which does one thing: giving you a random User-Agent Header

Do not worry about sticking with a single user-agent for you HTTP requests ever again!

PyPI version PyPI - Downloads PyPI - Python Version PyPI - Status GitHub - License GitHub Top language CodeQL Checks Badge Pytest Code Size Repo Size Issues

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

You will need to have Python installed on your computer to use this software

According to Vermin, Python 3.0 or higher is needed to use pyuseragents even if it does work on Python 2.

Always check if your Python version works with pyuseragents before using it in production

Tested manually on Python 2.7 and Python 3.9

Tested automatically (CI) with Pytest on Python 2.7, Python 3.0 and Python 3.9

Installing

You can install it from PyPI with:

pip install pyuseragents

You can check if you successfully installed it by printing out its version:

python -c "import pyuseragents; print(pyuseragents.__version__)"
# output:
pyuseragents v1.0

List of User-Agents

The list of User-Agents headers has been crawled from various sources.

They are all available in the pyuseragents/data/list.py file.

The list being in a python module means that it will be preloaded by Python in memory for performance reasons.

Usage

>>> import pyuseragents
>>> headers = {
    "User-Agent": pyuseragents.random(),
    "Content-Type": "application/json",
    "and so on..."
}
>>> pyuseragents.random()
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"

Deployment

This module should be stable but might contain bugs with edge-cases.

Feel free to use it in production if you feel like it is suitable for your production and report any issue under the "Issues" section of the GitHub repository.

Built With

No dependency is needed for this module

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

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

pyuseragents-1.0.2.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

pyuseragents-1.0.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file pyuseragents-1.0.2.tar.gz.

File metadata

  • Download URL: pyuseragents-1.0.2.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for pyuseragents-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2523d79e20886b4f46d1b9723350dda4334077c00d0270aa98af52f9251f913f
MD5 99d6e8a4c69f1e1f88251fd8577c2ca1
BLAKE2b-256 62fa060090115df66a97311fabbcf06e5064452a36c0f31cc33d2dafb0e6cebf

See more details on using hashes here.

File details

Details for the file pyuseragents-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyuseragents-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for pyuseragents-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d51cbcb9cc7b47c9cd7f82b4e937721a5b11a523a89b7fd4a0426fd9cfcee762
MD5 fc29a0a184c87364f09bca4983218861
BLAKE2b-256 1eba1ed0d465fa6d031605c3ce47b49f6a6a8eded83ed81e258745790f781e61

See more details on using hashes here.

Supported by

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