Skip to main content

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for group2p 0.3.0
File Size Uploaded
group2p-0.3.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for group2p 0.3.0
File Interpreter ABI Platform
group2p-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / group2p-0.3.0.tar.gz

Download URL group2p-0.3.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b4fc2a912da72fcb78e9a8071a7422f7aa86c937a984d436a2ae76cc20e9303a
BLAKE2b-256 checksum
How to use checksums
ec15fd5d3d1efc32be8b0157979bfa5e381c7ce5b351c3953037f6a57b936ad6
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.0-py3-none-any.whl

Download URL group2p-0.3.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d8dedfe66bfb0c7fb84dedb434ce02526e8d23c72895215f6d20437726b443f
BLAKE2b-256 checksum
How to use checksums
0fa42c4eeb4bef397b0ede617c4905c9282547f3d5363af475e71cadf4edb6c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.1

2 release files

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page