chatme


Namechatme JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/ByteBreach/chatme
SummaryA simple Python package for terminal-based chat applications
upload_time2024-07-16 17:15:39
maintainerNone
docs_urlNone
authorMrFidal
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ChatMe 1.0.0

ChatMe is a simple Python package for creating a terminal-based chat application. It allows two users to communicate through their terminals over a network. This package provides an easy-to-use API to set up both server and client for a chat application, enabling real-time text communication.

## Features

- Simple to set up and use
- Real-time chat functionality
- Can be integrated into other Python applications
- Customizable IP and port settings
- Multithreaded message receiving

## Installation

To install the ChatMe package

```bash
pip install chatme
```

## Usage

### Starting the Server

Create a Python script (e.g., `server_script.py`) with the following content:

```python
from chatme import start_server

def on_receive(message):
    print(f"Friend: {message}")

server_socket, client_socket = start_server(on_receive=on_receive)

while True:
    message = input("You: ")
    client_socket.send(message.encode())
    if message.lower() == "exit":
        break

client_socket.close()
server_socket.close()
```

Run the server script:

```bash
python server_script.py
```

### Starting the Client

Create a Python script (e.g., `client_script.py`) with the following content:

```python
from chatme import start_client

def on_receive(message):
    print(f"Friend: {message}")

server_ip = 'your_server_ip_here'
client_socket = start_client(server_ip, on_receive=on_receive)

while True:
    message = input("You: ")
    client_socket.send(message.encode())
    if message.lower() == "exit":
        break

client_socket.close()
```

Replace `'your_server_ip_here'` with the actual IP address of the server.

Run the client script:

```bash
python client_script.py
```

### Example

Here is an example of how to set up the server and client:

#### Server Script

```python
from chatme import start_server

def on_receive(message):
    print(f"Friend: {message}")

server_socket, client_socket = start_server(on_receive=on_receive)

while True:
    message = input("You: ")
    client_socket.send(message.encode())
    if message.lower() == "exit":
        break

client_socket.close()
server_socket.close()
```

#### Client Script

```python
from chatme import start_client

def on_receive(message):
    print(f"Friend: {message}")

server_ip = 'your_server_ip_here'
client_socket = start_client(server_ip, on_receive=on_receive)

while True:
    message = input("You: ")
    client_socket.send(message.encode())
    if message.lower() == "exit":
        break

client_socket.close()
```

### Customization

- **Local IP and Port:** You can customize the local IP and port for the server by passing them as arguments to the `start_server` function. By default, it uses `0.0.0.0` and port `12345`.
- **Callback Function:** The `on_receive` callback function can be customized to handle received messages as needed.

### Contributing

We welcome contributions to enhance the ChatMe package. If you have any suggestions, bug reports, or feature requests, please create an issue or submit a pull request on GitHub.

### License

This project is licensed under the MIT License.

### Acknowledgements

We would like to thank all the contributors and users of ChatMe. Your feedback and support are invaluable in making this project better. Special thanks to the open-source community for providing the tools and inspiration for this project.

### Contact

Thank you for using ChatMe! We hope it helps you in building your terminal-based chat applications.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ByteBreach/chatme",
    "name": "chatme",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "MrFidal",
    "author_email": "mrfidal@proton.me",
    "download_url": "https://files.pythonhosted.org/packages/5b/49/5ea8e97380687c31da509c3b8468030c8ef0c88175831bdfba03fa31df4e/chatme-1.0.0.tar.gz",
    "platform": null,
    "description": "# ChatMe 1.0.0\r\n\r\nChatMe is a simple Python package for creating a terminal-based chat application. It allows two users to communicate through their terminals over a network. This package provides an easy-to-use API to set up both server and client for a chat application, enabling real-time text communication.\r\n\r\n## Features\r\n\r\n- Simple to set up and use\r\n- Real-time chat functionality\r\n- Can be integrated into other Python applications\r\n- Customizable IP and port settings\r\n- Multithreaded message receiving\r\n\r\n## Installation\r\n\r\nTo install the ChatMe package\r\n\r\n```bash\r\npip install chatme\r\n```\r\n\r\n## Usage\r\n\r\n### Starting the Server\r\n\r\nCreate a Python script (e.g., `server_script.py`) with the following content:\r\n\r\n```python\r\nfrom chatme import start_server\r\n\r\ndef on_receive(message):\r\n    print(f\"Friend: {message}\")\r\n\r\nserver_socket, client_socket = start_server(on_receive=on_receive)\r\n\r\nwhile True:\r\n    message = input(\"You: \")\r\n    client_socket.send(message.encode())\r\n    if message.lower() == \"exit\":\r\n        break\r\n\r\nclient_socket.close()\r\nserver_socket.close()\r\n```\r\n\r\nRun the server script:\r\n\r\n```bash\r\npython server_script.py\r\n```\r\n\r\n### Starting the Client\r\n\r\nCreate a Python script (e.g., `client_script.py`) with the following content:\r\n\r\n```python\r\nfrom chatme import start_client\r\n\r\ndef on_receive(message):\r\n    print(f\"Friend: {message}\")\r\n\r\nserver_ip = 'your_server_ip_here'\r\nclient_socket = start_client(server_ip, on_receive=on_receive)\r\n\r\nwhile True:\r\n    message = input(\"You: \")\r\n    client_socket.send(message.encode())\r\n    if message.lower() == \"exit\":\r\n        break\r\n\r\nclient_socket.close()\r\n```\r\n\r\nReplace `'your_server_ip_here'` with the actual IP address of the server.\r\n\r\nRun the client script:\r\n\r\n```bash\r\npython client_script.py\r\n```\r\n\r\n### Example\r\n\r\nHere is an example of how to set up the server and client:\r\n\r\n#### Server Script\r\n\r\n```python\r\nfrom chatme import start_server\r\n\r\ndef on_receive(message):\r\n    print(f\"Friend: {message}\")\r\n\r\nserver_socket, client_socket = start_server(on_receive=on_receive)\r\n\r\nwhile True:\r\n    message = input(\"You: \")\r\n    client_socket.send(message.encode())\r\n    if message.lower() == \"exit\":\r\n        break\r\n\r\nclient_socket.close()\r\nserver_socket.close()\r\n```\r\n\r\n#### Client Script\r\n\r\n```python\r\nfrom chatme import start_client\r\n\r\ndef on_receive(message):\r\n    print(f\"Friend: {message}\")\r\n\r\nserver_ip = 'your_server_ip_here'\r\nclient_socket = start_client(server_ip, on_receive=on_receive)\r\n\r\nwhile True:\r\n    message = input(\"You: \")\r\n    client_socket.send(message.encode())\r\n    if message.lower() == \"exit\":\r\n        break\r\n\r\nclient_socket.close()\r\n```\r\n\r\n### Customization\r\n\r\n- **Local IP and Port:** You can customize the local IP and port for the server by passing them as arguments to the `start_server` function. By default, it uses `0.0.0.0` and port `12345`.\r\n- **Callback Function:** The `on_receive` callback function can be customized to handle received messages as needed.\r\n\r\n### Contributing\r\n\r\nWe welcome contributions to enhance the ChatMe package. If you have any suggestions, bug reports, or feature requests, please create an issue or submit a pull request on GitHub.\r\n\r\n### License\r\n\r\nThis project is licensed under the MIT License.\r\n\r\n### Acknowledgements\r\n\r\nWe would like to thank all the contributors and users of ChatMe. Your feedback and support are invaluable in making this project better. Special thanks to the open-source community for providing the tools and inspiration for this project.\r\n\r\n### Contact\r\n\r\nThank you for using ChatMe! We hope it helps you in building your terminal-based chat applications.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simple Python package for terminal-based chat applications",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/ByteBreach/chatme"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "baf9638704431a8ceb87f2a0aa94ad93a74b8175d4931e2af8960d01f93c8f3d",
                "md5": "138a62bea971e0c57adfa958e7382926",
                "sha256": "dc8c57075df33e0930c815193afd962bb27732bdd8c691d2375a00360854fec0"
            },
            "downloads": -1,
            "filename": "chatme-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "138a62bea971e0c57adfa958e7382926",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4126,
            "upload_time": "2024-07-16T17:15:14",
            "upload_time_iso_8601": "2024-07-16T17:15:14.229209Z",
            "url": "https://files.pythonhosted.org/packages/ba/f9/638704431a8ceb87f2a0aa94ad93a74b8175d4931e2af8960d01f93c8f3d/chatme-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5b495ea8e97380687c31da509c3b8468030c8ef0c88175831bdfba03fa31df4e",
                "md5": "6a8a2729bcfb5be217e5aa190a252e52",
                "sha256": "cd064b27f6dd22cd7e07a35bf4e0ac1e008f77bd02e16468b32b74488f92475b"
            },
            "downloads": -1,
            "filename": "chatme-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6a8a2729bcfb5be217e5aa190a252e52",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3559,
            "upload_time": "2024-07-16T17:15:39",
            "upload_time_iso_8601": "2024-07-16T17:15:39.384704Z",
            "url": "https://files.pythonhosted.org/packages/5b/49/5ea8e97380687c31da509c3b8468030c8ef0c88175831bdfba03fa31df4e/chatme-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-16 17:15:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ByteBreach",
    "github_project": "chatme",
    "github_not_found": true,
    "lcname": "chatme"
}
        
Elapsed time: 0.45198s