# AutoLinkedIn
Elevate your LinkedIn game with **AutoLinkedIn**, a Python package designed for automating routine LinkedIn tasks. Whether you want to connect with specific users, manage connection requests, or optimize your LinkedIn networking, this package has you covered.
### Key Features
- **Login to LinkedIn**: Seamlessly access your LinkedIn account.
- **Send Connection Requests**: Customize your connection requests by filtering users based on mutual connections, user types, and more.
- **Accept Connection Requests**: Simplify the process of accepting incoming connection requests.
- **Delete/Withdraw Sent Requests**: Keep your connection list clean by removing outdated sent requests.
- **Smart Follow-Unfollow**: Automatically manage connections, delete aged requests, and maximize your daily interactions within LinkedIn's limits.
- **Background Mode**: Run all tasks in the background mode without interfering with your regular work.
- **Search**: Search for people.
### Getting Started
To get started with **AutoLinkedIn**, first, install the package from PyPi using the following command:
```bash
pip install autolinkedin
```
Next, you can run and test the package by creating a script similar to `autolinkedin/scripts/sample_script.py`. Start by running your script with `headless=False` to ensure everything works as expected. Once you're confident, switch to `headless=True` to run your script in the background.
Here's a simplified example of running **AutoLinkedIn**:
```python
from autolinkedin.linkedin import LinkedIn
with LinkedIn(
username="<username/email>",
password="<pas$word>",
browser="<Chrome/Firefox>",
headless="<True/False>",
) as ln:
# Perform LinkedIn actions here
ln.withdraw_sent_invitations(older_than_days=14)
last_week_invitations = ln.count_invitations_sent_last_week()
ln.send_invitations(
max_invitations=max(ln.WEEKLY_MAX_INVITATION - last_week_invitations, 0),
min_mutual=10,
max_mutual=450,
preferred_users=["Quant", "Software"], # file_path or list of features
not_preferred_users=["Sportsman", "Doctor"], # file_path or list of features
view_profile=True, # (recommended) view profile of users you sent connection requests to
)
ln.accept_invitations()
# Customize your actions as needed
# ...
# Alternatively, use the smart follow-unfollow method for a streamlined approach
ln.smart_follow_unfollow(
min_mutual=0,
max_mutual=500,
withdraw_invite_older_than_days=14,
max_invitations_to_send=0,
users_preferred=["Quant"], # file_path or list of features
users_not_preferred=["Sportsman"], # file_path or list of features
remove_recommendations=True, # remove recommendations which do not match criteria
)
# Additional method
ln.remove_recommendations(min_mutual=10, max_mutual=500)
# Search for people
ln.search_people("Microsoft Recruiter")
```
### Command Line Usage
**AutoLinkedIn** provides a convenient command-line interface for easy interaction. You can execute tasks directly from the command line with options like:
```bash
python -m autolinkedin -h
```
This command will display a list of available options, allowing you to configure and execute LinkedIn tasks without writing scripts.
```bash
> python -m autolinkedin -h
usage: autolinkedin [-h] [--env ENV] [--email EMAIL] [--password PASSWORD] [--browser BROWSER] [--headless] [--maxinvite MAXINVITE] [--minmutual MINMUTUAL] [--maxmutual MAXMUTUAL] [--withdrawdays WITHDRAWDAYS]
[--preferred PREFERRED] [--notpreferred NOTPREFERRED] [--cronfile CRONFILE] [--cronuser CRONUSER] [--rmcron | --no-rmcron] [--cronhour CRONHOUR]
options:
-h, --help show this help message and exit
--env ENV Linkedin environment file
--email EMAIL Email of LinkedIn user
--password PASSWORD Password of LinkedIn user
--browser BROWSER Browser used for LinkedIn
--headless Whether to run headless (i.e. without the browser visible in the front.)
--maxinvite MAXINVITE
Maximum number of invitations to send
--minmutual MINMUTUAL
Minimum number of mutual connections required.
--maxmutual MAXMUTUAL
Maximum number of mutual connections required.
--withdrawdays WITHDRAWDAYS
Withdraw invites older than this many days
--preferred PREFERRED
Path to file containing preferred users characteristics
--notpreferred NOTPREFERRED
Path to file containing characteristics of not preferred users
--cronfile CRONFILE Path to cronfile
--cronuser CRONUSER Name of user setting cron on the machine (needed by most OS)
--rmcron, --no-rmcron
Whether to remove existing crons.
--cronhour CRONHOUR hour of the day you want to set cron for each day.
```
### Setting Up Cron Jobs
To schedule recurring tasks, you can set up cron jobs using **AutoLinkedIn**. Here's how:
1. Start with the following commands. (Use `example.env` as a reference while setting `.env` values)
```bash
python -m autolinkedin --env .env
```
2. You can supply `--rmcron` to remove existing cron jobs:
```bash
python -m autolinkedin --rmcron --cronuser osuser
```
3. To create a new cron job, specify the desired settings:
```bash
python -m autolinkedin --cronfile .cron.env --cronuser osuser --cronhour 23
```
These cron jobs enable you to automate your LinkedIn tasks at specific times, enhancing your networking efficiency.
### Extras
**AutoLinkedIn** heavily relies on another package I authored named [SeleniumTabs](https://github.com/inquilabee/selenium-tabs). Feel free to explore that package for additional functionality.
### example.env
```bash
LINKEDIN_USER=
LINKEDIN_PASSWORD=
LINKEDIN_BROWSER=Chrome
LINKEDIN_BROWSER_HEADLESS=1
LINKEDIN_PREFERRED_USER=data/users_preferred.txt
LINKEDIN_NOT_PREFERRED_USER=data/users_not_preferred.txt
LINKEDIN_MIN_MUTUAL=0
LINKEDIN_MAX_MUTUAL=500
LINKEDIN_MAX_INVITE=0
LINKEDIN_WITHDRAW_INVITE_BEFORE_DAYS=14
```
### TODOs
- Enhance documentation
- Include comprehensive tests
Raw data
{
"_id": null,
"home_page": "https://github.com/inquilabee/LinkedinPy",
"name": "autolinkedin",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "linkedin,autolinkedin,selenium,linkedin automation",
"author": "Vishal Kumar Mishra",
"author_email": "vishal.k.mishra2@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f8/fe/4742adcacd250f9d96e55674dfce14d9ed30e9686d90e1ac051377b75db2/autolinkedin-1.6.4.tar.gz",
"platform": null,
"description": "# AutoLinkedIn\n\nElevate your LinkedIn game with **AutoLinkedIn**, a Python package designed for automating routine LinkedIn tasks. Whether you want to connect with specific users, manage connection requests, or optimize your LinkedIn networking, this package has you covered.\n\n### Key Features\n\n- **Login to LinkedIn**: Seamlessly access your LinkedIn account.\n- **Send Connection Requests**: Customize your connection requests by filtering users based on mutual connections, user types, and more.\n- **Accept Connection Requests**: Simplify the process of accepting incoming connection requests.\n- **Delete/Withdraw Sent Requests**: Keep your connection list clean by removing outdated sent requests.\n- **Smart Follow-Unfollow**: Automatically manage connections, delete aged requests, and maximize your daily interactions within LinkedIn's limits.\n- **Background Mode**: Run all tasks in the background mode without interfering with your regular work.\n- **Search**: Search for people.\n\n\n### Getting Started\n\nTo get started with **AutoLinkedIn**, first, install the package from PyPi using the following command:\n\n```bash\npip install autolinkedin\n```\n\nNext, you can run and test the package by creating a script similar to `autolinkedin/scripts/sample_script.py`. Start by running your script with `headless=False` to ensure everything works as expected. Once you're confident, switch to `headless=True` to run your script in the background.\n\nHere's a simplified example of running **AutoLinkedIn**:\n\n```python\nfrom autolinkedin.linkedin import LinkedIn\n\n\nwith LinkedIn(\n username=\"<username/email>\",\n password=\"<pas$word>\",\n browser=\"<Chrome/Firefox>\",\n headless=\"<True/False>\",\n) as ln:\n # Perform LinkedIn actions here\n ln.withdraw_sent_invitations(older_than_days=14)\n last_week_invitations = ln.count_invitations_sent_last_week()\n\n ln.send_invitations(\n max_invitations=max(ln.WEEKLY_MAX_INVITATION - last_week_invitations, 0),\n min_mutual=10,\n max_mutual=450,\n preferred_users=[\"Quant\", \"Software\"], # file_path or list of features\n not_preferred_users=[\"Sportsman\", \"Doctor\"], # file_path or list of features\n view_profile=True, # (recommended) view profile of users you sent connection requests to\n )\n\n ln.accept_invitations()\n\n # Customize your actions as needed\n # ...\n\n # Alternatively, use the smart follow-unfollow method for a streamlined approach\n ln.smart_follow_unfollow(\n min_mutual=0,\n max_mutual=500,\n withdraw_invite_older_than_days=14,\n max_invitations_to_send=0,\n users_preferred=[\"Quant\"], # file_path or list of features\n users_not_preferred=[\"Sportsman\"], # file_path or list of features\n remove_recommendations=True, # remove recommendations which do not match criteria\n )\n\n # Additional method\n ln.remove_recommendations(min_mutual=10, max_mutual=500)\n\n # Search for people\n ln.search_people(\"Microsoft Recruiter\")\n```\n\n### Command Line Usage\n\n**AutoLinkedIn** provides a convenient command-line interface for easy interaction. You can execute tasks directly from the command line with options like:\n\n```bash\npython -m autolinkedin -h\n```\n\nThis command will display a list of available options, allowing you to configure and execute LinkedIn tasks without writing scripts.\n\n```bash\n> python -m autolinkedin -h\nusage: autolinkedin [-h] [--env ENV] [--email EMAIL] [--password PASSWORD] [--browser BROWSER] [--headless] [--maxinvite MAXINVITE] [--minmutual MINMUTUAL] [--maxmutual MAXMUTUAL] [--withdrawdays WITHDRAWDAYS]\n [--preferred PREFERRED] [--notpreferred NOTPREFERRED] [--cronfile CRONFILE] [--cronuser CRONUSER] [--rmcron | --no-rmcron] [--cronhour CRONHOUR]\n\noptions:\n -h, --help show this help message and exit\n --env ENV Linkedin environment file\n --email EMAIL Email of LinkedIn user\n --password PASSWORD Password of LinkedIn user\n --browser BROWSER Browser used for LinkedIn\n --headless Whether to run headless (i.e. without the browser visible in the front.)\n --maxinvite MAXINVITE\n Maximum number of invitations to send\n --minmutual MINMUTUAL\n Minimum number of mutual connections required.\n --maxmutual MAXMUTUAL\n Maximum number of mutual connections required.\n --withdrawdays WITHDRAWDAYS\n Withdraw invites older than this many days\n --preferred PREFERRED\n Path to file containing preferred users characteristics\n --notpreferred NOTPREFERRED\n Path to file containing characteristics of not preferred users\n --cronfile CRONFILE Path to cronfile\n --cronuser CRONUSER Name of user setting cron on the machine (needed by most OS)\n --rmcron, --no-rmcron\n Whether to remove existing crons.\n --cronhour CRONHOUR hour of the day you want to set cron for each day.\n```\n\n### Setting Up Cron Jobs\n\nTo schedule recurring tasks, you can set up cron jobs using **AutoLinkedIn**. Here's how:\n\n1. Start with the following commands. (Use `example.env` as a reference while setting `.env` values)\n\n```bash\npython -m autolinkedin --env .env\n```\n\n2. You can supply `--rmcron` to remove existing cron jobs:\n\n```bash\npython -m autolinkedin --rmcron --cronuser osuser\n```\n\n3. To create a new cron job, specify the desired settings:\n\n```bash\npython -m autolinkedin --cronfile .cron.env --cronuser osuser --cronhour 23\n```\n\nThese cron jobs enable you to automate your LinkedIn tasks at specific times, enhancing your networking efficiency.\n\n### Extras\n\n**AutoLinkedIn** heavily relies on another package I authored named [SeleniumTabs](https://github.com/inquilabee/selenium-tabs). Feel free to explore that package for additional functionality.\n\n### example.env\n\n```bash\nLINKEDIN_USER=\nLINKEDIN_PASSWORD=\nLINKEDIN_BROWSER=Chrome\nLINKEDIN_BROWSER_HEADLESS=1\nLINKEDIN_PREFERRED_USER=data/users_preferred.txt\nLINKEDIN_NOT_PREFERRED_USER=data/users_not_preferred.txt\nLINKEDIN_MIN_MUTUAL=0\nLINKEDIN_MAX_MUTUAL=500\nLINKEDIN_MAX_INVITE=0\nLINKEDIN_WITHDRAW_INVITE_BEFORE_DAYS=14\n```\n\n### TODOs\n\n- Enhance documentation\n- Include comprehensive tests\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python package to automate activities on LinkedIn.",
"version": "1.6.4",
"project_urls": {
"Homepage": "https://github.com/inquilabee/LinkedinPy",
"Repository": "https://github.com/inquilabee/LinkedinPy"
},
"split_keywords": [
"linkedin",
"autolinkedin",
"selenium",
"linkedin automation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "29a372cd09e5e86b58acb0ce8a747e30c924eb7a56bb62847da2190034b88086",
"md5": "f8d10db838b48894db4e07b5009e0db8",
"sha256": "8fd320abc8b2e8e23605307b795b60d07b222d0c162b5ea864d3137d3e48f7f5"
},
"downloads": -1,
"filename": "autolinkedin-1.6.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f8d10db838b48894db4e07b5009e0db8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 18903,
"upload_time": "2023-10-11T16:03:19",
"upload_time_iso_8601": "2023-10-11T16:03:19.528353Z",
"url": "https://files.pythonhosted.org/packages/29/a3/72cd09e5e86b58acb0ce8a747e30c924eb7a56bb62847da2190034b88086/autolinkedin-1.6.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f8fe4742adcacd250f9d96e55674dfce14d9ed30e9686d90e1ac051377b75db2",
"md5": "3324b24539a18cfd2486b21f08c4bfcb",
"sha256": "34f3e0f667f48a88d5602baac110de7f12e7b34f1e83d284ccc4ec61b9c5c592"
},
"downloads": -1,
"filename": "autolinkedin-1.6.4.tar.gz",
"has_sig": false,
"md5_digest": "3324b24539a18cfd2486b21f08c4bfcb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 17184,
"upload_time": "2023-10-11T16:03:21",
"upload_time_iso_8601": "2023-10-11T16:03:21.493080Z",
"url": "https://files.pythonhosted.org/packages/f8/fe/4742adcacd250f9d96e55674dfce14d9ed30e9686d90e1ac051377b75db2/autolinkedin-1.6.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-11 16:03:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "inquilabee",
"github_project": "LinkedinPy",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "autolinkedin"
}