MailSpreader is a Python command-line tool to automate LinkedIn-based mailings. It collects company profiles, extracts metadata, finds emails, generates summaries, and exports data into a spreadsheet-ready format.
Clone and install directly from GitHub:
pip install git+https://github.com/mpek29/MailSpreadermail-spreader [OPTIONS] COMMAND [ARGS]...--install-completionβ Install shell completion for the current shell--show-completionβ Show shell completion script--helpβ Show this message and exit
| Command | Description |
|---|---|
list-industries-to-linkedin-url |
Convert a list of industries into LinkedIn URLs |
linkedin-url-to-profil-json |
Convert LinkedIn URLs into a JSON list of company profile URLs |
profil-url-to-metadata-json |
Convert company profile URLs into JSON metadata |
metadata-json-to-email-json-auto |
Generate a JSON of emails from metadata JSON (automatic mode) |
metadata-json-to-email-json-manual |
Generate a JSON of emails from metadata JSON (manual/operator-assisted) |
metadata-json-to-summaries-json |
Generate a JSON of business summaries from metadata and config |
summaries-json-en-to-fr |
Translate summaries JSON from English to French |
metadata-email-json-to-spreadsheet |
Merge metadata, email, and summaries JSON into a CSV spreadsheet |
This repository includes a collection of .yaml files that contain various industries available as filters on LinkedIn. These files, referred to as "list of industries files," enable users to target specific industries for job applications. You can find these files in the following directory: src/mail_spreader/templates/job/.
To customize your experience, you have the option to create your own "list of industries" .yaml file to better suit your needs.
The following command converts a specified industries .yaml file into a corresponding LinkedIn search URL. The generated URL will be saved in a file named urls.yaml.
mail-spreader list-industries-to-linkedin-url .\templates\job\electronics_industries.yaml -o urls.yamlThis command processes the electronics_industries.yaml file and creates a LinkedIn search URL that targets the specified industries.
The URL generated previously does not include a location filter. To customize it, simply open the URL and add your desired location.
Next, you can add the updated URL along with your LinkedIn credentials to the config.yaml file, located in the following directory: src/mail_spreader/templates. For security reasons, consider creating a separate LinkedIn account to avoid potential bans.
Important: Ensure that the total number of pages in your LinkedIn search does not exceed 100 pages. If your search generates more than 100 pages, you will need to split the LinkedIn search URL into multiple URLs. One effective approach is to create separate URLs for each industry, location if possible, available job etc...
Once you have your URLs ready, you can add them to the config.yaml file in a YAML list format.
mail-spreader linkedin-url-to-profil-json .\templates\config.yaml -o profiles.jsonExtracts each company's profile URL from the LinkedIn search results contained in
config.yamland saves them to the specified JSON file.
mail-spreader profil-url-to-metadata-json config.yaml profiles.json -o metadata.jsonExtracts metadata from each company's LinkedIn profile URL β including company name, website, and company description.
mail-spreader split-companies metadata.json output_dir --chunk-size 50This command splits a JSON file containing
{ company_names, company_websites, company_about_texts }
into several synchronized JSON files, each containing a subset of the data.
mail-spreader metadata-json-to-email-json-auto metadata.json -o emails.jsonSearches each company's metadata for contact email addresses and saves the results to the specified JSON file automatically.
Important: Websites (and Chrome) may present CAPTCHAs during the process. When a CAPTCHA appears, solve it in the browser and then press Enter in the terminal to continue the email search.
mail-spreader metadata-json-to-email-json-manual metadata.json -o emails.jsonSame thing as before but manually.
mail-spreader metadata-json-to-summaries-json config.yaml metadata.json -o summaries.jsonGenerates a concise, human-readable summary of each company's "About" section using a small LLM β ideal for including in outreach emails.
mail-spreader summaries-json-en-to-fr summaries.json -o summaries_fr.jsonmail-spreader metadata-email-json-to-spreadsheet metadata.json emails.json summaries.json -o prospects.csvOrganises all the data for each company (name, summary, email) into a specified csv file ready for use.
This project is open-source. Feel free to use, modify, and contribute! π
