Python Client for HipChat v1
Description
Easy peasy wrapper for the HipChat API v1. Exposes core URI endpoint wrapper and some basic methods for common integrations.
Dependencies
None beyond the Python standard library.
Usage
Install:
pip install python-simple-hipchat
Instantiate:
import hipchat hipster = hipchat.HipChat(token=YourHipChatToken)
Request a URI endpoint as described in the HipChat API docs:
hipster.method(url='method/url/', method="GET/POST", parameters={'name':'value', })
Example:
# List rooms
hipster.method('rooms/list')
# Post a message to a HipChat room
hipster.method('rooms/message', method='POST', parameters={'room_id': 8675309, 'from': 'HAL', 'message': 'All your base...'})
API Sugar
To send a message to a room, either a Notification or Admin token can be used. All other methods require an Admin token. See HipChat’s auth docs for more information.
Send a message to a room:
room_id = 8675309 from_name = 'HAL' message = 'All your base...' hipster.message_room(room_id, from_name, message) # per HipChat, color can be "yellow", "red", "green", "purple", "gray", or "random" message_color = 'gray' hipster.message_room(room_id, from_name, message, color=message_color) # notify users in the room message_color = 'red' hipster.message_room(room_id, from_name, message, color=message_color, notify=True)
List rooms:
hipster.list_rooms()
Find room by name:
room = hipster.find_room('Room Name')
print "Room Name has room id = %s" % (room['room_id'])
List users:
hipster.list_users()
Find user by name:
user = hipster.find_user('Raleigh Becket')
print "Raleigh Becket's status is = %s" % (user['status'])
Changelog
v0.4.x
Added shortcut method for single room info (thanks @claudyus)
Renamed GitHub repo
v0.3.x
Added shortcut method for listing users (thanks @Raizex)
Added shortcut method for finding user by name (thanks @Raizex)
Added shortcut method for finding room by name (thanks @Raizex)
Added trove classifiers (thanks @ghickman)
v0.2.x
Added Python 3 support without losing support for Python 2 (thanks @pimterry)
Expose timeout for safer synchronous use (thanks @zachsnow)
v0.1.x
Added shortcut method for messaging a room
Added shortcut method for listing rooms
Metadata
Release files for python-simple-hipchat 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python-simple-hipchat-0.4.0.tar.gz | 4.0 kB | Without provenance | Details for python-simple-hipchat-0.4.0.tar.gz |
Release files / python-simple-hipchat-0.4.0.tar.gz
| Download URL | python-simple-hipchat-0.4.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5bbd1c749420ac84f762ceb9eee0373320491244cfbd5e3b6152162473bec67f
|
|
BLAKE2b-256 checksum How to use checksums |
4254c3394b66695be719ee5890be3205060c701f94bf76da9937d622929b5e9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for python-simple-hipchat 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.