SMS Counter
python-sms-counter is a lib that help to count characters of SMS messages.
How to use it
from sms.counter import SMSCounter
>>> counter = SMSCounter ();
>>> counter.count ( 'ǂ some-string-to-be-counted' ).dict ();
>>> {'length': 29, 'messages': 1, 'remaining': 41, 'per_message': 70, 'encoding': 'UTF16'}
>>> {'chars_per_segment': 70,
'chars_remaining': 43,
'content': 'ǂ some-string-to-be-counted',
'encoding': 'UTF16',
'max_chars_available': 70,
'segment': 1,
'sms_size': 27}
The meaning of the sms_size, chars_remaining and chars_per_segment values returned by count() depend on the encoding.
For GSM_7BIT_EX encoding, sms_size, chars_remaining and chars_per_segment count the number of 7-bit characters in the message, including the escape character that must precede any characters in the "extended" character set. For example, the sms_size of the message '€' is 2, because it takes 2 7bit characters to encode '€' in GSM_7BIT_EX.
For UTF16 and GSM_7BIT encoding, sms_size, chars_remaining and chars_per_segment count the number of characters (since all characters have an equal bit width).
All GSM_7BIT & GSM_7BIT_EX characters list : https://en.wikipedia.org/wiki/GSM_03.38
Mentions
- Original idea : dedayoa/sms-counter-python)
License
MIT licensed. See the bundled LICENSE file for more details.
Support
- Python :
>=3.9
Metadata
Release files for sms-counter 0.0.1
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 |
|---|---|---|---|---|
| sms_counter-0.0.1.tar.gz | 4.8 kB | Without provenance | Details for sms_counter-0.0.1.tar.gz |
Release files / sms_counter-0.0.1.tar.gz
| Download URL | sms_counter-0.0.1.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b897b146113c65183d8053f277b993cc7c56112fa62a0c0c7095d10d6722098
|
|
BLAKE2b-256 checksum How to use checksums |
215762cf7141a371d6008f3802c7cbcf73d9e67b7b68b3f32064c549bcfc650f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for sms-counter 0.0.1
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.