Skip to main content

termiipython

Made in Nigeria Downloads Downloads Downloads

Termii Python Library for Termii API

Installation

pip install termiipython

Usage

from termiipython.token import Token
from termiipython.schemas.token import TokenType

token_client = Token()
token_client.authenticate_from_env()
response = token_client.send_token(
    message_type=TokenType.ALPHANUMERIC,
    receiver="2348152436475",
)
print(response)
from termiipython.messaging import Messaging

messaging_client = Messaging()
messaging_client.authenticate_from_env()

receivers = ["2348152436475", "2347153436435"]
response = messaging_client.send_message(
    receivers=receivers,
    text="Hello all. Thanks for visiting."
)
print(response)
from termiipython.campaign import Campaign

campaign_client = Campaign()
campaign_client.authenticate_from_env()
response = campaign_client.create_phonebook(
    name="Test", description="Test description."
)
print(response)

Authentication.

There are two ways of authenticating requests:

  1. With env variables:

To authenticate with environment variables set TERMII_API_KEY, TERMII_ENDPOINT_URL, TERMII_SENDER_ID to your termii api key, endpoint url and sender ID respectively. Then call client.authenticate_from_env()

Example:

import os

from termiipython.campaign import Campaign

os.environ["TERMII_API_KEY"] = "ukwiwe4642eh"
os.environ["TERMII_ENDPOINT_URL"] = "https://api.ng.termii.com"
os.environ["TERMII_SENDER_ID"] = "Test"

campaign_client = Campaign()
campaign_client.authenticate_from_env()
  1. A second method is to pass in the credentials directly. For that call authenticate_direct() on all clients and pass-in the credentials.

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

termiipython was created by Solomon Olatunji. It is licensed under the terms of the MIT license.

Please send a private mail to lordunyime@gmail.com if you discover any security vulnerability. I'll be happy to work with you on a fix.

Metadata

Release files for termiipython 3.1.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 termiipython 3.1.0
File Size Uploaded Provenance Actions
termiipython-3.1.0.tar.gz 10.7 kB Without provenance Details for termiipython-3.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 25.7 kB

Release files / termiipython-3.1.0.tar.gz

Download URL termiipython-3.1.0.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
67b5f803ba350441059c64d3b1a19175a722974cb08088dbfafb1feda2c39483
BLAKE2b-256 checksum
How to use checksums
c43375e2e4736858fcf0f51f4dd0f41ba4d5f7d9c6597bbc0782caf02c989073
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.0 CPython/3.11.2 Linux/6.2.0-37-generic

Release files / termiipython-3.1.0-py3-none-any.whl

Download URL termiipython-3.1.0-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d43dde20588f5a71f2052c2a44b0d0514096861eaff84071a7c81d3ccb640be9
BLAKE2b-256 checksum
How to use checksums
69ab4e78a72a51d456ccb14d01c6300080d7c672a5389e8180c697036d6ff9eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.0 CPython/3.11.2 Linux/6.2.0-37-generic

Security for termiipython 3.1.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.

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