smssafe 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,218 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+ # Temporary file for partial code execution
204
+ tempCodeRunnerFile.py
205
+
206
+ # Ruff stuff:
207
+ .ruff_cache/
208
+
209
+ # PyPI configuration file
210
+ .pypirc
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
216
+
217
+ # Streamlit
218
+ .streamlit/secrets.toml
@@ -0,0 +1,30 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.0.1] - 2026-06-26
11
+
12
+ ### Added
13
+ - Initial public release of `smssafe`.
14
+ - `sanitize(text, *, drop_unknown=True) -> SanitizeResult` public API.
15
+ - `SanitizeResult` frozen dataclass with full audit trail (`replacements`,
16
+ `remaining_unsafe`, `char_count`, `segments`, `encoding`, `is_clean`).
17
+ - Deterministic 8-step GSM-7 sanitization pipeline (`smssafe.core`).
18
+ - Homoglyph transliteration for Cyrillic, Greek, and full-width Latin lookalikes.
19
+ - GSM-7 length and segment accounting (`smssafe.segments`), extended chars counted as 2.
20
+ - Zero runtime dependencies; ships `py.typed`.
21
+ - 689-case test suite.
22
+
23
+ ### Notes
24
+ - **Tilde (`~`):** treated as the GSM-7 extended character it is (escape `0x3D`,
25
+ 2 septets) and passed through unchanged, so `~5,000` ("approximately") is not
26
+ corrupted into `-5,000` ("negative"). Non-ASCII tilde lookalikes (`˜ ∼ ~`)
27
+ normalise to ASCII `~`.
28
+
29
+ [Unreleased]: https://github.com/BRIQ-BLOCK/smssafe/compare/v0.0.1...HEAD
30
+ [0.0.1]: https://github.com/BRIQ-BLOCK/smssafe/releases/tag/v0.0.1
smssafe-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BRIQ
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
smssafe-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,129 @@
1
+ Metadata-Version: 2.4
2
+ Name: smssafe
3
+ Version: 0.0.1
4
+ Summary: Turn arbitrary text into guaranteed GSM-7 deliverable SMS — no UCS-2 fallback, deliverable on feature phones.
5
+ Project-URL: Homepage, https://github.com/BRIQ-BLOCK/smssafe
6
+ Project-URL: Repository, https://github.com/BRIQ-BLOCK/smssafe
7
+ Project-URL: Changelog, https://github.com/BRIQ-BLOCK/smssafe/blob/main/CHANGELOG.md
8
+ Project-URL: Issues, https://github.com/BRIQ-BLOCK/smssafe/issues
9
+ Author-email: Eddie Gulay <groundhalt@gmail.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: a2p,encoding,gsm-7,gsm0338,sanitize,sms,transliterate,ucs2
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Communications :: Telephony
22
+ Classifier: Topic :: Text Processing :: Filters
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.10
25
+ Provides-Extra: dev
26
+ Requires-Dist: mypy; extra == 'dev'
27
+ Requires-Dist: pytest-cov; extra == 'dev'
28
+ Requires-Dist: pytest>=7; extra == 'dev'
29
+ Requires-Dist: ruff; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # smssafe
33
+
34
+ [![CI](https://github.com/BRIQ-BLOCK/smssafe/actions/workflows/ci.yml/badge.svg)](https://github.com/BRIQ-BLOCK/smssafe/actions/workflows/ci.yml)
35
+ [![PyPI](https://img.shields.io/pypi/v/smssafe.svg)](https://pypi.org/project/smssafe/)
36
+ [![Python](https://img.shields.io/pypi/pyversions/smssafe.svg)](https://pypi.org/project/smssafe/)
37
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
38
+
39
+ **Turn arbitrary text into guaranteed GSM-7 deliverable SMS — no UCS-2 fallback.**
40
+
41
+ A single non-GSM-7 character (a smart quote, an em-dash, a stray emoji) forces an
42
+ *entire* SMS into UCS-2 encoding: 70 characters per segment instead of 160, triple
43
+ the cost, and silent delivery failure on feature/dumb phones that can't render it.
44
+
45
+ `smssafe` sanitizes text **before** you send it — transliterating, replacing, or
46
+ dropping every non-GSM-7 character while preserving as much meaning as possible.
47
+
48
+ - ✅ **Zero dependencies** — pure Python standard library, 3.10+
49
+ - ✅ **Fully typed** — ships `py.typed` (PEP 561)
50
+ - ✅ Homoglyph-aware — Cyrillic/Greek/full-width lookalikes are *transliterated*, not dropped
51
+ - ✅ Accurate segment & cost accounting (extended chars correctly counted as 2)
52
+ - ✅ Deterministic, side-effect-free, full audit trail of every change
53
+
54
+ ## Install
55
+
56
+ ```bash
57
+ pip install smssafe
58
+ ```
59
+
60
+ ## Usage
61
+
62
+ ```python
63
+ from smssafe import sanitize
64
+
65
+ result = sanitize("Hi — “there”, pay ~5,000 now… 🙂")
66
+
67
+ result.sanitized # 'Hi - "there", pay ~5,000 now...'
68
+ result.encoding # 'gsm7'
69
+ result.char_count # encoded length (extended chars count as 2)
70
+ result.segments # number of SMS parts
71
+ result.replacements # list[dict] — audit trail of every substitution
72
+ result.remaining_unsafe # list[str] — chars that could not be mapped (dropped)
73
+ result.is_clean # True if no changes were needed
74
+ ```
75
+
76
+ ### What it handles
77
+
78
+ | Input | Output | Notes |
79
+ |---|---|---|
80
+ | `“ ” ‘ ’` smart quotes | `" '` | Word / Google Docs / AI output |
81
+ | `– — …` dash & ellipsis | `- ...` | |
82
+ | `• · ‣` bullets | `-` | |
83
+ | Cyrillic `аеор`, Greek `Α`, full-width `A1` | `aeop A A1` | lookalikes transliterated, not dropped |
84
+ | `ÀÈÌÒÙ` uppercase accent traps | `AEIOU` | *not* in GSM-7 despite lowercase being valid |
85
+ | `™ © ®` | `TM (c) (R)` | |
86
+ | `₹ ₽ ₿` | `INR RUB BTC` | (`€ £ $ ¥` are kept — they're valid GSM-7) |
87
+ | emoji, math-alphanumerics, non-BMP | _(stripped)_ | recorded in `remaining_unsafe` |
88
+ | zero-width / BOM / exotic spaces | _(stripped / normalized)_ | |
89
+
90
+ > **Tilde:** `~` is a GSM-7 extended character (escape `0x3D`, costs 2 septets), so
91
+ > it passes through unchanged — `~5,000` stays `~5,000` rather than becoming a
92
+ > misleading `-5,000`. Non-ASCII tilde lookalikes (`˜ ∼ ~`) normalise to `~`.
93
+
94
+ ### Drop vs. replace unknowns
95
+
96
+ By default, characters with no safe mapping are dropped. Pass `drop_unknown=False`
97
+ to replace them with `?` instead:
98
+
99
+ ```python
100
+ sanitize("A中B", drop_unknown=False).sanitized # 'A?B'
101
+ ```
102
+
103
+ ## How it works
104
+
105
+ A deterministic 8-step pipeline (`smssafe.core`), each step independently testable:
106
+
107
+ 0. Strip non-BMP / surrogate codepoints (emoji, math-alphanumerics)
108
+ 1. Apply the homoglyph map (Cyrillic/Greek/full-width → Latin)
109
+ 2. Apply the explicit replacement map (quotes, dashes, currency, symbols…)
110
+ 3. NFD-normalize **per character** and strip diacritics for remaining accented chars
111
+ 4. Normalize whitespace (tabs, exotic/zero-width spaces)
112
+ 5. Collapse artifacts (runs of dashes/spaces)
113
+ 6. Final GSM-7 scan — drop or `?`-replace anything left
114
+ 7. Compute encoding, character count (extended = 2), and segment count
115
+
116
+ ## Development
117
+
118
+ ```bash
119
+ git clone https://github.com/BRIQ-BLOCK/smssafe
120
+ cd smssafe
121
+ pip install -e ".[dev]"
122
+ pytest # 689 tests
123
+ ruff check .
124
+ mypy
125
+ ```
126
+
127
+ ## License
128
+
129
+ MIT © Eddie Gulay
@@ -0,0 +1,98 @@
1
+ # smssafe
2
+
3
+ [![CI](https://github.com/BRIQ-BLOCK/smssafe/actions/workflows/ci.yml/badge.svg)](https://github.com/BRIQ-BLOCK/smssafe/actions/workflows/ci.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/smssafe.svg)](https://pypi.org/project/smssafe/)
5
+ [![Python](https://img.shields.io/pypi/pyversions/smssafe.svg)](https://pypi.org/project/smssafe/)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
+
8
+ **Turn arbitrary text into guaranteed GSM-7 deliverable SMS — no UCS-2 fallback.**
9
+
10
+ A single non-GSM-7 character (a smart quote, an em-dash, a stray emoji) forces an
11
+ *entire* SMS into UCS-2 encoding: 70 characters per segment instead of 160, triple
12
+ the cost, and silent delivery failure on feature/dumb phones that can't render it.
13
+
14
+ `smssafe` sanitizes text **before** you send it — transliterating, replacing, or
15
+ dropping every non-GSM-7 character while preserving as much meaning as possible.
16
+
17
+ - ✅ **Zero dependencies** — pure Python standard library, 3.10+
18
+ - ✅ **Fully typed** — ships `py.typed` (PEP 561)
19
+ - ✅ Homoglyph-aware — Cyrillic/Greek/full-width lookalikes are *transliterated*, not dropped
20
+ - ✅ Accurate segment & cost accounting (extended chars correctly counted as 2)
21
+ - ✅ Deterministic, side-effect-free, full audit trail of every change
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pip install smssafe
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ ```python
32
+ from smssafe import sanitize
33
+
34
+ result = sanitize("Hi — “there”, pay ~5,000 now… 🙂")
35
+
36
+ result.sanitized # 'Hi - "there", pay ~5,000 now...'
37
+ result.encoding # 'gsm7'
38
+ result.char_count # encoded length (extended chars count as 2)
39
+ result.segments # number of SMS parts
40
+ result.replacements # list[dict] — audit trail of every substitution
41
+ result.remaining_unsafe # list[str] — chars that could not be mapped (dropped)
42
+ result.is_clean # True if no changes were needed
43
+ ```
44
+
45
+ ### What it handles
46
+
47
+ | Input | Output | Notes |
48
+ |---|---|---|
49
+ | `“ ” ‘ ’` smart quotes | `" '` | Word / Google Docs / AI output |
50
+ | `– — …` dash & ellipsis | `- ...` | |
51
+ | `• · ‣` bullets | `-` | |
52
+ | Cyrillic `аеор`, Greek `Α`, full-width `A1` | `aeop A A1` | lookalikes transliterated, not dropped |
53
+ | `ÀÈÌÒÙ` uppercase accent traps | `AEIOU` | *not* in GSM-7 despite lowercase being valid |
54
+ | `™ © ®` | `TM (c) (R)` | |
55
+ | `₹ ₽ ₿` | `INR RUB BTC` | (`€ £ $ ¥` are kept — they're valid GSM-7) |
56
+ | emoji, math-alphanumerics, non-BMP | _(stripped)_ | recorded in `remaining_unsafe` |
57
+ | zero-width / BOM / exotic spaces | _(stripped / normalized)_ | |
58
+
59
+ > **Tilde:** `~` is a GSM-7 extended character (escape `0x3D`, costs 2 septets), so
60
+ > it passes through unchanged — `~5,000` stays `~5,000` rather than becoming a
61
+ > misleading `-5,000`. Non-ASCII tilde lookalikes (`˜ ∼ ~`) normalise to `~`.
62
+
63
+ ### Drop vs. replace unknowns
64
+
65
+ By default, characters with no safe mapping are dropped. Pass `drop_unknown=False`
66
+ to replace them with `?` instead:
67
+
68
+ ```python
69
+ sanitize("A中B", drop_unknown=False).sanitized # 'A?B'
70
+ ```
71
+
72
+ ## How it works
73
+
74
+ A deterministic 8-step pipeline (`smssafe.core`), each step independently testable:
75
+
76
+ 0. Strip non-BMP / surrogate codepoints (emoji, math-alphanumerics)
77
+ 1. Apply the homoglyph map (Cyrillic/Greek/full-width → Latin)
78
+ 2. Apply the explicit replacement map (quotes, dashes, currency, symbols…)
79
+ 3. NFD-normalize **per character** and strip diacritics for remaining accented chars
80
+ 4. Normalize whitespace (tabs, exotic/zero-width spaces)
81
+ 5. Collapse artifacts (runs of dashes/spaces)
82
+ 6. Final GSM-7 scan — drop or `?`-replace anything left
83
+ 7. Compute encoding, character count (extended = 2), and segment count
84
+
85
+ ## Development
86
+
87
+ ```bash
88
+ git clone https://github.com/BRIQ-BLOCK/smssafe
89
+ cd smssafe
90
+ pip install -e ".[dev]"
91
+ pytest # 689 tests
92
+ ruff check .
93
+ mypy
94
+ ```
95
+
96
+ ## License
97
+
98
+ MIT © Eddie Gulay
@@ -0,0 +1,75 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "smssafe"
7
+ description = "Turn arbitrary text into guaranteed GSM-7 deliverable SMS — no UCS-2 fallback, deliverable on feature phones."
8
+ readme = "README.md"
9
+ requires-python = ">=3.10"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ authors = [{ name = "Eddie Gulay", email = "groundhalt@gmail.com" }]
13
+ keywords = ["sms", "gsm-7", "gsm0338", "encoding", "sanitize", "a2p", "ucs2", "transliterate"]
14
+ classifiers = [
15
+ "Development Status :: 5 - Production/Stable",
16
+ "Intended Audience :: Developers",
17
+ "Operating System :: OS Independent",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Topic :: Communications :: Telephony",
24
+ "Topic :: Text Processing :: Filters",
25
+ "Typing :: Typed",
26
+ ]
27
+ dynamic = ["version"]
28
+ dependencies = []
29
+
30
+ [project.optional-dependencies]
31
+ dev = ["pytest>=7", "pytest-cov", "ruff", "mypy"]
32
+
33
+ [project.urls]
34
+ Homepage = "https://github.com/BRIQ-BLOCK/smssafe"
35
+ Repository = "https://github.com/BRIQ-BLOCK/smssafe"
36
+ Changelog = "https://github.com/BRIQ-BLOCK/smssafe/blob/main/CHANGELOG.md"
37
+ Issues = "https://github.com/BRIQ-BLOCK/smssafe/issues"
38
+
39
+ # Optional CLI — uncomment after adding src/smssafe/__main__.py
40
+ # [project.scripts]
41
+ # smssafe = "smssafe.__main__:main"
42
+
43
+ [tool.hatch.version]
44
+ path = "src/smssafe/__init__.py"
45
+
46
+ [tool.hatch.build.targets.wheel]
47
+ packages = ["src/smssafe"]
48
+
49
+ [tool.hatch.build.targets.sdist]
50
+ include = ["src/smssafe", "tests", "README.md", "CHANGELOG.md", "LICENSE"]
51
+
52
+ [tool.pytest.ini_options]
53
+ testpaths = ["tests"]
54
+ pythonpath = ["src"]
55
+ addopts = "-q"
56
+
57
+ [tool.coverage.run]
58
+ source = ["smssafe"]
59
+ branch = true
60
+
61
+ [tool.ruff]
62
+ line-length = 100
63
+ target-version = "py310"
64
+
65
+ [tool.ruff.lint]
66
+ select = ["E", "F", "I", "UP", "B", "C4", "SIM"]
67
+
68
+ [tool.ruff.lint.per-file-ignores]
69
+ # Test docstrings spell out the invariant under test; long lines are fine there.
70
+ "tests/**" = ["E501"]
71
+
72
+ [tool.mypy]
73
+ python_version = "3.10"
74
+ strict = true
75
+ files = ["src/smssafe"]
@@ -0,0 +1,15 @@
1
+ """smssafe -- turn arbitrary text into guaranteed GSM-7 deliverable SMS.
2
+
3
+ Public API:
4
+ from smssafe import sanitize, SanitizeResult
5
+ result = sanitize("Hi — “there”")
6
+ result.sanitized # -> 'Hi - "there"'
7
+
8
+ Stdlib only. No third-party imports. Python 3.10+.
9
+ """
10
+
11
+ from .core import SanitizeResult, sanitize
12
+
13
+ __all__ = ["sanitize", "SanitizeResult"]
14
+
15
+ __version__ = "0.0.1"