GithubHelp home page GithubHelp logo

ojp98 / python-xmpp-client Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 2.66 MB

Simple XMPP chat client application made with python 3 and the SleekXMPP library

License: MIT License

Python 100.00%
python xml xmpp sleekxmpp chat

python-xmpp-client's Introduction

Python-XMPP-Client

Minimal XMPP chat client-application made with python and SleekXMPP.

Requirements

  • Python 3.1+

Installation guide

Optional: It's better if you try this in a python virtual enviroment.

  1. Clone this repo with the following url https://github.com/OJP98/Python-XMPP-Client
  2. With you favorite terminal, access the folder containing the source code and install the dependencies with the command pip install -r requirements.txt
  3. Run the main code with python main.py

Features

This client provides basic features like sending messages, receiving messages and other essential chat-application stuff; all throughout a basic python CLI program.

  • Register an account or login to an existing one.
  • Show all users registered to the server & show your roster.
  • Add a user to the roster/contact list.
  • Get any user details (search).
  • Send a private message to any user.
  • Group chat options:
    • Create a group.
    • Join an existing group.
    • Send a message to a group.
    • Leave a group you are part of.
  • Send a presence message (define show and status).
  • Send any file to a contact.
  • Log out of your account.
  • Delete account from server.
  • Send/Receive notifications

How to

File transfer

  1. Select option 7 once you logged in.
  2. Select the contact you want to send the file to.
  3. If tkinter is installed, a file explorer will pop up in order for you to select a file. Otherwise, enter the path with regular slashes, like this example:

C:/Users/User/Desktop/file.txt

If you receive a file, it'll stored in the received_files folder with the name the user sent you.

Notifications

There are several types of notifications, you'll receive them from the console with a format similar to this one:

|=================| NOTIFICATION TYPE |=================|

The notifications you can get are:

  • NOW ONLINE: When a user gets online.
  • MESSAGE When a user sends you a message.
  • FILE TRANSFER When a user requests a file transfer.
  • SUSCRIPTION When a user subscribes to your presence or you subscribe to someone elses.
  • GROUPCHAT When someone in a groupchat you're in changes its status or sends a message.

There are also other types of logs, but those are not interacting with another user directly or are not as important as the ones described.

Useful notes

  • In order to read any message that a user sent you, first you must "send a private message" or "send a message to a group" and then select the desired user/room. This will show you a list containing all the messages managed throughout the session (if any). You may then skip sending a message back by just pressing enter, without entering any text on the input.
  • Installing the versions specified in requirements.txt is HIGHLY RECOMMENDED due to some bugs that SleekXMPP latest version contains. That's why it's recommended to set up a virtual enviroment.
  • This project DOES NOT handle all of the errors from the server. Actually, some features might not work as desired with other created clients.
  • This project was developed using python 3.7.1

Main scripts

  • Main.py: it's the main program. In this file, you interact with the console and the XMPP client indirectly.
  • client.py "backend" file used for most of the implementation. Here you can find the Client class, which is used to manage all XMPP events, some prints and the main utility of the sleekXMPP library.
  • consts.py Just contains some constants so that main code looks cleaner.

Developer

  • Oscar Juárez

Universidad del Valle de Guatemala - 2020

License

MIT license, Copyright (c) 2020 Oscar Juárez.

python-xmpp-client's People

Contributors

ojp98 avatar

Watchers

 avatar  avatar

Forkers

gregory-k

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.