Pyntrest
A powerful Pinterest image search and download client with CLI and API support.
Features
- Search and download Pinterest images
- Command-line interface
- FastAPI server with web interface
- Multiple search modes:
- Regular search
- Random images
- Inspiration images
- Single image quick search
- Download functionality
- Session management with cookie refresh
- User agent rotation to prevent rate limiting
- Easy to use as a Python library
Installation
# From PyPI (coming soon)
pip install pyntrest
# From GitHub
git clone https://github.com/redmoon0x/pynterest.git
cd pynterest
pip install -e .
Command Line Usage
Search and download images:
# Basic search
pyntrest-search "cats" -n 5
# Download to specific directory
pyntrest-search "dogs" -n 3 -o dog_pics
# Get random images
pyntrest-search random "nature" -n 2
# Get random inspiration images
pyntrest-search inspire -n 3
Web Interface
Start the web server:
pyntrest-server
Then open http://localhost:8000 in your browser to use the web interface.
API Usage
As a Python Library
from pyntrest import PinterestClient
# Initialize the client
client = PinterestClient()
# Search for images
images = client.get_image_links("cats", num_images=3)
for img in images:
print(f"URL: {img['url']}")
print(f"Size: {img['width']}x{img['height']}")
print(f"Title: {img['title']}")
print(f"Description: {img['description']}")
# Get a single image quickly
image = client.get_one_image("dogs")
print(image['url'])
# Get a random inspiration image
image = client.get_random_inspiration()
print(image['url'])
REST API Endpoints
The web server provides these endpoints:
GET /api/search/?query=<term>&num=<count>- Search for imagesGET /api/random/?query=<term>- Get a random image for queryGET /api/one/?query=<term>- Get a single image quicklyGET /api/inspire/- Get a random inspiration imageGET /api/download/?url=<image_url>- Download an image
Example using curl:
# Search for images
curl "http://localhost:8000/api/search/?query=cats&num=3"
# Get a random image
curl "http://localhost:8000/api/random/?query=dogs"
# Get an inspiration
curl "http://localhost:8000/api/inspire/"
Project Structure
pyntrest/
├── client/ # Core Pinterest client
│ ├── __init__.py
│ └── pinterest.py
├── api/ # FastAPI server
│ ├── __init__.py
│ └── server.py
├── web/ # Web interface
│ └── static/ # Frontend files
├── __init__.py # Package initialization
└── cli.py # Command line interface
Development
- Clone the repository
- Install development dependencies:
pip install -r requirements.txt
- Run tests:
pytest
License
MIT License - see LICENSE file for details.
Metadata
Release files for pyntrest 1.0.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 | Provenance | |
|---|---|---|---|---|
| pyntrest-1.0.0.tar.gz | 12.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyntrest-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.5 kB
Release files / pyntrest-1.0.0.tar.gz
| Download URL | pyntrest-1.0.0.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
469e25fd8851006b67f18168e68f6d6dc6f739ac362235c2d9204912a79b67a0
|
|
BLAKE2b-256 checksum How to use checksums |
e6e4acea38f9afc13f1e3f955c7bee8be70eae5b10540cfe47fcf6764bd7dbab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.4
|
Release files / pyntrest-1.0.0-py3-none-any.whl
| Download URL | pyntrest-1.0.0-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
39c4fd2afffc75ba5e4a238d3035e79c288a5161bd689fa6ba523e1dfdad6587
|
|
BLAKE2b-256 checksum How to use checksums |
c0f129e17a0912ff7522030e6b1b5fd861f385de786f7eab24ab9d9ea759e2f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.4
|
Security for pyntrest 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.