|
1 | | -# techspecs-python |
| 1 | + |
| 2 | + |
| 3 | +# TechSpecs Python Library |
| 4 | + |
| 5 | +TechSpecs provides access to standardized technical specifications of the world's consumer electronics, including smartphones, tablets, smartwatches, laptops, and more. This library makes it easy to search and quickly get the specs of any device you are interested in. |
| 6 | + |
| 7 | +## Documentation |
| 8 | + |
| 9 | +See the [TechSpecs API docs](https://techspecs.readme.io). |
| 10 | + |
| 11 | +### API Key |
| 12 | + |
| 13 | +Get a TechSpecs [API Key](https://developer.dashboard.techspecs.io/) |
| 14 | + |
| 15 | + |
| 16 | +## Installation |
| 17 | + |
| 18 | +```sh |
| 19 | +pip install techspecs |
| 20 | +``` |
| 21 | + |
| 22 | +### Requirements |
| 23 | + |
| 24 | +- Python 2.7+ or Python 3.4+ (PyPy supported) |
| 25 | + |
| 26 | +## Usage |
| 27 | + |
| 28 | +The library needs to be configured with your account's api key which is |
| 29 | +available in your [TechSpecs Dashboard][api-keys]. Set `stripe.api_key` to its |
| 30 | +value: |
| 31 | + |
| 32 | +### Product Search |
| 33 | + |
| 34 | +```python |
| 35 | +import techspecs |
| 36 | +import json |
| 37 | + |
| 38 | + |
| 39 | +key = "techspecs_api_key" #Enter your TechSpecs API Key here |
| 40 | + |
| 41 | +# Search Product |
| 42 | +base = 'techspecs_base' # Enter your TechSpecs base here |
| 43 | +query = { |
| 44 | + 'keyword': 'iphone 13', |
| 45 | + 'category': 'smartphone', |
| 46 | +} |
| 47 | +search = techspecs.search(base, query, key, mode='pretty') |
| 48 | +print(search) |
| 49 | + |
| 50 | +``` |
| 51 | + |
| 52 | +### Product Details |
| 53 | + |
| 54 | +```python |
| 55 | +import techspecs |
| 56 | +# Product Details |
| 57 | + |
| 58 | +techspecs_key = "" |
| 59 | +techspecs_base = "" |
| 60 | +techspecs_id = "" |
| 61 | + |
| 62 | +details = techspecs.detail(techspecs_base, techspecs_id, techspecs_key, mode='pretty') |
| 63 | +print(details) |
| 64 | + |
| 65 | +``` |
| 66 | + |
| 67 | +### List all brands |
| 68 | +```python |
| 69 | +import techspecs |
| 70 | +# All brands |
| 71 | + |
| 72 | +techspecs_key = "" |
| 73 | +techspecs_base = "" |
| 74 | +brands = techspecs.brands(techspecs_base, techspecs_key, mode='pretty') |
| 75 | +print(brands) |
| 76 | + |
| 77 | + |
| 78 | +``` |
| 79 | +### list all categories |
| 80 | +```python |
| 81 | +import techspecs |
| 82 | +# All Categories |
| 83 | + |
| 84 | +techspecs_key = "" |
| 85 | +techspecs_base = "" |
| 86 | +categories = techspecs.categories(techspecs_base, techspecs_key, mode='pretty') |
| 87 | +print(categories) |
| 88 | + |
| 89 | +``` |
| 90 | +### List all products by brand, category and release date |
| 91 | +```python |
| 92 | +import techspecs |
| 93 | +# All Products By Brand And Category |
| 94 | + |
| 95 | +techspecs_key = "" |
| 96 | +techspecs_base = "" |
| 97 | +page = 1 |
| 98 | +brand = [""] |
| 99 | +category = [""] |
| 100 | +date = { |
| 101 | + "from": "2010年01月01日", |
| 102 | + "to": "2022年03月15日" |
| 103 | +} |
| 104 | +all_products = techspecs.products(techspecs_base, brand, category, date, page, techspecs_key, mode='pretty') |
| 105 | +print(all_products) |
| 106 | +``` |
| 107 | + |
| 108 | + |
0 commit comments