A Python package to search and download electronic component datasheets by MPN
Project description
Datasheet Downloader
A powerful tool for automatically searching and downloading electronic component datasheets using Manufacturer Part Numbers (MPNs).
Features
- 📝 Simple Input - Provide a single MPN, a text file with multiple MPNs, or a CSV file
- 🔍 Multi-Source Search - Searches Google and direct manufacturer/distributor sites
- 🧠 Intelligent Priority - Prioritizes official manufacturer datasheets over third-party sources
- ✅ Datasheet Validation - Validates PDF files to ensure they are actual datasheets
- 🤖 Browser Automation - Uses Playwright for reliable web automation
- 🔄 Batch Processing - Process hundreds of components efficiently
- 📊 Detailed Logging - Keeps track of all operations and errors
Installation
Prerequisites
- Python 3.8+
- Poetry for dependency management
Install with Poetry
# Clone the repository
git clone https://github.com/yourusername/datasheet-downloader.git
cd datasheet-downloader
# Install dependencies
poetry install
# Install browser drivers
poetry run playwright install chromium
Quick Start
Download a single datasheet
poetry run datasheet-downloader LM358
Download datasheets for multiple MPNs from a text file
poetry run datasheet-downloader -f data/mpns.txt -o ./datasheets/
Process a CSV file with part numbers and URLs
poetry run datasheet-downloader --csv components.csv
Usage Examples
Command Line Options
usage: datasheet-downloader [-h] [-f FILE | --csv CSV] [-o OUTPUT_DIR] [--no-headless]
[--direct-sources] [--list-only] [-v] [--debug]
[mpn]
Download datasheets for electronic components by MPN
positional arguments:
mpn Manufacturer Part Number(s) to search for
optional arguments:
-h, --help show this help message and exit
-f FILE, --file FILE File containing list of MPNs (one per line)
--csv CSV Process a CSV file with columns for part numbers and datasheet URLs
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
Directory to save downloaded datasheets (default: current directory)
--no-headless Run browser in visible mode (not headless)
--direct-sources Skip Google search and only use direct manufacturer/distributor sources
--list-only List available datasheets but don't download them
-v, --verbose Enable verbose output
--debug Enable debug mode with even more verbose logging
Working with a Text File of MPNs
Create a text file with one part number per line:
# data/mpns.txt
LM358
NCV8715SQ12T2G
ATmega328P
Then run:
poetry run datasheet-downloader -f data/mpns.txt -o ./datasheets/
Working with a CSV File
The tool can process a CSV file with part numbers and optional datasheet URLs:
Part Number,Datasheet URL,MIME Type
LM358,https://www.ti.com/lit/ds/symlink/lm358.pdf,application/pdf
NCV8715SQ12T2G,,
Then run:
poetry run datasheet-downloader --csv path/to/components.csv
The tool will:
- Use direct URLs when provided
- Search for missing URLs
- Update the CSV with download results
List Available Datasheets Without Downloading
poetry run datasheet-downloader LM358 --list-only
Use Only Manufacturer/Distributor Sites (Skip Google)
poetry run datasheet-downloader -f mpns.txt --direct-sources
How It Works
Datasheet Downloader uses a sophisticated multi-layered approach:
-
Search Strategy:
- First attempts a Google search with the query format
{part_number} datasheet filetype:pdf - Falls back to manufacturer-specific searches if needed
- Can search direct manufacturer/distributor sites as a last resort
- First attempts a Google search with the query format
-
PDF Validation:
- Checks file size (50KB - 20MB)
- Analyzes page count (3-200 pages)
- Scans content for datasheet terminology
- Filters out user manuals and catalogs
-
Source Prioritization:
- Prioritizes PDFs from manufacturer domains
- Follows with trusted distributor domains
- Uses other sources as a last resort
Supported Manufacturers
The tool has enhanced support for these manufacturers:
- Texas Instruments (TI)
- ON Semiconductor
- Analog Devices
- NXP Semiconductors
- STMicroelectronics
- Infineon Technologies
- Microchip Technology
- ROHM Semiconductor
- And many more!
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Disclaimer
This tool is intended for educational and research purposes only. Always respect copyright and terms of service of websites you access. The authors are not responsible for any misuse of this tool or any violation of terms of service of any website.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file datasheet_downloader-0.1.0.tar.gz.
File metadata
- Download URL: datasheet_downloader-0.1.0.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcb63ebf072fce5bdb809dfd5ba031ab677f70d32c111ed7dfa2508519c281d2
|
|
| MD5 |
43e467c05f6ab93093ea25424ce5b7ee
|
|
| BLAKE2b-256 |
c589d08020db31927161acf20f628eae005fcb0cee5fbe58b38bd78ecdc9dc92
|
File details
Details for the file datasheet_downloader-0.1.0-py3-none-any.whl.
File metadata
- Download URL: datasheet_downloader-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3372e005b095e57911f4c96fac84cc5a7b1a03b31589136ecc3f909644b359e6
|
|
| MD5 |
cb0f5a3a4eab716fad30d6eb07bd5c10
|
|
| BLAKE2b-256 |
63ef5d5f03724cfb92ac46092dcfa3dd4706194b41943725effa68397cb29f72
|