Octocruncher V4
Use this to query Octopart using the v4 API
To function with active requests, the OCTOPART_API_KEY environment variable must be set. This can be done in your Python using the following:
import os
os.environ['OCTOPART_API_KEY'] = 'xxxxxxxxx'
Usage
from octocruncher import OctoCruncher
# Setup the manufacturer part number here
x = OctoCruncher(mpn='mpn')
OctoCruncher takes in the argument 'mpn' (manufacturer part number) which everything else is based off of. Other optional arguments:
json_source: You can provide a json.loads object instead of querying online. This is helpful for when you want to cache (use with OctoCruncher.getJSON())
file_source: Similar to json_source but will load from the given file path
Callables
.getNumItems():
This tells you how many results there are
.setItemNumber(itemnumber=0)
This sets the working item for all other functions
.getMPN():
Returns working manufacturer part number
.getJSON():
This will return a json object that can be cached and loaded later
.getNumDescriptions():
Tells you how many available part descriptions there are
.getDescription(n=0):
Returns the nth description. If n is not specified, the 0th
description will be returned. Returntype is a description class which has the
value and source elements
.getNumDatasheets():
Tells you how many datasheets are available
.getDatasheet(n=0)
Returns the nth Datasheet object. This object has the following parameters that can be accessed:
date_created
last_updated
num_pages
size_bytes
date_created
mimetype
url
source
.getManufacturer():
This returns a manufacturer object with the name and homepage_url attributes
Metadata
Release files for octocruncher 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| octocruncher-0.2.0.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| octocruncher-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.9 kB
Release files / octocruncher-0.2.0.tar.gz
| Download URL | octocruncher-0.2.0.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
752781e4edac4b3a4e2103c0ed55ce764eed5dd4bc4fa0bc6bc7e066af2af736
|
|
BLAKE2b-256 checksum How to use checksums |
585d2120599efdde1105c99a6a97cb69e808be3505e778c51ecb25b7535ef4b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / octocruncher-0.2.0-py3-none-any.whl
| Download URL | octocruncher-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c2b6368376fe71be4da85a47af890f55d682a8a35ba3d2d579bb4d468fec4b66
|
|
BLAKE2b-256 checksum How to use checksums |
8e6695ed0723e0e355db379ba7dc8894801fb709491602702e5569830aeb7e22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|