lettermint 0.1.0__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.
Files changed (32) hide show
  1. lettermint-0.1.0/.github/dependabot.yml +18 -0
  2. lettermint-0.1.0/.github/workflows/ci.yml +83 -0
  3. lettermint-0.1.0/.github/workflows/dependabot-auto-merge.yml +33 -0
  4. lettermint-0.1.0/.github/workflows/fix-code-style.yml +37 -0
  5. lettermint-0.1.0/.github/workflows/release-to-discord.yml +17 -0
  6. lettermint-0.1.0/.github/workflows/release.yml +99 -0
  7. lettermint-0.1.0/.github/workflows/update-changelog.yml +32 -0
  8. lettermint-0.1.0/.gitignore +322 -0
  9. lettermint-0.1.0/CHANGELOG.md +19 -0
  10. lettermint-0.1.0/LICENSE +21 -0
  11. lettermint-0.1.0/PKG-INFO +320 -0
  12. lettermint-0.1.0/README.md +286 -0
  13. lettermint-0.1.0/examples/async_send.py +43 -0
  14. lettermint-0.1.0/examples/basic_send.py +22 -0
  15. lettermint-0.1.0/examples/webhook_verification.py +80 -0
  16. lettermint-0.1.0/examples/with_attachments.py +39 -0
  17. lettermint-0.1.0/pyproject.toml +99 -0
  18. lettermint-0.1.0/src/lettermint/__init__.py +80 -0
  19. lettermint-0.1.0/src/lettermint/client.py +371 -0
  20. lettermint-0.1.0/src/lettermint/endpoints/__init__.py +8 -0
  21. lettermint-0.1.0/src/lettermint/endpoints/email.py +542 -0
  22. lettermint-0.1.0/src/lettermint/endpoints/endpoint.py +27 -0
  23. lettermint-0.1.0/src/lettermint/exceptions.py +88 -0
  24. lettermint-0.1.0/src/lettermint/lettermint.py +148 -0
  25. lettermint-0.1.0/src/lettermint/py.typed +0 -0
  26. lettermint-0.1.0/src/lettermint/types.py +77 -0
  27. lettermint-0.1.0/src/lettermint/webhook.py +234 -0
  28. lettermint-0.1.0/tests/__init__.py +1 -0
  29. lettermint-0.1.0/tests/conftest.py +15 -0
  30. lettermint-0.1.0/tests/test_client.py +204 -0
  31. lettermint-0.1.0/tests/test_email.py +350 -0
  32. lettermint-0.1.0/tests/test_webhook.py +252 -0
@@ -0,0 +1,18 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ groups:
8
+ dev-dependencies:
9
+ patterns:
10
+ - "pytest*"
11
+ - "mypy"
12
+ - "ruff"
13
+ - "respx"
14
+
15
+ - package-ecosystem: "github-actions"
16
+ directory: "/"
17
+ schedule:
18
+ interval: "weekly"
@@ -0,0 +1,83 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ test:
15
+ name: Test (Python ${{ matrix.python-version }})
16
+ runs-on: ubuntu-latest
17
+ timeout-minutes: 10
18
+ strategy:
19
+ fail-fast: true
20
+ matrix:
21
+ python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
22
+
23
+ steps:
24
+ - name: Checkout code
25
+ uses: actions/checkout@v4
26
+
27
+ - name: Set up Python ${{ matrix.python-version }}
28
+ uses: actions/setup-python@v5
29
+ with:
30
+ python-version: ${{ matrix.python-version }}
31
+ cache: 'pip'
32
+
33
+ - name: Install dependencies
34
+ run: |
35
+ python -m pip install --upgrade pip
36
+ pip install -e ".[dev]"
37
+
38
+ - name: Run linting
39
+ run: python -m ruff check src/lettermint
40
+
41
+ - name: Run type checking
42
+ run: python -m mypy src/lettermint --strict
43
+
44
+ - name: Run tests
45
+ run: python -m pytest tests/ -v --tb=short
46
+
47
+ build:
48
+ name: Build
49
+ runs-on: ubuntu-latest
50
+ needs: test
51
+
52
+ steps:
53
+ - name: Checkout code
54
+ uses: actions/checkout@v4
55
+
56
+ - name: Set up Python
57
+ uses: actions/setup-python@v5
58
+ with:
59
+ python-version: '3.12'
60
+ cache: 'pip'
61
+
62
+ - name: Install build dependencies
63
+ run: |
64
+ python -m pip install --upgrade pip
65
+ pip install build
66
+
67
+ - name: Build package
68
+ run: python -m build
69
+
70
+ - name: Check build output
71
+ run: |
72
+ if [ ! -d "dist" ]; then
73
+ echo "Build output directory 'dist' not found"
74
+ exit 1
75
+ fi
76
+ ls -la dist/
77
+
78
+ - name: Upload build artifacts
79
+ uses: actions/upload-artifact@v4
80
+ with:
81
+ name: build-artifacts
82
+ path: dist/
83
+ retention-days: 7
@@ -0,0 +1,33 @@
1
+ name: dependabot-auto-merge
2
+ on: pull_request_target
3
+
4
+ permissions:
5
+ pull-requests: write
6
+ contents: write
7
+
8
+ jobs:
9
+ dependabot:
10
+ runs-on: ubuntu-latest
11
+ timeout-minutes: 5
12
+ if: github.actor == 'dependabot[bot]'
13
+ steps:
14
+
15
+ - name: Dependabot metadata
16
+ id: metadata
17
+ uses: dependabot/fetch-metadata@v2
18
+ with:
19
+ github-token: ${{ secrets.GITHUB_TOKEN }}
20
+
21
+ - name: Auto-merge Dependabot PRs for semver-minor updates
22
+ if: steps.metadata.outputs.update-type == 'version-update:semver-minor'
23
+ run: gh pr merge --auto --merge "$PR_URL"
24
+ env:
25
+ PR_URL: ${{ github.event.pull_request.html_url }}
26
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27
+
28
+ - name: Auto-merge Dependabot PRs for semver-patch updates
29
+ if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
30
+ run: gh pr merge --auto --merge "$PR_URL"
31
+ env:
32
+ PR_URL: ${{ github.event.pull_request.html_url }}
33
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,37 @@
1
+ name: Fix Python code style issues
2
+
3
+ on:
4
+ push:
5
+ paths:
6
+ - '**.py'
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ python-code-styling:
13
+ runs-on: ubuntu-latest
14
+ timeout-minutes: 5
15
+
16
+ steps:
17
+ - name: Checkout code
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: '3.12'
24
+ cache: 'pip'
25
+
26
+ - name: Install ruff
27
+ run: pip install ruff
28
+
29
+ - name: Fix code style issues
30
+ run: |
31
+ python -m ruff check --fix src/lettermint || true
32
+ python -m ruff format src/lettermint || true
33
+
34
+ - name: Commit changes
35
+ uses: stefanzweifel/git-auto-commit-action@v5
36
+ with:
37
+ commit_message: Fix styling
@@ -0,0 +1,17 @@
1
+ on:
2
+ release:
3
+ types: [published]
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ github-releases-to-discord:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: Checkout
11
+ uses: actions/checkout@v4
12
+ - name: Discord Release Webhook
13
+ uses: lettermint/action-discord-releases@v1.0.1
14
+ with:
15
+ color: '3776ab'
16
+ webhook_url: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }}
17
+ content: 'A new release for the Lettermint Python SDK is now available! ||@Python||'
@@ -0,0 +1,99 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: write
10
+ id-token: write
11
+
12
+ jobs:
13
+ test-and-build:
14
+ name: Test and Build
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - name: Checkout code
19
+ uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: '3.12'
27
+ cache: 'pip'
28
+
29
+ - name: Install dependencies
30
+ run: |
31
+ python -m pip install --upgrade pip
32
+ pip install -e ".[dev]"
33
+ pip install build
34
+
35
+ - name: Run tests
36
+ run: python -m pytest tests/ -v
37
+
38
+ - name: Build package
39
+ run: python -m build
40
+
41
+ - name: Upload build artifacts
42
+ uses: actions/upload-artifact@v4
43
+ with:
44
+ name: release-artifacts
45
+ path: |
46
+ dist/
47
+ pyproject.toml
48
+ README.md
49
+ LICENSE
50
+ retention-days: 30
51
+
52
+ release:
53
+ name: Release
54
+ runs-on: ubuntu-latest
55
+ needs: test-and-build
56
+ if: github.ref == 'refs/heads/main'
57
+
58
+ steps:
59
+ - name: Checkout code
60
+ uses: actions/checkout@v4
61
+ with:
62
+ fetch-depth: 0
63
+ token: ${{ secrets.GITHUB_TOKEN }}
64
+
65
+ - name: Set up Python
66
+ uses: actions/setup-python@v5
67
+ with:
68
+ python-version: '3.12'
69
+ cache: 'pip'
70
+
71
+ - name: Install dependencies
72
+ run: |
73
+ python -m pip install --upgrade pip
74
+ pip install python-semantic-release build
75
+
76
+ - name: Configure Git
77
+ run: |
78
+ git config user.name "github-actions[bot]"
79
+ git config user.email "github-actions[bot]@users.noreply.github.com"
80
+
81
+ - name: Python Semantic Release
82
+ id: release
83
+ env:
84
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85
+ run: |
86
+ semantic-release version
87
+ semantic-release publish
88
+
89
+ - name: Download build artifacts
90
+ uses: actions/download-artifact@v4
91
+ with:
92
+ name: release-artifacts
93
+ path: artifacts/
94
+
95
+ - name: Publish to PyPI
96
+ if: steps.release.outputs.released == 'true'
97
+ uses: pypa/gh-action-pypi-publish@release/v1
98
+ with:
99
+ packages-dir: artifacts/dist/
@@ -0,0 +1,32 @@
1
+ name: Update Changelog
2
+
3
+ on:
4
+ release:
5
+ types: [released]
6
+
7
+ permissions:
8
+ contents: write
9
+
10
+ jobs:
11
+ update:
12
+ runs-on: ubuntu-latest
13
+ timeout-minutes: 5
14
+
15
+ steps:
16
+ - name: Checkout code
17
+ uses: actions/checkout@v4
18
+ with:
19
+ ref: main
20
+
21
+ - name: Update Changelog
22
+ uses: stefanzweifel/changelog-updater-action@v1
23
+ with:
24
+ latest-version: ${{ github.event.release.name }}
25
+ release-notes: ${{ github.event.release.body }}
26
+
27
+ - name: Commit updated CHANGELOG
28
+ uses: stefanzweifel/git-auto-commit-action@v5
29
+ with:
30
+ branch: main
31
+ commit_message: Update CHANGELOG
32
+ file_pattern: CHANGELOG.md
@@ -0,0 +1,322 @@
1
+ .idea/**/workspace.xml
2
+ .idea/**/tasks.xml
3
+ .idea/**/usage.statistics.xml
4
+ .idea/**/dictionaries
5
+ .idea/**/shelf
6
+ .idea/**/aws.xml
7
+ .idea/**/contentModel.xml
8
+ .idea/**/dataSources/
9
+ .idea/**/dataSources.ids
10
+ .idea/**/dataSources.local.xml
11
+ .idea/**/sqlDataSources.xml
12
+ .idea/**/dynamic.xml
13
+ .idea/**/uiDesigner.xml
14
+ .idea/**/dbnavigator.xml
15
+ .idea/**/gradle.xml
16
+ .idea/**/libraries
17
+ .idea/
18
+ .claude/
19
+ cmake-build-*/
20
+ .idea/**/mongoSettings.xml
21
+ *.iws
22
+ out/
23
+ .idea_modules/
24
+ atlassian-ide-plugin.xml
25
+ .idea/replstate.xml
26
+ .idea/sonarlint/
27
+ com_crashlytics_export_strings.xml
28
+ crashlytics.properties
29
+ crashlytics-build.properties
30
+ fabric.properties
31
+ .idea/httpRequests
32
+ .idea/caches/build_file_checksums.ser
33
+ .vscode/*
34
+ !.vscode/settings.json
35
+ !.vscode/tasks.json
36
+ !.vscode/launch.json
37
+ !.vscode/extensions.json
38
+ !.vscode/*.code-snippets
39
+ .history/
40
+ *.vsix
41
+ *.rsuser
42
+ *.suo
43
+ *.user
44
+ *.userosscache
45
+ *.sln.docstates
46
+ *.userprefs
47
+ mono_crash.*
48
+ [Dd]ebug/
49
+ [Dd]ebugPublic/
50
+ [Rr]elease/
51
+ [Rr]eleases/
52
+ x64/
53
+ x86/
54
+ [Ww][Ii][Nn]32/
55
+ [Aa][Rr][Mm]/
56
+ [Aa][Rr][Mm]64/
57
+ bld/
58
+ [Bb]in/
59
+ [Oo]bj/
60
+ [Ll]og/
61
+ [Ll]ogs/
62
+ .vs/
63
+ Generated\ Files/
64
+ [Tt]est[Rr]esult*/
65
+ [Bb]uild[Ll]og.*
66
+ *.VisualState.xml
67
+ TestResult.xml
68
+ nunit-*.xml
69
+ [Dd]ebugPS/
70
+ [Rr]eleasePS/
71
+ dlldata.c
72
+ BenchmarkDotNet.Artifacts/
73
+ project.lock.json
74
+ project.fragment.lock.json
75
+ artifacts/
76
+ ScaffoldingReadMe.txt
77
+ StyleCopReport.xml
78
+ *_i.c
79
+ *_p.c
80
+ *_h.h
81
+ *.ilk
82
+ *.meta
83
+ *.obj
84
+ *.iobj
85
+ *.pch
86
+ *.pdb
87
+ *.ipdb
88
+ *.pgc
89
+ *.pgd
90
+ *.rsp
91
+ *.sbr
92
+ *.tlb
93
+ *.tli
94
+ *.tlh
95
+ *.tmp
96
+ *.tmp_proj
97
+ *_wpftmp.csproj
98
+ *.log
99
+ *.tlog
100
+ *.vspscc
101
+ *.vssscc
102
+ .builds
103
+ *.pidb
104
+ *.svclog
105
+ *.scc
106
+ _Chutzpah*
107
+ ipch/
108
+ *.aps
109
+ *.ncb
110
+ *.opendb
111
+ *.opensdf
112
+ *.sdf
113
+ *.cachefile
114
+ *.VC.db
115
+ *.VC.VC.opendb
116
+ *.psess
117
+ *.vsp
118
+ *.vspx
119
+ *.sap
120
+ *.e2e
121
+ $tf/
122
+ *.gpState
123
+ _ReSharper*/
124
+ *.[Rr]e[Ss]harper
125
+ *.DotSettings.user
126
+ _TeamCity*
127
+ *.dotCover
128
+ .axoCover/*
129
+ !.axoCover/settings.json
130
+ coverage*.json
131
+ coverage*.xml
132
+ coverage*.info
133
+ *.coverage
134
+ *.coveragexml
135
+ _NCrunch_*
136
+ .*crunch*.local.xml
137
+ nCrunchTemp_*
138
+ *.mm.*
139
+ AutoTest.Net/
140
+ .sass-cache/
141
+ [Ee]xpress/
142
+ DocProject/buildhelp/
143
+ DocProject/Help/*.HxT
144
+ DocProject/Help/*.HxC
145
+ DocProject/Help/*.hhc
146
+ DocProject/Help/*.hhk
147
+ DocProject/Help/*.hhp
148
+ DocProject/Help/Html2
149
+ DocProject/Help/html
150
+ publish/
151
+ *.[Pp]ublish.xml
152
+ *.azurePubxml
153
+ *.pubxml
154
+ *.publishproj
155
+ PublishScripts/
156
+ *.nupkg
157
+ *.snupkg
158
+ **/[Pp]ackages/*
159
+ !**/[Pp]ackages/build/
160
+ *.nuget.props
161
+ *.nuget.targets
162
+ csx/
163
+ *.build.csdef
164
+ ecf/
165
+ rcf/
166
+ AppPackages/
167
+ BundleArtifacts/
168
+ Package.StoreAssociation.xml
169
+ _pkginfo.txt
170
+ *.appx
171
+ *.appxbundle
172
+ *.appxupload
173
+ *.[Cc]ache
174
+ !?*.[Cc]ache/
175
+ ClientBin/
176
+ ~$*
177
+ *~
178
+ *.dbmdl
179
+ *.dbproj.schemaview
180
+ *.jfm
181
+ *.pfx
182
+ *.publishsettings
183
+ orleans.codegen.cs
184
+ Generated_Code/
185
+ _UpgradeReport_Files/
186
+ Backup*/
187
+ UpgradeLog*.XML
188
+ UpgradeLog*.htm
189
+ ServiceFabricBackup/
190
+ *.rptproj.bak
191
+ *.mdf
192
+ *.ldf
193
+ *.ndf
194
+ *.rdl.data
195
+ *.bim.layout
196
+ *.bim_*.settings
197
+ *.rptproj.rsuser
198
+ *- [Bb]ackup.rdl
199
+ *- [Bb]ackup ([0-9]).rdl
200
+ *- [Bb]ackup ([0-9][0-9]).rdl
201
+ FakesAssemblies/
202
+ *.GhostDoc.xml
203
+ .ntvs_analysis.dat
204
+ node_modules/
205
+ *.plg
206
+ *.opt
207
+ *.vbw
208
+ *.vbp
209
+ *.dsw
210
+ *.dsp
211
+ **/*.HTMLClient/GeneratedArtifacts
212
+ **/*.DesktopClient/GeneratedArtifacts
213
+ **/*.DesktopClient/ModelManifest.xml
214
+ **/*.Server/GeneratedArtifacts
215
+ **/*.Server/ModelManifest.xml
216
+ _Pvt_Extensions
217
+ .paket/paket.exe
218
+ paket-files/
219
+ .fake/
220
+ .cr/personal
221
+ __pycache__/
222
+ *.pyc
223
+ *.tss
224
+ *.jmconfig
225
+ *.btp.cs
226
+ *.btm.cs
227
+ *.odx.cs
228
+ *.xsd.cs
229
+ OpenCover/
230
+ ASALocalRun/
231
+ *.binlog
232
+ *.nvuser
233
+ .mfractor/
234
+ .localhistory/
235
+ .vshistory/
236
+ healthchecksdb
237
+ MigrationBackup/
238
+ .ionide/
239
+ FodyWeavers.xsd
240
+ *.code-workspace
241
+ *.cab
242
+ *.msi
243
+ *.msix
244
+ *.msm
245
+ *.msp
246
+ *.sln.iml
247
+ *.py[cod]
248
+ *$py.class
249
+ *.so
250
+ .Python
251
+ build/
252
+ develop-eggs/
253
+ dist/
254
+ downloads/
255
+ eggs/
256
+ .eggs/
257
+ lib/
258
+ lib64/
259
+ parts/
260
+ sdist/
261
+ var/
262
+ wheels/
263
+ share/python-wheels/
264
+ *.egg-info/
265
+ .installed.cfg
266
+ *.egg
267
+ MANIFEST
268
+ *.manifest
269
+ *.spec
270
+ pip-log.txt
271
+ pip-delete-this-directory.txt
272
+ htmlcov/
273
+ .tox/
274
+ .nox/
275
+ .coverage
276
+ .coverage.*
277
+ .cache
278
+ nosetests.xml
279
+ coverage.xml
280
+ *.cover
281
+ *.py,cover
282
+ .hypothesis/
283
+ .pytest_cache/
284
+ cover/
285
+ *.mo
286
+ *.pot
287
+ local_settings.py
288
+ db.sqlite3
289
+ db.sqlite3-journal
290
+ instance/
291
+ .webassets-cache
292
+ .scrapy
293
+ docs/_build/
294
+ .pybuilder/
295
+ target/
296
+ .ipynb_checkpoints
297
+ profile_default/
298
+ ipython_config.py
299
+ .pdm.toml
300
+ .pdm-python
301
+ .pdm-build/
302
+ __pypackages__/
303
+ celerybeat-schedule
304
+ celerybeat.pid
305
+ *.sage.py
306
+ .env
307
+ .venv
308
+ env/
309
+ venv/
310
+ ENV/
311
+ env.bak/
312
+ venv.bak/
313
+ .spyderproject
314
+ .spyproject
315
+ .ropeproject
316
+ /site
317
+ .mypy_cache/
318
+ .dmypy.json
319
+ dmypy.json
320
+ .pyre/
321
+ .pytype/
322
+ cython_debug/
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2024-01-01
11
+
12
+ ### Added
13
+
14
+ - Initial release
15
+ - `Lettermint` and `AsyncLettermint` clients for sync/async API access
16
+ - Email endpoint with fluent builder interface
17
+ - Webhook signature verification
18
+ - Full type hints with `py.typed` marker
19
+ - Support for Python 3.9+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Lettermint
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.