This project consists of two Python scripts that allow you to validate an email list using the Debounce.io API and download the processed file once it's ready.
Scripts • Setup • Usage • Dependencies • Diagrams •
This script uploads a CSV file containing email addresses to an FTP server and validates the email list using the Debounce.io API. Here's how it works:
- It checks if a CSV filename is provided as a command-line argument.
- It reads the data from the provided CSV file.
- It uploads the CSV file to an FTP server using the provided FTP credentials.
- It sends a request to the Debounce.io API with the URL of the uploaded file and the API key.
- It prints the list ID returned by the Debounce.io API, which is required for checking the status and downloading the processed file. Usage:
python create_batch.py <csv_filename>
This script checks the status of a list on the Debounce.io API and downloads the file when it's ready. Here's how it works:
- It checks if a list ID is provided as a command-line argument.
- It sends a request to the Debounce.io API with the list ID and API key to check the status of the list.
- It prints the status, percentage completed, and download link (if available).
- If the status is "completed," it downloads the file using the provided download link.
- If the status is not "completed," it waits for 1 minute and checks the status again. Usage:
python get_status.py <list_id>
- Clone the repository or download the scripts.
- Create a
.env
file in the project directory and add the following environment variables:API_KEY
: Your Debounce.io API key.FTP_USERNAME
: Your FTP username.FTP_PASSWORD
: Your FTP password.
API_KEY=Your_Debounce.io_API_key FTP_USERNAME=Your_FTP_username FTP_PASSWORD=Your_FTP_password
- Install the required dependencies by running
pip install -r requirements.txt
.
- Run
create_batch.py
with a CSV file containing email addresses as an argument to upload the file and validate the email list. - After running
create_batch.py
, it will print the list ID. Copy this ID. - Run
get_status.py
with the list ID as an argument to check the status of the list and download the processed file when it's ready.
This project uses the following Python libraries:
requests
: For making HTTP requests to the Debounce.io API.python-dotenv
: For loading environment variables from a.env
file.ftplib
: For uploading files to an FTP server. These dependencies are listed in therequirements.txt
file and can be installed usingpip install -r requirements.txt
.