gitter

Gitter.im Web-API Bindings

Classes

AioGitterAPI(session, *args, **kwargs)

AioHTTP based implementation of GitterAPI

GitterAPI(token)

Sans-IO Base Class for Gitter API

Mention(screenName[, userId, userIds])

Gitter User Mention

Message(id, text, html, sent, fromUser, ...)

Gitter Chat Message

Room(id, name, topic, userCount, mentions, ...)

Gitter Chat Room

User(id, username, displayName, url, ...[, ...])

Gitter User

Documentation

class bioconda_utils.gitter.User(id: str, username: str, displayName: str, url: str, avatarUrl: str, avatarUrlSmall: str, avatarUrlMedium: str, v: str, gv: str, providers: Optional[List[str]] = None)[source]

Gitter User

Create new instance of User(id, username, displayName, url, avatarUrl, avatarUrlSmall, avatarUrlMedium, v, gv, providers)

classmethod from_dict(data)[source]

Create User from dict

property id

User ID

property username

Gitter username (OAUTH - Github/Gitlab)

property displayName

Gitter displayname (real name)

property url

Profile URL (relative)

property avatarUrl

Avatar URL

property avatarUrlSmall

Small avatar URL

property avatarUrlMedium

Medium avatar URL

property v

Version

property gv

Gravatar Version (used to force cache flushing)

property providers

List of OAUTH providers for user

class bioconda_utils.gitter.Mention(screenName: str, userId: Optional[str] = None, userIds: Optional[List[str]] = None)[source]

Gitter User Mention

Create new instance of Mention(screenName, userId, userIds)

classmethod from_dict(data)[source]

Create User from dict

property screenName

User Name

property userId

User ID

property userIds

User IDs

class bioconda_utils.gitter.Message(id: str, text: str, html: str, sent: str, fromUser: User, unread: bool, readBy: int, urls: List[str], mentions: List[Mention], issues: List[str], meta: str, v: str, gv: Optional[str] = None, editedAt: Optional[str] = None)[source]

Gitter Chat Message

Create new instance of Message(id, text, html, sent, fromUser, unread, readBy, urls, mentions, issues, meta, v, gv, editedAt)

classmethod from_dict(data)[source]

Create Message from dict

property id

Message ID

property text

Message content (markdown)

property html

Message content (HTML)

property sent

Posting timestamp (ISO)

property fromUser

User by whom message was sent

property unread

Flag indicating whether we have read this

property readBy

Number of users who read message

property urls

URLs present in message

property mentions

@mentions in message

property issues

Github #ISSUE references in message

property meta

(Unused)

property v

Version

property gv

Gravatar Version (used to force cache flushing)

property editedAt

Edit timestamp (ISO)

class bioconda_utils.gitter.Room(id: str, name: str, topic: str, userCount: int, mentions: List[str], lurk: bool, url: str, githubType: str, tags: List[str], unreadItems: int, avatarUrl: str, roomMember: str, groupId: str, public: str, lastAccessTime: Optional[str] = None, favourite: bool = False, oneToOne: Optional[bool] = None, user: Optional[User] = None, uri: Optional[str] = None, security: Optional[str] = None, noindex: Optional[str] = None, group: Optional[str] = None, v: Optional[str] = None)[source]

Gitter Chat Room

Create new instance of Room(id, name, topic, userCount, mentions, lurk, url, githubType, tags, unreadItems, avatarUrl, roomMember, groupId, public, lastAccessTime, favourite, oneToOne, user, uri, security, noindex, group, v)

classmethod from_dict(data)[source]

Create Room from dict

property id

Room ID

property name

Room Name (e.g. bioconda/Lobby)

property topic

Room Topic

property userCount

List of users joined in room

property mentions

Number of unread mentions of current user

property lurk

Flag marking this room as silenced (no notifications)

property url

URL to this room for browser

property githubType

Type of room (ORG, REPO, ONETOONE, ORG_CHANNEL, REPO_CHANNEL, USER_CHANNEL)

property tags

List of tags attached to room

property unreadItems

Number of unread messages for current user

property avatarUrl

Gravatar URL

property roomMember

unknown

property groupId

unknown

property public

unknown

property lastAccessTime

Last time (ISO) room was accessed

property favourite

Flag marking this room as favorite

property oneToOne

Flag marking personal chats

property user

User if one-to-one

property uri

Room URI

property security

Unknown

property noindex

unknown

property group

Unknown

property v

Version

class bioconda_utils.gitter.GitterAPI(token)[source]

Sans-IO Base Class for Gitter API

Methods

list_rooms([name])

Get list of current user's rooms

get_room(uri)

Get a room using its URI

join_room(user, room)

Add user to a room

leave_room(user, room)

Remove user from room

edit_room(room[, topic, tags, noindex])

Set topic, tags or noindex for room

list_unread_items(user, room)

Get Ids for unread items of user in room

mark_as_read(user, room, ids)

Mark chat messages listed in ids as read

get_message(room, msgid)

Get a single message by its id

send_message(room, text, *args)

Send a new message

edit_message(room, message, text)

Edit a message

list_groups()

Get list of current user's groups

get_user()

Get current user

iter_chat(room)

Listen to chat messages

Details

async list_rooms(name=None)[source]

Get list of current user’s rooms

The list is filtered to match provided arguments.

Parameters:

name (Optional[str]) – Room name

Return type:

List[Room]

async get_room(uri)[source]

Get a room using its URI

Return type:

Room

async join_room(user, room)[source]

Add user to a room

Return type:

None

async leave_room(user, room)[source]

Remove user from room

Return type:

bool

async edit_room(room, topic=None, tags=None, noindex=None)[source]

Set topic, tags or noindex for room

Return type:

None

async list_unread_items(user, room)[source]

Get Ids for unread items of user in room

Return type:

Tuple[List[str], List[str]]

Returns:

Two lists of chat IDs are returned. The first are all unread mentions, the second only those in which the user was @Mentioned.

async mark_as_read(user, room, ids)[source]

Mark chat messages listed in ids as read

Return type:

None

async get_message(room, msgid)[source]

Get a single message by its id

Return type:

Message

async send_message(room, text, *args)[source]

Send a new message

Return type:

Message

async edit_message(room, message, text)[source]

Edit a message

Return type:

Message

async list_groups()[source]

Get list of current user’s groups

async get_user()[source]

Get current user

Return type:

User

async iter_chat(room)[source]

Listen to chat messages

Parameters:

room (Room) – Room to listen in. Use list_rooms to find Room.

Return type:

AsyncIterator[Message]

Returns:

async iterator over chat messages

class bioconda_utils.gitter.AioGitterAPI(session, *args, **kwargs)[source]

AioHTTP based implementation of GitterAPI