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.1.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.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: beep_notifications-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 9c8d445f85a7b6f3ad27582f190fce880e9797146efd42eef719441a4710c4ff
MD5 cd548fd0a86dae78a4a357085275915d
BLAKE2b-256 73dda80b795ec9aae4c9f4c3dc7b4dfcb23dafb864b6a90c09c678f760a33f5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for beep_notifications-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fdc3a9bfadd547d81587ae5f8ec448e048dcb65c5d92db3f4d41a00c9ea6bad9
MD5 e6320bde15668ce4d0f556cb0466b477
BLAKE2b-256 d5f91290883af3e2dba184c4c67a69eb95ac202267972109c326909c761736fe

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