Metadata-Version: 2.1
Name: proxy-randomizer
Version: 1.0.0
Summary: proxy randomizer
Home-page: https://github.com/esequiel378/proxy_randomizer
Author: Esequiel Albornoz
Author-email: esequielalbornoz7@gmail.com
License: MIT license
Keywords: proxy_randomizer
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Requires-Python: >=3.5
Requires-Dist: requests (==2.23.0)
Requires-Dist: beautifulsoup4 (==4.9.0)
Requires-Dist: lxml (==4.5.0)

================
proxy-randomizer
================


.. image:: https://img.shields.io/pypi/v/proxy_randomizer.svg
        :target: https://pypi.python.org/pypi/proxy_randomizer

.. image:: https://travis-ci.com/Esequiel378/proxy_randomizer.svg?branch=master
        :target: https://travis-ci.com/Esequiel378/proxy_randomizer

.. image:: https://readthedocs.org/projects/proxy-randomizer/badge/?version=latest
        :target: https://proxy-randomizer.readthedocs.io/en/latest/?badge=latest
        :alt: Documentation Status




proxy randomizer


* Free software: MIT license
* Documentation: https://proxy-randomizer.readthedocs.io.

Installation
------------

.. code-block:: python

   pip install proxy_randomizer

API
---

To use proxy_randomizer in your code, you just need to generate a
RegisteredProviders instance and parse the providers.

.. code-block:: python

    from proxy_randomizer.providers import RegisteredProviders

    rp = RegisteredProviders()
    rp.parse_providers()

    print(f"proxy: {rp.get_random_proxy()}")


You can iterate throughout all proxies as simple as this.

.. code-block:: python

   from proxy_randomizer.providers import RegisteredProviders
   import requests

   rp = RegisteredProviders()
   rp.parse_providers()

   for proxy in rp.proxies:

        proxies     = { "https": f"{proxy.ip_address}:{proxy.port}" }
        response    = requests.get("http://google.com", proxies=proxies)



If you need to hide your identity, you can filter the proxy list by its
anonymity level.

.. code-block:: python

   from proxy_randomizer.providers import RegisteredProviders
   from proxy_randomizer.utils import ANONYMOUS

   rp = RegisteredProviders()
   rp.parse_providers()

   anonymous_proxies = list( filter(lambda proxy: proxy.anonymity == ANONYMOUS, rp.proxies) )

   print(f"filtered proxies: {anonymous_proxies}")

There are four different anonymity levels, you can inspect them like this

.. code-block:: python

   from proxy_randomizer.utils import ANONYMITY_LEVELS

   print(ANONYMITY_LEVELS)



Command-line interface
----------------------

If you need some quick proxy, just type this in your terminal.

.. code-block:: bash

   proxy_randomizer



Credits
-------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage


=======
History
=======

0.1.0 (2020-08-02)
------------------

* First release on PyPI.


