# Chat Portal
[![PyPI version](https://badge.fury.io/py/chat_portal.svg)](https://pypi.org/project/chat_portal)
This code automates a social media profile and makes it functions as a message exchange portal. It monitors incoming messages, pairs users based on their message content, and then relays each new message between paired users. The current implementation uses Instagram as a social platform and chatGPT to modify relayed messages in a way that makes it seem like they are comming from the automated profile.
> Python >= 3.10 is required.
## Standalone usage
Follow the below steps to set up this project:
1. Clone the repo with `git clone https://github.com/kuco23/Chat-Portal.git`.
1. Set up your virtual environment with `python -m venv .venv` then run `source .venv/bin/activate` on Linux or `.venv/Scripts/activate` on Windows.
1. Install dependencies with `pip install -r requirements.txt`.
1. Create `.env` file and fill in the fields specified in `.env.template`.
1. Run the program with `python run.py`.
Note that you can also modify the default configuration parameters inside `config.cfg`
> **WARN**
> The package ships without the `instagrapi` dependency. If using this package with it, you need to install it manually with `pip install instagrapi`.
## Use as package
To use this project as a package in your own project, you can install it with `pip install chat-portal`.
## Code architecture
The code is modular, cosisting of parts described by interfaces inside `src/interface.py`. The main code module is the `Portal` class with the `IPortal` interface, which is initialized by a `IDatabase` interfaced class and an `ISocialPlatform` interfaced class.
- The `IDatabase` interface is implemented by the `Database` class, which is a wrapper around an `SqlAlchemy` orm.
- The `ISocialPlatform` interface is implemented by the `Instagram` class, which is a wrapper around the [instagrapi](https://github.com/subzeroid/instagrapi) library. You can implement more social media platforms inside the `src/platforms` folder.
- The `IPortal` interface is implemented by the `Portal` abstract class, which is inherited by the `GptPortal` class. You can implement more portals inside the `src/portals` folder.
Raw data
{
"_id": null,
"home_page": "https://github.com/kuco23/chat-portal/",
"name": "chat-portal",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "kuco23",
"author_email": "nseverkar@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ec/19/68eecc72bbf4c60cc1bd8f96f0bebdaafdc15ddd2ad81569165a76e925a8/chat_portal-0.2.8.tar.gz",
"platform": null,
"description": "# Chat Portal\n[![PyPI version](https://badge.fury.io/py/chat_portal.svg)](https://pypi.org/project/chat_portal)\n\nThis code automates a social media profile and makes it functions as a message exchange portal. It monitors incoming messages, pairs users based on their message content, and then relays each new message between paired users. The current implementation uses Instagram as a social platform and chatGPT to modify relayed messages in a way that makes it seem like they are comming from the automated profile.\n\n> Python >= 3.10 is required.\n\n## Standalone usage\n\nFollow the below steps to set up this project:\n\n1. Clone the repo with `git clone https://github.com/kuco23/Chat-Portal.git`.\n1. Set up your virtual environment with `python -m venv .venv` then run `source .venv/bin/activate` on Linux or `.venv/Scripts/activate` on Windows.\n1. Install dependencies with `pip install -r requirements.txt`.\n1. Create `.env` file and fill in the fields specified in `.env.template`.\n1. Run the program with `python run.py`.\n\nNote that you can also modify the default configuration parameters inside `config.cfg`\n\n> **WARN**\n> The package ships without the `instagrapi` dependency. If using this package with it, you need to install it manually with `pip install instagrapi`.\n\n## Use as package\n\nTo use this project as a package in your own project, you can install it with `pip install chat-portal`.\n\n## Code architecture\n\nThe code is modular, cosisting of parts described by interfaces inside `src/interface.py`. The main code module is the `Portal` class with the `IPortal` interface, which is initialized by a `IDatabase` interfaced class and an `ISocialPlatform` interfaced class.\n\n- The `IDatabase` interface is implemented by the `Database` class, which is a wrapper around an `SqlAlchemy` orm.\n- The `ISocialPlatform` interface is implemented by the `Instagram` class, which is a wrapper around the [instagrapi](https://github.com/subzeroid/instagrapi) library. You can implement more social media platforms inside the `src/platforms` folder.\n- The `IPortal` interface is implemented by the `Portal` abstract class, which is inherited by the `GptPortal` class. You can implement more portals inside the `src/portals` folder.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Pair a profile's message contacts and transport modified messages that pretend to come from the initial profile",
"version": "0.2.8",
"project_urls": {
"Homepage": "https://github.com/kuco23/chat-portal/",
"Repository": "https://github.com/kuco23/chat-portal/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f9c34a649f9744e2c687056b1a5bbf9da9f5e3a548b9623bcc3c341333440c7e",
"md5": "69d00187a4c2c284f39c229659e2bd89",
"sha256": "64f79bdf33a033c3b2e1c11bc635d424b43dd4ccfb170765abbc549e04993a59"
},
"downloads": -1,
"filename": "chat_portal-0.2.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "69d00187a4c2c284f39c229659e2bd89",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 12965,
"upload_time": "2024-04-07T18:21:21",
"upload_time_iso_8601": "2024-04-07T18:21:21.753588Z",
"url": "https://files.pythonhosted.org/packages/f9/c3/4a649f9744e2c687056b1a5bbf9da9f5e3a548b9623bcc3c341333440c7e/chat_portal-0.2.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ec1968eecc72bbf4c60cc1bd8f96f0bebdaafdc15ddd2ad81569165a76e925a8",
"md5": "1451a1dc0a05b7459e708659bc825e45",
"sha256": "b8e466b43d1dd682c96516d78dfc38b47635ffa850ad71092e1f84bc928228cc"
},
"downloads": -1,
"filename": "chat_portal-0.2.8.tar.gz",
"has_sig": false,
"md5_digest": "1451a1dc0a05b7459e708659bc825e45",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 10833,
"upload_time": "2024-04-07T18:21:23",
"upload_time_iso_8601": "2024-04-07T18:21:23.559369Z",
"url": "https://files.pythonhosted.org/packages/ec/19/68eecc72bbf4c60cc1bd8f96f0bebdaafdc15ddd2ad81569165a76e925a8/chat_portal-0.2.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-07 18:21:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kuco23",
"github_project": "chat-portal",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "python-dotenv",
"specs": [
[
"==",
"\"1.0.0\""
]
]
},
{
"name": "SQLAlchemy",
"specs": [
[
"==",
"\"2.0.23\""
]
]
},
{
"name": "SQLAlchemy-Utis",
"specs": [
[
"==",
"\"0.41.1\""
]
]
},
{
"name": "openai",
"specs": [
[
"==",
"\"1.6.1\""
]
]
},
{
"name": "Pillow",
"specs": [
[
"==",
"\"10.1.\""
]
]
},
{
"name": "instagrapi",
"specs": [
[
"==",
"\"^2.1.1\""
]
]
}
],
"lcname": "chat-portal"
}