simplelinkedin


Namesimplelinkedin JSON
Version 1.5.0 PyPI version JSON
download
home_pagehttps://github.com/TheConfused/LinkedIn
SummaryPython package to automate activities on LinkedIn.
upload_time2023-09-17 15:45:55
maintainer
docs_urlNone
authorVishal Kumar Mishra
requires_python>=3.10,<4.0
licenseMIT
keywords linkedin simplelinkedin selenium linkedin automation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SimpleLinkedIn

Elevate your LinkedIn game with **SimpleLinkedIn**, 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.

**Note**: **SimpleLinkedIn** has been tested on macOS and is expected to work on Linux/Unix environments as well. If you encounter any issues while running the scripts, feel free to raise an issue or submit a pull request.

### Getting Started

To get started with **SimpleLinkedIn**, first, install the package from PyPi using the following command:

```bash
pip install simplelinkedin
```

Next, you can run and test the package by creating a script similar to `samplelinkedin/scripts/sample_script.py`. Start by running your script with `LINKEDIN_BROWSER_HEADLESS=0` to ensure everything works as expected. Once you're confident, switch to `LINKEDIN_BROWSER_HEADLESS=1` to run your script in the background.

Here's a simplified example of running **SimpleLinkedIn**:

```python
from simplelinkedin.linkedin import LinkedIn

settings = {
    "LINKEDIN_USER": "<your_username>",
    "LINKEDIN_PASSWORD": "<your_password>",
    "LINKEDIN_BROWSER": "Chrome",
    "LINKEDIN_BROWSER_HEADLESS": 0,
    "LINKEDIN_PREFERRED_USER": "/path/to/preferred/user/text_doc.text",
    "LINKEDIN_NOT_PREFERRED_USER": "/path/to/not/preferred/user/text_doc.text",
}

with LinkedIn(
        username=settings.get("LINKEDIN_USER"),
        password=settings.get("LINKEDIN_PASSWORD"),
        browser=settings.get("LINKEDIN_BROWSER"),
        headless=bool(settings.get("LINKEDIN_BROWSER_HEADLESS")),
) as ln:
    # Perform LinkedIn actions here
    ln.login()
    ln.remove_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"],  # file_path or list of features
        not_preferred_users=["Sportsman"],  # 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=settings.get("LINKEDIN_PREFERRED_USER") or [],
        users_not_preferred=settings.get("LINKEDIN_NOT_PREFERRED_USER") or [],
    )
```

### Command Line Usage

**SimpleLinkedIn** provides a convenient command-line interface for easy interaction. You can execute tasks directly from the command line with options like:

```bash
python -m simplelinkedin -h
```

This command will display a list of available options, allowing you to configure and execute LinkedIn tasks without writing scripts.

### Setting Up Cron Jobs

To schedule recurring tasks, you can set up cron jobs using **SimpleLinkedIn**. Here's how:

1. Start with the following commands. (Use `example.env` as a reference while setting `.env` values)

```bash
python -m simplelinkedin --env .env
```

2. You can supply `--rmcron` to remove existing cron jobs:

```bash
python -m simplelinkedin --rmcron --cronuser osuser
```

3. To create a new cron job, specify the desired settings:

```bash
python -m simplelinkedin --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

**SimpleLinkedIn** heavily relies on another package named [SimpleSelenium](https://github.com/inquilabee/simpleselenium). Feel free to explore that package for additional functionality.

### TODOs

- Enhance documentation
- Include comprehensive tests

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/TheConfused/LinkedIn",
    "name": "simplelinkedin",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<4.0",
    "maintainer_email": "",
    "keywords": "linkedin,simplelinkedin,selenium,linkedin automation",
    "author": "Vishal Kumar Mishra",
    "author_email": "vishal.k.mishra2@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6e/ba/2274cd8f26a71350e53f3c425f801695a9b8454dc37eeff11cfe915bf0b5/simplelinkedin-1.5.0.tar.gz",
    "platform": null,
    "description": "# SimpleLinkedIn\n\nElevate your LinkedIn game with **SimpleLinkedIn**, 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\n**Note**: **SimpleLinkedIn** has been tested on macOS and is expected to work on Linux/Unix environments as well. If you encounter any issues while running the scripts, feel free to raise an issue or submit a pull request.\n\n### Getting Started\n\nTo get started with **SimpleLinkedIn**, first, install the package from PyPi using the following command:\n\n```bash\npip install simplelinkedin\n```\n\nNext, you can run and test the package by creating a script similar to `samplelinkedin/scripts/sample_script.py`. Start by running your script with `LINKEDIN_BROWSER_HEADLESS=0` to ensure everything works as expected. Once you're confident, switch to `LINKEDIN_BROWSER_HEADLESS=1` to run your script in the background.\n\nHere's a simplified example of running **SimpleLinkedIn**:\n\n```python\nfrom simplelinkedin.linkedin import LinkedIn\n\nsettings = {\n    \"LINKEDIN_USER\": \"<your_username>\",\n    \"LINKEDIN_PASSWORD\": \"<your_password>\",\n    \"LINKEDIN_BROWSER\": \"Chrome\",\n    \"LINKEDIN_BROWSER_HEADLESS\": 0,\n    \"LINKEDIN_PREFERRED_USER\": \"/path/to/preferred/user/text_doc.text\",\n    \"LINKEDIN_NOT_PREFERRED_USER\": \"/path/to/not/preferred/user/text_doc.text\",\n}\n\nwith LinkedIn(\n        username=settings.get(\"LINKEDIN_USER\"),\n        password=settings.get(\"LINKEDIN_PASSWORD\"),\n        browser=settings.get(\"LINKEDIN_BROWSER\"),\n        headless=bool(settings.get(\"LINKEDIN_BROWSER_HEADLESS\")),\n) as ln:\n    # Perform LinkedIn actions here\n    ln.login()\n    ln.remove_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\"],  # file_path or list of features\n        not_preferred_users=[\"Sportsman\"],  # 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=settings.get(\"LINKEDIN_PREFERRED_USER\") or [],\n        users_not_preferred=settings.get(\"LINKEDIN_NOT_PREFERRED_USER\") or [],\n    )\n```\n\n### Command Line Usage\n\n**SimpleLinkedIn** 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 simplelinkedin -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### Setting Up Cron Jobs\n\nTo schedule recurring tasks, you can set up cron jobs using **SimpleLinkedIn**. 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 simplelinkedin --env .env\n```\n\n2. You can supply `--rmcron` to remove existing cron jobs:\n\n```bash\npython -m simplelinkedin --rmcron --cronuser osuser\n```\n\n3. To create a new cron job, specify the desired settings:\n\n```bash\npython -m simplelinkedin --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**SimpleLinkedIn** heavily relies on another package named [SimpleSelenium](https://github.com/inquilabee/simpleselenium). Feel free to explore that package for additional functionality.\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.5.0",
    "project_urls": {
        "Homepage": "https://github.com/TheConfused/LinkedIn",
        "Repository": "https://github.com/TheConfused/LinkedIn"
    },
    "split_keywords": [
        "linkedin",
        "simplelinkedin",
        "selenium",
        "linkedin automation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c167360d2522623b5baa5b26a05e8982513c8b71ab20b095a1f82d991ce2c3de",
                "md5": "9dfb243db21d455dc80454ab32e2b5df",
                "sha256": "75a62e83c58011233187f79008e64e364d558eda07c6033e05157e5a509a1659"
            },
            "downloads": -1,
            "filename": "simplelinkedin-1.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9dfb243db21d455dc80454ab32e2b5df",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<4.0",
            "size": 16831,
            "upload_time": "2023-09-17T15:45:53",
            "upload_time_iso_8601": "2023-09-17T15:45:53.776446Z",
            "url": "https://files.pythonhosted.org/packages/c1/67/360d2522623b5baa5b26a05e8982513c8b71ab20b095a1f82d991ce2c3de/simplelinkedin-1.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6eba2274cd8f26a71350e53f3c425f801695a9b8454dc37eeff11cfe915bf0b5",
                "md5": "17e53efe801b4dcbd9d9287df997c632",
                "sha256": "c3634f392a0dea8b8f1361e9cbfda883de40465790eabd38508274bd8620926f"
            },
            "downloads": -1,
            "filename": "simplelinkedin-1.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "17e53efe801b4dcbd9d9287df997c632",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<4.0",
            "size": 15038,
            "upload_time": "2023-09-17T15:45:55",
            "upload_time_iso_8601": "2023-09-17T15:45:55.927452Z",
            "url": "https://files.pythonhosted.org/packages/6e/ba/2274cd8f26a71350e53f3c425f801695a9b8454dc37eeff11cfe915bf0b5/simplelinkedin-1.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-17 15:45:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "TheConfused",
    "github_project": "LinkedIn",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "tox": true,
    "lcname": "simplelinkedin"
}
        
Elapsed time: 0.52483s