All Projects → carsonyl → pypac

carsonyl / pypac

Licence: Apache-2.0 license
Find and use proxy auto-config (PAC) files with Python and Requests.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pypac

Learnpython
以撸代码的形式学习Python
Stars: ✭ 6,040 (+10313.79%)
Mutual labels:  python-requests
Canvas grab
🌐 One-click script to synchronize files from Canvas LMS.
Stars: ✭ 118 (+103.45%)
Mutual labels:  python-requests
requests-http-signature
A Requests auth module for the IETF HTTP Message Signatures draft standard
Stars: ✭ 63 (+8.62%)
Mutual labels:  python-requests
Requests3
Requests 3.0, for Humans and Machines, alike. 🤖
Stars: ✭ 813 (+1301.72%)
Mutual labels:  python-requests
Requests Oauthlib
OAuthlib support for Python-Requests!
Stars: ✭ 1,369 (+2260.34%)
Mutual labels:  python-requests
Automationtest
Pytest测试框架,UI, API, DataBase,部分功能已封装,可根据实际需求修改
Stars: ✭ 159 (+174.14%)
Mutual labels:  python-requests
Baby Names Analysis
Data ETL & Analysis on the dataset 'Baby Names from Social Security Card Applications - National Data'.
Stars: ✭ 557 (+860.34%)
Mutual labels:  python-requests
requests-cloudkit
Apple CloudKit Python library.
Stars: ✭ 60 (+3.45%)
Mutual labels:  python-requests
Requests
A simple, yet elegant, HTTP library.
Stars: ✭ 46,558 (+80172.41%)
Mutual labels:  python-requests
requests-arcgis-auth
Authentication handler for using Esri ArcGIS for Server and Portal (ArcGIS Online) Token Authentication with Python Requests
Stars: ✭ 21 (-63.79%)
Mutual labels:  python-requests
Pycurl Requests
A Requests-compatible interface for PycURL.
Stars: ✭ 23 (-60.34%)
Mutual labels:  python-requests
Instagram Auto Create Account
An automatic account creation bot script for Instagram.
Stars: ✭ 101 (+74.14%)
Mutual labels:  python-requests
Requests Kerberos
An authentication handler for using Kerberos with Python Requests.
Stars: ✭ 219 (+277.59%)
Mutual labels:  python-requests
Toolbelt
A toolbelt of useful classes and functions to be used with python-requests
Stars: ✭ 748 (+1189.66%)
Mutual labels:  python-requests
Geolocator-2
Learn how to find and work with locations in Django, the Yelp API, and Google Maps api.
Stars: ✭ 24 (-58.62%)
Mutual labels:  python-requests
Faster Than Requests
Faster requests on Python 3
Stars: ✭ 639 (+1001.72%)
Mutual labels:  python-requests
Anyapi
AnyAPI is a library that helps you to write any API wrappers with ease and in pythonic way.
Stars: ✭ 126 (+117.24%)
Mutual labels:  python-requests
anilist-to-mal
A python tool that will export your Anilist.co anime list for MAL importing
Stars: ✭ 33 (-43.1%)
Mutual labels:  python-requests
requests-rs
Rust HTTP client library styled after awesome Python requests
Stars: ✭ 37 (-36.21%)
Mutual labels:  python-requests
Fire
🔥A delightful HTTP/HTTPS networking framework for iOS/macOS/watchOS/tvOS platforms written in Swift.
Stars: ✭ 243 (+318.97%)
Mutual labels:  python-requests

PyPAC: Proxy auto-config for Python

https://img.shields.io/pypi/v/pypac.svg?maxAge=2592000 https://readthedocs.org/projects/pypac/badge/?version=latest

PyPAC is a Python library for finding proxy auto-config (PAC) files and making HTTP requests that respect them. PAC files are often used in organizations that need fine-grained and centralized control of proxy settings.

PyPAC can find PAC files according to the DNS portion of the Web Proxy Auto-Discovery (WPAD) protocol. On Windows, PyPAC will automatically get the PAC file URL from the Internet Options dialog. On macOS, PyPAC will automatically get the PAC file URL from System Preferences.

PyPAC provides a subclass of a Requests Session, so you can start using it immediately, with any PAC file transparently discovered and honoured:

>>> from pypac import PACSession
>>> session = PACSession()
>>> session.get('http://example.org')
...

If a PAC file isn't found, then PACSession behaves like a regular Session.

If you're looking to add basic PAC functionality to a library that you're using, try the pac_context_for_url() context manager:

from pypac import pac_context_for_url
import boto3

with pac_context_for_url('https://example.amazonaws.com'):
    client = boto3.client('sqs')
    client.list_queues()

This sets up proxy environment variables at the start of the scope, based on any auto-discovered PAC and the given URL. pac_context_for_url() should work for any library that honours proxy environment variables.

Features

  • The same Requests API that you already know and love
  • Honour PAC setting from Windows Internet Options and macOS System Preferences
  • Follow DNS Web Proxy Auto-Discovery protocol
  • Proxy authentication pass-through
  • Proxy failover and load balancing
  • Generic components for adding PAC support to other code

PyPAC supports Python 2.7 and 3.5+.

Installation

Install PyPAC using pip:

$ python -m pip install pypac

Documentation

PyPAC's documentation is available at http://pypac.readthedocs.io/.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].