Skip to main content

Email notifications are a thing of the past, send notifications to messengers

Project description

Beep

This library will help you integrate notifications and authorization via Telegram through our Beep platform.

Preparation

First, you must log into the developer panel on the official Beep website and create your project.

After that, you must copy the ID of your project. It serves as a token, so be careful and keep it secret.

Library usage

Install

Install this library using

pip install beep-notifications

Connecting to the project

Using your project_id create BeepNotify instance.

from beep_notifications import BeepNotify

beep = BeepNotify('some_project_id')

Creating link code

Use get_link_code() method to get link code for your project.

link_code = beep.get_link_code()

Checking link code status

Use check_link_code(code) method to check link code status. It returns accepted, beep_code, username.

accepted, beep_code, username = beep.check_link_code("12345")

Checking is user a subscriber

Use check_subscription(user_iden) method to check if user is subscribed to your project to be able to get notifications from it. user_iden can be a username or a Beep code.

subscribed = beep.check_subscription("spiritedRaisins6")

Sending notifications

Use send_notification(title, body, username) method to send notifications.

Using username as receiver identification

beep.send_notification("Hello", "I SAID HELLOOOOO", "spiritedRaisins6")

Using Beep code as receiver identification

beep.send_notification("Hello", "I SAID HELLOOOOO", "665123731")

Sending auth code

Use send_auth_code(user_iden) method to send auth code to user, user_iden can be a username or a Beep code.

beep.send_auth_code("spiritedRaisins6")

Try to authenticate user with auth code

Use get_token(user_iden, auth_code) method to user authentication, user_iden can be a username or a Beep code.

token = beep.get_token("spiritedRaisins6", "1234")

Validate a token

Use validate_token(token, uac) method to validate a token, uac is 'username_as_code', if uac is True, then return a username of the token owner, else Beep code. This method returns 3 values: validation_result, user_iden and error.

res, user, errpr = beep.validate_token("some_token", uac=True)

Contact me!

Beep Telegram Chat
X / Twitter
Email felix.trof@gmail.com
Telegram

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

beep_notifications-0.2.2.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

beep_notifications-0.2.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file beep_notifications-0.2.2.tar.gz.

File metadata

  • Download URL: beep_notifications-0.2.2.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for beep_notifications-0.2.2.tar.gz
Algorithm Hash digest
SHA256 87a5b00b0e6e3c581531db1e858e5a1706fb77691145f680fe101243acde7395
MD5 40419ae78304572eafc941a61ed9413b
BLAKE2b-256 81de125bd6892658d8872c34aa0f5290b524e209c63da17d670078cd822ccff3

See more details on using hashes here.

File details

Details for the file beep_notifications-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for beep_notifications-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a3db149b2eb1160d742230ec743509d6c79faf1ad4914605621617db583f4ca6
MD5 326255bf6f41bf45bac4c006ba2eec13
BLAKE2b-256 f2c3727be730a88fa8e09bf492077d6f1d3fdc50b418ee7c66909abc4e70d64b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page