Features
- Search ebooks with optional filters (tag, category, etc.)
- Explore books by categories or homepage
- Download ebooks asynchronously with high speed
- Full CLI support for interactive and automated usage
- Easy integration in scripts and applications
Installation
$ uv pip install "pdfdrive-api[cli]"
Developer Usage
Download by URL
from pdfdrive_api import BookDetails, Downloader
book_details = BookDetails(
"https://pdfdrive.com.co/rich-dad-poor-dad-pdf/"
)
downloader = Downloader()
async def download_book():
details = await book_details.get_details(for_download=True)
download_url = details.book.download_url
downloaded_file = await downloader.run(
download_url,
test=False,
suppress_incompatible_error=True
)
print(downloaded_file)
if __name__ == "__main__":
import asyncio
asyncio.run(download_book())
Search and Download
from pdfdrive_api import BookDetails, Downloader, SearchPage
async def main():
search = SearchPage("Rich dad")
resp = await search.get_content()
target_book = resp.books.books[0]
book_details = await BookDetails(target_book.url).get_details(for_download=True)
downloader = Downloader()
downloaded_file = await downloader.run(
book_details.download_url,
suppress_incompatible_error=True,
test=True
)
print(downloaded_file)
if __name__ == "__main__":
import asyncio
asyncio.run(main())
Command Line Interface (CLI)
The package installs a CLI tool called pdfdrive for quick searching, exploring, and downloading ebooks.
pdfdrive --help
Usage: pdfdrive COMMAND
Explore, search and download ebooks from pdfdrive.com.co
Commands:
download Download ebook by specifying its title or page URL
explore Explore available ebooks by different criteria
search Search for a particular book by its title
--help, -h Display this message and exit
--version, -v Display application version
pdfdrive download
pdfdrive download QUERY [ARGS]
Download an ebook by title or by its page URL.
| Parameter | Aliases | Description | Default |
|---|---|---|---|
QUERY |
--query |
Search text or book page URL. | Required |
--dir |
-d |
Directory to save downloaded files. | [current working directory] |
--filename |
-f |
Custom filename for output file. | Auto-generated |
--connections |
Number of parallel download connections. | 5 |
|
--yes, -y |
Proceed with the first search result automatically. | False |
|
--quiet, -q |
Auto-download book whose title matches the query exactly. | False |
Examples:
# Download a book interactively
pdfdrive download "The Pragmatic Programmer"
# Auto-download first result
pdfdrive download "Clean Code" -y
# Download by URL
pdfdrive download "https://pdfdrive.com.co/book/clean-code-pdf/"
# Custom directory and filename
pdfdrive download "Deep Learning with Python" -d ~/Downloads -f deeplearning.pdf
pdfdrive explore
pdfdrive explore [ARGS]
Explore ebooks by category, tag, search query, or directly from a listing URL.
Parameters
| Parameter | Aliases | Description | Default |
|---|---|---|---|
--offset |
-o |
Page number to start from. | – |
--confirm, --no-confirm |
-c |
Ask before going to the next page. | False |
--details, --no-details |
-d |
Display detailed book info. | False |
--limit |
-l |
Number of pages to explore. | 10 |
--infinity |
-i |
Explore indefinitely without page limit. | False |
--search |
-s |
Explore by a text query. | – |
--category |
-c |
Explore a category. | Choices include: astrology, biography, academic-and-education, business-and-career, health, novels, self-improvement, religion, etc. |
--name |
-n |
Explore books with a particular tag. | – |
--url |
-u |
Explore books from a specific listing URL. | – |
--homepage, -home |
Explore homepage content. | True |
Examples:
# Explore homepage
pdfdrive explore
# Explore 5 pages in 'business-and-career' category
pdfdrive explore -c business-and-career -l 5
# Explore books tagged "machine learning"
pdfdrive explore -t "machine learning"
# Explore using URL
pdfdrive explore --u "https://pdfdrive.com.co/category/academic-and-education"
# Infinite exploration, auto-advance
pdfdrive explore -i
pdfdrive search
pdfdrive search QUERY [ARGS]
Search for a book by title. Optionally select, auto-proceed, or download directly.
| Parameter | Aliases | Description | Default |
|---|---|---|---|
QUERY |
--query |
Search text. | Required |
--limit |
-l |
Number of result pages to scan. | 1 |
--yes, -y |
Automatically select the first book found. | False |
|
--select-one |
-s |
Prompt user to select a book from results. | Manual |
--quiet |
-q |
Automatically proceed if exact title match is found. | – |
Examples:
# Search for a book interactively
pdfdrive search "Rich Dad Poor Dad"
# Auto-select first search result
pdfdrive search "Clean Architecture" -y
# Prompt to choose a book
pdfdrive search "Deep Learning" -s
# Quiet mode – exact title match
pdfdrive search "Atomic Habits" -q
# Search across 3 pages
pdfdrive search "Artificial Intelligence" -l 3
Summary
| Command | Description |
|---|---|
pdfdrive download |
Download an ebook by title or URL |
pdfdrive explore |
Explore ebooks by category, tag, or query |
pdfdrive search |
Search for a particular book by title |
Release files for pdfdrive-api 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pdfdrive_api-0.1.2.tar.gz | 15.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pdfdrive_api-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.9 kB
Release files / pdfdrive_api-0.1.2.tar.gz
| Download URL | pdfdrive_api-0.1.2.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59f906c09262a4cb0d8cd615c11911030ab28f69e2da79c1cea2f95c3e964c7b
|
|
BLAKE2b-256 checksum How to use checksums |
1ef5ae422a674aa9fc4885cba0bbaac5796278251074e0805a10332ab5b168f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.15
|
Release files / pdfdrive_api-0.1.2-py3-none-any.whl
| Download URL | pdfdrive_api-0.1.2-py3-none-any.whl |
|---|---|
| Size | 23.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ee794910fcdade2e729d2fc0560c6799a4dc2233499d26160ec60071727ef2d7
|
|
BLAKE2b-256 checksum How to use checksums |
8c1e6e7a1cce2dfd1796a84929f58237e00388c50941c928a1237eba442229f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.15
|