Skip to main content

A fast, simple API for PCPartPicker.com.

Project description

pcpartpicker

Build Status Coverage Status

This is an unofficial Python 3.7+ API for the website pcpartpicker.com. Written using async code and multiprocessing for efficient data retrieval. This package is currently in beta.

Installation:

pip install pcpartpicker

Examples:

Retrieving supported API regions:

from pcpartpicker import API

api = API()
print(api.supported_regions)
>>> {'be', 'us', 'it', 'uk', 'ie', 'nz', 'de', 'ca', 'au', 'fr', 'se', 'es', 'in'}

Retrieving currently selected region (default is US):

from pcpartpicker import API

api = API()
print(api.region)
>>> us

Creating an API object with a different default region:

from pcpartpicker import API

api = API("de")
print(api.region)
>>> de

Changing the default region:

from pcpartpicker import API

api = API()
api.set_region("de")
print(api.region)
>>> de

Changing the maximum number of allowed concurrent requests:

from pcpartpicker import API

api = API()
api.set_concurrent_connections(100)
print(api.concurrent_connections)
>>> 100 

Retrieving supported part list:

from pcpartpicker import API

api = API()
print(api.supported_parts)
>>> {'wireless-network-card', 'case-fan', 'cpu', 'cpu-cooler', 'headphones', 'motherboard', 'monitor', 'internal-hard-drive', 'external-hard-drive', 'ups', 'fan-controller', 'case', 'keyboard', 'mouse', 'wired-network-card', 'sound-card', 'video-card', 'speakers', 'optical-drive', 'power-supply', 'thermal-paste', 'memory'}

Retrieving all part data:

from pcpartpicker import API

api = API()
part_data = api.retrieve_all()

Retrieving specific part data:

from pcpartpicker import API

api = API()
cpu_data = api.retrieve("cpu")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pcpartpicker, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size pcpartpicker-1.0.0-py3-none-any.whl (28.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pcpartpicker-1.0.0.tar.gz (13.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page