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:
- Clone the repo with
git clone https://github.com/kuco23/Chat-Portal.git. - Set up your virtual environment with
python -m venv .venvthen runsource .venv/bin/activateon Linux or.venv/Scripts/activateon Windows. - Install dependencies with
pip install -r requirements.txt. - Create
.envfile and fill in the fields specified in.env.template. - 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
instagrapidependency. If using this package with it, you need to install it manually withpip 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
IDatabaseinterface is implemented by theDatabaseclass, which is a wrapper around anSqlAlchemyorm. - The
ISocialPlatforminterface is implemented by theInstagramclass, which is a wrapper around the instagrapi library. You can implement more social media platforms inside thesrc/platformsfolder. - The
IPortalinterface is implemented by thePortalabstract class, which is inherited by theGptPortalclass. You can implement more portals inside thesrc/portalsfolder.
Metadata
Release files for chat-portal 0.2.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| chat_portal-0.2.8.tar.gz | 10.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chat_portal-0.2.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.8 kB
Release files / chat_portal-0.2.8.tar.gz
| Download URL | chat_portal-0.2.8.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8e466b43d1dd682c96516d78dfc38b47635ffa850ad71092e1f84bc928228cc
|
|
BLAKE2b-256 checksum How to use checksums |
ec1968eecc72bbf4c60cc1bd8f96f0bebdaafdc15ddd2ad81569165a76e925a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.10.12 Linux/5.15.146.1-microsoft-standard-WSL2
|
Release files / chat_portal-0.2.8-py3-none-any.whl
| Download URL | chat_portal-0.2.8-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64f79bdf33a033c3b2e1c11bc635d424b43dd4ccfb170765abbc549e04993a59
|
|
BLAKE2b-256 checksum How to use checksums |
f9c34a649f9744e2c687056b1a5bbf9da9f5e3a548b9623bcc3c341333440c7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.10.12 Linux/5.15.146.1-microsoft-standard-WSL2
|