Skip to main content

Manage free and private proxies on local db for Python Projects.

Project description

https://raw.githubusercontent.com/Nekmo/proxy-db/master/images/proxy-db.png

Latest Travis CI build status Latest PyPI version Python versions Code Climate Test coverage Requirements Status

proxy-db

Manage free and private proxies on local db for Python Projects. Each proxy has a score according to how it works. Add a positive vote if the proxy works correctly and a negative vote if it does not work.

import requests
from requests.exceptions import Timeout, ConnectionError, ProxyError
from proxy_db.proxies import ProxiesList

proxy = next(ProxiesList())
try:
    requests.get('http://site.com/', proxies=proxy)
except (Timeout, ConnectionError, ProxyError):
    proxy.negative()
else:
    proxy.positive()

Proxy-db will return the best proxies first (more positive votes). You can also filter by country:

from proxy_db.proxies import ProxiesList

spain_proxy = next(ProxiesList('es'))
# ...

You can also filter by provider:

from proxy_db.proxies import ProxiesList

proxy_nova_proxy = next(ProxiesList(provider='Proxy Nova'))
# ...

Free proxies providers included:

  • Proxy Nova

  • Nord VPN (requires PROXYDB_NORDVPN_USERNAME & PROXYDB_NORDVPN_PASSWORD env. variables).

For more information see the docs.

Install

If you have Pip installed on your system, you can use it to install the latest ProxyDB stable version:

$ pip3 install proxy-db

Python 2.7 & 3.4-3.7 are supported but Python 3.x is recommended. Use pip2 on install for Python2. More info in the documentation

Some providers do not have the correct country for proxies. To determine the correct country proxy-db can use geoip. To use this install the optional dependencies:

$ pip3 install proxy-db[geoip]

You also need a maxmind Geolite2 license (it’s free). To obtain the license, follow these steps:

  1. Sign up for a Maxmind Geolite2 account

  2. Log in to your Maxmind account

  3. In the menu on the left, navigate to Services > My License Key.

  4. Click Generate new license key.

Sets the environment variable MAXMIND_LICENSE_KEY. To set it from Python:

import os
os.environ['MAXMIND_LICENSE_KEY'] = '28xjifHSTxVq93xZ'

HTTPS & SOCKS5 proxies

To use socks5 proxies with requests you need to install socks support:

$ pip3 install proxy-db[socks]

To use HTTPS proxies with requests/urllib3 you need to install the latests urllib3 version from sources:

$ pip install https://github.com/urllib3/urllib3/archive/master.zip

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

proxy-db-0.3.0.tar.gz (314.2 kB view details)

Uploaded Source

Built Distribution

proxy_db-0.3.0-py2.py3-none-any.whl (21.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file proxy-db-0.3.0.tar.gz.

File metadata

  • Download URL: proxy-db-0.3.0.tar.gz
  • Upload date:
  • Size: 314.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9

File hashes

Hashes for proxy-db-0.3.0.tar.gz
Algorithm Hash digest
SHA256 afe5439b43fb2c60ba5fce1a4dd8310f18fa6fa28866da1e12344a427674e71d
MD5 576dc8ffc4ac468c79dbdbaedc348260
BLAKE2b-256 a6f9e48c24a5fb1c91abe8fa21ca391f3fa5800f54648009857c59fede1a8d03

See more details on using hashes here.

File details

Details for the file proxy_db-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: proxy_db-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.9

File hashes

Hashes for proxy_db-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 37fecbd69bfcbc6e58a8ee21392b22248727016ca92dda8824a879058283cf68
MD5 ef84681b1fa7f2415304321b6b479905
BLAKE2b-256 d8450a1488e3bcd64f5efc3ed1fbb4f2d29dca2c4f171195a14034041ae71a92

See more details on using hashes here.

Supported by

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