GrouP2P
GrouP2P is a Python module that provides developers the ability to use GroupMe as a communication protocol rather than using a self-owned server or a premium hosting service.
Why GrouP2P?
GrouP2P is not the only method of establishing user connections, as techniques like hole-punching exist. The key difference between GrouP2P and hole-punching, however, is that hole-punching may require end users to tweak their router configuration. This is not intuitive for the average consumer, so GrouP2P aims to circumvent that by using simple HTTP requests to send and receive data.
The GrouP2P class is the top-level class that can be solely used to interact with GroupMe. The basic features, such as creating, deleting, or joining groups, are available from a function call. Also included are a listener for new messages and a message sender.
GrouP2P was designed to be a foundation for developers to build from, so the GroupMeAPI class allows developers to streamline the process of making HTTP requests to additional GroupMe API functions.
Usage
To begin using GrouP2P, use the following command to install the package:
pip install group2p
Once installed, importing "group2p" into your code will give you access to the complete module.
The GrouP2P class contains all of the top-level functions needed to interact with the GroupMe API. Initializing the object with a string containing your developer token will begin an attempt to establish a connection to the server under the user ID associated with the token. This can be accessed by the userID property.
Config
The CONFIG_FILENAME file is accessed by the config property and manipulated by the set_config() and get_config() functions.
set_config() takes an option as a string to be used for the key and any type for the value.
get_config() takes an option as a string to be used as the key to access a particular value in the JSON.
Example
The following code can be used to create a new group and send a message. example_basic.py and example_game.py both expand on this to create full programs. Currently, the example game hasn't been fully tested, so there may be some issues.
from group2p import group2p
handle = group2p.GrouP2P()
response = handle.create_group(name="GrouP2P test")
groupID = response.json()["response"]["id"]
handle.send("Hello World!", groupID)
Metadata
Release files for group2p 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| group2p-0.3.1.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| group2p-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 kB
Release files / group2p-0.3.1.tar.gz
| Download URL | group2p-0.3.1.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0667601ca2d1ee266b4b8f4e7b308587483242d28267bb4f4e6ba2f64cb3c540
|
|
BLAKE2b-256 checksum How to use checksums |
bcbb2d07455179e5c1be0c7f28761e9367f25de6dcd9beaa0e2c243c8c417a56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.2
|
Release files / group2p-0.3.1-py3-none-any.whl
| Download URL | group2p-0.3.1-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f786fc21fe85b603b0512bfd8244975ff06d7f7522a48452828445111f94f3b
|
|
BLAKE2b-256 checksum How to use checksums |
09759a4f2bfd3a1c727abd40aa4ccbcb520d02dc68cfdce054d8e70d3c110eae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.2
|