Metadata-Version: 2.1
Name: producthunt
Version: 0.1.4
Summary: A Python wrapper on Product Hunt API
Author: Dariush Abbasi
Author-email: poshtehani@gmail.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Description-Content-Type: text/markdown
Requires-Dist: requests (<3.0.0,>=2.0.0)
Requires-Dist: graphene (<4.0,>=3.0)

# producthunt.py

[![PyPI version](https://badge.fury.io/py/producthunt.svg)](https://badge.fury.io/py/producthunt)

Product Hunt API wrapper for python

## Installation

```
pip install producthunt
```

### init

First, initialize the ProductHunt class with your API key.

```python
from producthunt import ProductHunt
api_key = 'YOUR_API_KEY_HERE'
ph = ProductHunt(api_key)
```

### Get Daily Products

Fetch daily new products.

```python
daily_products = ph.get_daily()
for product in daily_products:
    print(f"ID: {product['ID']}")
    print(f"Name: {product['Name']}")
    print(f"Tagline: {product['Tagline']}")
```

### Get Product Details

Fetch the details of a specific product using its slug.

```python
product_details = ph.get_product_details("some-product-slug")
if product_details:
    print(f"Name: {product_details['Name']}")
    print(f"Tagline: {product_details['Tagline']}")
    print(f"Description: {product_details['Description']}")
    print(f"Website: {product_details['Website']}")
else:
    print("Product not found.")
```

### Get Posts by Topic

Fetch posts by topic:

```python
products = ph.get_posts_by_topic('artificial-intelligence')
for product in products:
    print(f"ID: {product['ID']}")
    print(f"Name: {product['Name']}")
    print(f"Tagline: {product['Tagline']}")
```

## License

This project is licensed under the terms of the MIT license.


