
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
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.
To install the ChatMe package
pip install chatme
Create a Python script (e.g., server_script.py
) with the following content:
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:
python server_script.py
Create a Python script (e.g., client_script.py
) with the following content:
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:
python client_script.py
Here is an example of how to set up the server and client:
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()
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()
start_server
function. By default, it uses 0.0.0.0
and port 12345
.on_receive
callback function can be customized to handle received messages as needed.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.
This project is licensed under the MIT License.
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.
Thank you for using ChatMe! We hope it helps you in building your terminal-based chat applications.
FAQs
A simple Python package for terminal-based chat applications
We found that chatme demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.