getlurk 0.2.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,2 @@
1
+ # Whatever lands here lands through the release job; these owners review anything else.
2
+ * @j0xhen
@@ -0,0 +1,31 @@
1
+ name: Bug report
2
+ description: Something does not work as the documentation says.
3
+ body:
4
+ - type: markdown
5
+ attributes:
6
+ value: "**Never paste a Lurk key (`lurk_sk_…`), a webhook secret or a user token.** Error responses have a `request_id`: that is all we need to find it."
7
+ - type: input
8
+ id: version
9
+ attributes:
10
+ label: SDK version
11
+ placeholder: "1.4.0"
12
+ validations:
13
+ required: true
14
+ - type: input
15
+ id: runtime
16
+ attributes:
17
+ label: Runtime
18
+ placeholder: "Node 24, Python 3.12, Cloudflare Workers, ..."
19
+ validations:
20
+ required: true
21
+ - type: textarea
22
+ id: happened
23
+ attributes:
24
+ label: What you did and what happened
25
+ description: The smallest code that shows it, and the error (with its `request_id`).
26
+ validations:
27
+ required: true
28
+ - type: textarea
29
+ id: expected
30
+ attributes:
31
+ label: What you expected
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Report a security problem
4
+ url: https://github.com/security/advisories/new
5
+ about: Use private vulnerability reporting, or write to security@getlurk.com. Never a public issue.
6
+ - name: Documentation
7
+ url: https://docs.getlurk.com
8
+ about: How Lurk works, with examples.
@@ -0,0 +1,3 @@
1
+ Thanks for the change. **This repository is generated and cannot merge pull requests**: a maintainer will apply your change upstream (with you
2
+ credited) and close this pull request with a link to the release. Please make sure your commits are signed off (`git commit -s`), and do not
3
+ include any key or secret.
@@ -0,0 +1,85 @@
1
+ # Publishes this package to PyPI. Written into this repository by Lurk's release job; do not edit it here (the next release overwrites it).
2
+ #
3
+ # - It runs only on a version tag, and only the release job can create one (a tag ruleset). A person approves the `publish` environment.
4
+ # - There is no PyPI token anywhere: PyPI trusted publishing (OpenID Connect) gives the publish step a credential for this run only, and
5
+ # the package is published with attestations that say where it was built.
6
+ # - The package is built and tested once, in a job with no way to publish; the `publish` job uploads exactly those files.
7
+ name: Publish
8
+
9
+ on:
10
+ push:
11
+ tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
12
+ # A tag made through the API does not always start the push trigger above (the first release's did not). Run this workflow by hand
13
+ # from the mirror's Actions tab, choosing the version tag as the ref: the build refuses any ref that is not the package's own tag.
14
+ workflow_dispatch:
15
+
16
+ permissions: {}
17
+
18
+ concurrency:
19
+ group: publish-${{ github.ref }}
20
+ cancel-in-progress: false
21
+
22
+ jobs:
23
+ build:
24
+ runs-on: ubuntu-latest
25
+ timeout-minutes: 15
26
+ permissions:
27
+ contents: read
28
+ steps:
29
+ - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
30
+ with:
31
+ persist-credentials: false
32
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
33
+ with:
34
+ python-version: "3.12"
35
+ - name: The tag is the package's version
36
+ run: |
37
+ VERSION="$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')"
38
+ if [ "v${VERSION}" != "${GITHUB_REF_NAME}" ]; then
39
+ echo "The tag ${GITHUB_REF_NAME} is not the package version ${VERSION}." >&2
40
+ exit 1
41
+ fi
42
+ - name: The files are the ones the release job exported
43
+ run: |
44
+ python - <<'PY'
45
+ import hashlib, json, os, pathlib, sys
46
+ record = json.loads(pathlib.Path(".lurk-export.json").read_text())
47
+ bad = [f["path"] for f in record["files"] if hashlib.sha256(pathlib.Path(f["path"]).read_bytes()).hexdigest() != f["sha256"]]
48
+ listed = {f["path"] for f in record["files"]} | {".lurk-export.json"}
49
+ extra = [str(p) for p in pathlib.Path(".").rglob("*") if p.is_file() and ".git" not in p.parts and str(p) not in listed]
50
+ if bad or extra:
51
+ print("Changed since the export:", bad, "Not in the export:", extra, file=sys.stderr)
52
+ sys.exit(1)
53
+ if record["version"] != os.environ["GITHUB_REF_NAME"][1:]:
54
+ print("The export is for another version.", file=sys.stderr)
55
+ sys.exit(1)
56
+ PY
57
+ - run: python -m unittest discover -s tests -t .
58
+ env:
59
+ PYTHONPATH: src
60
+ PYTHONDONTWRITEBYTECODE: "1"
61
+ - run: python -m pip install --disable-pip-version-check build==1.6.1
62
+ - run: python -m build
63
+ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
64
+ with:
65
+ name: dist
66
+ path: dist/
67
+ if-no-files-found: error
68
+ retention-days: 7
69
+
70
+ publish:
71
+ needs: build
72
+ runs-on: ubuntu-latest
73
+ timeout-minutes: 10
74
+ environment: publish
75
+ permissions:
76
+ contents: read
77
+ id-token: write # PyPI trusted publishing and attestations
78
+ steps:
79
+ - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
80
+ with:
81
+ name: dist
82
+ path: dist/
83
+ - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
84
+ with:
85
+ packages-dir: dist/
@@ -0,0 +1,8 @@
1
+ node_modules/
2
+ dist/
3
+ __pycache__/
4
+ *.pyc
5
+ .env
6
+ .env.*
7
+ *.log
8
+ *.tgz
@@ -0,0 +1,127 @@
1
+ {
2
+ "sdk": "python",
3
+ "version": "0.2.1",
4
+ "commit": "7123eed7548955503c2afe1e8ebd97b9da6fb263",
5
+ "files": [
6
+ {
7
+ "path": ".github/CODEOWNERS",
8
+ "sha256": "144109cee8f95a3badea6fac91e28e6d3a9d94643c3b89375d44167b5491d8d4"
9
+ },
10
+ {
11
+ "path": ".github/ISSUE_TEMPLATE/bug_report.yml",
12
+ "sha256": "7b75730158ae863390fb349df04a5f93b4ac1d642bee811135e4383c8f37fb67"
13
+ },
14
+ {
15
+ "path": ".github/ISSUE_TEMPLATE/config.yml",
16
+ "sha256": "160b810645105cdbd99855206e070b34a4657b2bf60828a66fd1137a94e9f984"
17
+ },
18
+ {
19
+ "path": ".github/pull_request_template.md",
20
+ "sha256": "17bb659bd19f944027823f9bd217704bbad32a54849d0e666662f77671e8d2b5"
21
+ },
22
+ {
23
+ "path": ".github/workflows/publish.yml",
24
+ "sha256": "1a06b226f5e82715eee2e79f7a567e2fe9ab6c0071d21699fd0fe6a3bd62907c"
25
+ },
26
+ {
27
+ "path": ".gitignore",
28
+ "sha256": "f1095da4fce29d500a89fc55a8c849d97b4bcf9e147b40a90ae9a9aa1ac54b4d"
29
+ },
30
+ {
31
+ "path": "CONTRIBUTING.md",
32
+ "sha256": "2fbd2618f78fc4d08f5b5a9af5c08531c0043d8ed437598dad629029f42958f8"
33
+ },
34
+ {
35
+ "path": "LICENSE",
36
+ "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"
37
+ },
38
+ {
39
+ "path": "NOTICE",
40
+ "sha256": "7f9872aa68373dce3b08f14d20bc44949db215a7615c1c63f150b3db197c1731"
41
+ },
42
+ {
43
+ "path": "README.md",
44
+ "sha256": "7cd19a7bda0d00c3378c73adf9f33cc0e05fc2b5c6843229af6b235231cf9f74"
45
+ },
46
+ {
47
+ "path": "SECURITY.md",
48
+ "sha256": "df1799b7e38761e44463c711a4835ec1691166bd78edce9dac182a1f6ff0b4f3"
49
+ },
50
+ {
51
+ "path": "examples/send_event.py",
52
+ "sha256": "be5749f9e53a3c44aa7a536a57083f78c5d9d08864cbdd8b5ec021a969f3a081"
53
+ },
54
+ {
55
+ "path": "examples/verify_webhook.py",
56
+ "sha256": "2c84be6eb1a9c60d91959daca9eadf957cd2fd2582953677cbb206cfe5f9f7f8"
57
+ },
58
+ {
59
+ "path": "pyproject.toml",
60
+ "sha256": "1389f77fb8aeb8148368736fae4ab6e0fc458ff9b8d05c89e99f9c51fd21cb09"
61
+ },
62
+ {
63
+ "path": "src/getlurk/__init__.py",
64
+ "sha256": "bd8c18000bde09f399b5f6738b45645484127ead7e1fdfa9523d40f9e19d7426"
65
+ },
66
+ {
67
+ "path": "src/getlurk/_generated/__init__.py",
68
+ "sha256": "e0ce3e07aeb02bbd46b410f8db596e959fcf106e4e49a0bb139aaafa88cbbf76"
69
+ },
70
+ {
71
+ "path": "src/getlurk/_generated/operations.py",
72
+ "sha256": "fab6aeab7465f03f1610f9c63adeddd8126c16db1ccead712827c16d45850c57"
73
+ },
74
+ {
75
+ "path": "src/getlurk/_generated/resources.py",
76
+ "sha256": "2d547bb8ec60d43bc5e618892edceb1363db9d1999b655b526100eb39ed2f9b2"
77
+ },
78
+ {
79
+ "path": "src/getlurk/_generated/schema.py",
80
+ "sha256": "111ec45d8f4b7db999a5a01ed7cdc7af56265db59bc09023e2c46312bd05b45e"
81
+ },
82
+ {
83
+ "path": "src/getlurk/_generated/types.py",
84
+ "sha256": "d3f75cfcc2e10e1ef1205cfb9051e8abb4a7c45bb89cb07d89f7ee201aa8a877"
85
+ },
86
+ {
87
+ "path": "src/getlurk/aio.py",
88
+ "sha256": "a693a8e685dffaa98f334959dd49f97c79afc729b311b321a16533ad1fb76164"
89
+ },
90
+ {
91
+ "path": "src/getlurk/client.py",
92
+ "sha256": "6148c22eef8effac727df20567cf3cf71943beca7460e4de147ed870c181cec5"
93
+ },
94
+ {
95
+ "path": "src/getlurk/errors.py",
96
+ "sha256": "5c2592732e28afe6220480b21049f442fa7b1729db6e038715b7d8adbe60c792"
97
+ },
98
+ {
99
+ "path": "src/getlurk/options.py",
100
+ "sha256": "b11b8006e5ced204108437183c0c65355ee20f27e4a494638c100f02ce469804"
101
+ },
102
+ {
103
+ "path": "src/getlurk/py.typed",
104
+ "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
105
+ },
106
+ {
107
+ "path": "src/getlurk/webhooks.py",
108
+ "sha256": "841614f3ee6568bb43499a4c6d6833187680cdfd2ee95d291d0e7560144cadb5"
109
+ },
110
+ {
111
+ "path": "tests/__init__.py",
112
+ "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
113
+ },
114
+ {
115
+ "path": "tests/test_aio.py",
116
+ "sha256": "065310d29a2c3987f925000866b7553ceb6578394ad0fca60d7f4250fc843501"
117
+ },
118
+ {
119
+ "path": "tests/test_client.py",
120
+ "sha256": "ac3e55d6fecbdd673f85ece4cb2837818bb5629033da7acc0f69939725560cd9"
121
+ },
122
+ {
123
+ "path": "tests/test_webhooks.py",
124
+ "sha256": "a305412374b5c24b2406652fab4e51d58d3017f5c9da57f79e198e490d98384e"
125
+ }
126
+ ]
127
+ }
@@ -0,0 +1,10 @@
1
+ # Contributing
2
+
3
+ This repository is **generated** from Lurk's private monorepo and is overwritten on each release, so a pull request cannot be merged here.
4
+
5
+ - **Found a bug, or something confusing?** Open an issue. Say the SDK version, your runtime, what you did and the `request_id` from the error. Never include a key.
6
+ - **Have a fix?** You are welcome to open a pull request as a way of showing us the change. A maintainer applies it upstream, with you credited as
7
+ co-author, and it arrives in the next release; we close the pull request with a link to that release.
8
+ - **Sign your commits off** (`git commit -s`): by doing so you certify the [Developer Certificate of Origin 1.1](https://developercertificate.org/).
9
+ This SDK is licensed under Apache-2.0 and we do not ask for a separate agreement.
10
+ - **Security problems** go to security@getlurk.com, not here (see SECURITY.md).
getlurk-0.2.1/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
getlurk-0.2.1/NOTICE ADDED
@@ -0,0 +1,6 @@
1
+ Lurk SDK for Python (getlurk)
2
+ Copyright 2026 Drip Rewards Inc.
3
+
4
+ Licensed under the Apache License, Version 2.0 (see LICENSE).
5
+
6
+ "Lurk", the Lurk logo and the lurk mark are trademarks of Drip Rewards Inc. The Apache License does not grant permission to use them.
getlurk-0.2.1/PKG-INFO ADDED
@@ -0,0 +1,53 @@
1
+ Metadata-Version: 2.5
2
+ Name: getlurk
3
+ Version: 0.2.1
4
+ Summary: The Lurk API for Python
5
+ Project-URL: Homepage, https://github.com/getlurk/lurk-sdk-py
6
+ Project-URL: Source, https://github.com/getlurk/lurk-sdk-py
7
+ Project-URL: Issues, https://github.com/getlurk/lurk-sdk-py/issues
8
+ License: Apache-2.0
9
+ License-File: LICENSE
10
+ License-File: NOTICE
11
+ Requires-Python: >=3.11
12
+ Description-Content-Type: text/markdown
13
+
14
+ # lurk (Python SDK)
15
+
16
+ The official Lurk API client for Python 3.11 and newer, with no dependencies.
17
+
18
+ ```bash
19
+ pip install getlurk
20
+ ```
21
+
22
+ ```python
23
+ from getlurk import Lurk
24
+
25
+ lurk = Lurk() # reads the key from LURK_KEY
26
+ receipt = lurk.events.send({"event": "checkin.scanned", "user": "maya@example.com"})
27
+ ```
28
+
29
+ Pass the input as a dict (typed by `getlurk.types.EventsSendInput`) or as keywords: `lurk.events.send(event="checkin.scanned", user="maya@example.com")`.
30
+
31
+ **Keep the key on your server.** A secret key (`lurk_sk_…`) must never reach a browser or an app. Start in a Staging project so nothing reaches
32
+ real people until you mean it. See [docs.getlurk.com](https://docs.getlurk.com) for the guides.
33
+
34
+ ## What it does for you
35
+
36
+ - **Idempotency keys.** Every write that can carry one gets one, made once per call and sent again on every retry. Pass your own with `options=RequestOptions(idempotency_key=...)`.
37
+ - **Retries, only where they are safe.** Reads and writes with a key are retried on a connection error, `408` and `5xx`, twice by default, with jittered backoff. A rate-limit answer (`429`) is
38
+ retried after the `Retry-After` it gives (up to 60 seconds; longer raises so you can decide). A write with no key (`api_keys.create`, `webhook_endpoints.create`) is never repeated.
39
+ - **Typed errors.** `LurkError` has `status`, `code`, `param`, `request_id`, `doc_url` and `retry_after_seconds`; `LurkConnectionError` means there was no answer.
40
+ - **Pages.** `for rule in lurk.paginate("rules.list")` fetches the next page as you go.
41
+ - **asyncio.** `AsyncLurk` takes the same arguments and has the same methods, awaited: `await lurk.events.send(...)` and `async for rule in lurk.paginate("rules.list")`. Calls run on a worker thread, so they never block your event loop, and idempotency keys, retries and typed errors are the sync client's.
42
+ - **Webhook checks.** `construct_event(body, headers, secret)` verifies a delivery's signature and returns the event.
43
+ - **Your own transport.** `Lurk(transport=...)` replaces the HTTP call (a proxy, another library, a test double).
44
+
45
+ ## Versions and changes
46
+
47
+ The SDK follows [semantic versioning](https://semver.org). The API's changes and the SDK's are in the [changelog](https://docs.getlurk.com/changelog).
48
+ Only the latest major version receives fixes.
49
+
50
+ ## Help
51
+
52
+ Open an [issue](https://github.com/getlurk/lurk-sdk-py/issues) (never include a key; the `request_id` of an error is enough), or read
53
+ [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md). Licensed under the Apache License 2.0 (see [LICENSE](LICENSE) and [NOTICE](NOTICE)).
@@ -0,0 +1,40 @@
1
+ # lurk (Python SDK)
2
+
3
+ The official Lurk API client for Python 3.11 and newer, with no dependencies.
4
+
5
+ ```bash
6
+ pip install getlurk
7
+ ```
8
+
9
+ ```python
10
+ from getlurk import Lurk
11
+
12
+ lurk = Lurk() # reads the key from LURK_KEY
13
+ receipt = lurk.events.send({"event": "checkin.scanned", "user": "maya@example.com"})
14
+ ```
15
+
16
+ Pass the input as a dict (typed by `getlurk.types.EventsSendInput`) or as keywords: `lurk.events.send(event="checkin.scanned", user="maya@example.com")`.
17
+
18
+ **Keep the key on your server.** A secret key (`lurk_sk_…`) must never reach a browser or an app. Start in a Staging project so nothing reaches
19
+ real people until you mean it. See [docs.getlurk.com](https://docs.getlurk.com) for the guides.
20
+
21
+ ## What it does for you
22
+
23
+ - **Idempotency keys.** Every write that can carry one gets one, made once per call and sent again on every retry. Pass your own with `options=RequestOptions(idempotency_key=...)`.
24
+ - **Retries, only where they are safe.** Reads and writes with a key are retried on a connection error, `408` and `5xx`, twice by default, with jittered backoff. A rate-limit answer (`429`) is
25
+ retried after the `Retry-After` it gives (up to 60 seconds; longer raises so you can decide). A write with no key (`api_keys.create`, `webhook_endpoints.create`) is never repeated.
26
+ - **Typed errors.** `LurkError` has `status`, `code`, `param`, `request_id`, `doc_url` and `retry_after_seconds`; `LurkConnectionError` means there was no answer.
27
+ - **Pages.** `for rule in lurk.paginate("rules.list")` fetches the next page as you go.
28
+ - **asyncio.** `AsyncLurk` takes the same arguments and has the same methods, awaited: `await lurk.events.send(...)` and `async for rule in lurk.paginate("rules.list")`. Calls run on a worker thread, so they never block your event loop, and idempotency keys, retries and typed errors are the sync client's.
29
+ - **Webhook checks.** `construct_event(body, headers, secret)` verifies a delivery's signature and returns the event.
30
+ - **Your own transport.** `Lurk(transport=...)` replaces the HTTP call (a proxy, another library, a test double).
31
+
32
+ ## Versions and changes
33
+
34
+ The SDK follows [semantic versioning](https://semver.org). The API's changes and the SDK's are in the [changelog](https://docs.getlurk.com/changelog).
35
+ Only the latest major version receives fixes.
36
+
37
+ ## Help
38
+
39
+ Open an [issue](https://github.com/getlurk/lurk-sdk-py/issues) (never include a key; the `request_id` of an error is enough), or read
40
+ [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md). Licensed under the Apache License 2.0 (see [LICENSE](LICENSE) and [NOTICE](NOTICE)).
@@ -0,0 +1,9 @@
1
+ # Security
2
+
3
+ Please report a vulnerability to **security@getlurk.com**, or privately through this repository's **Security** tab ("Report a vulnerability").
4
+ Do not open a public issue for it. We acknowledge within 2 business days.
5
+
6
+ This SDK is **generated** from Lurk's API description and released as a snapshot; a fix ships as a patch release of the latest version.
7
+ Only the latest major version is supported.
8
+
9
+ Never put a Lurk secret key (`lurk_sk_…`) or a webhook secret in an issue, a log or a screenshot. If you did, revoke it in the dashboard first.
@@ -0,0 +1,14 @@
1
+ from getlurk import Lurk
2
+
3
+ lurk = Lurk() # reads the key from LURK_KEY
4
+
5
+ receipt = lurk.events.send(
6
+ {
7
+ "event": "checkin.scanned",
8
+ "user": "maya@example.com",
9
+ "properties": {"venue": "mission-st"},
10
+ "idempotency_key": "chk-mission-st-maya-0812",
11
+ }
12
+ )
13
+
14
+ print(receipt["receipts"])
@@ -0,0 +1,18 @@
1
+ import os
2
+
3
+ from flask import Flask, abort, request # any framework: you only need the raw body and the headers
4
+
5
+ from getlurk import WebhookVerificationError, construct_event
6
+
7
+ app = Flask(__name__)
8
+
9
+
10
+ @app.post("/webhooks/lurk")
11
+ def lurk_webhook():
12
+ try:
13
+ event = construct_event(request.get_data(), request.headers, os.environ["LURK_WEBHOOK_SECRET"])
14
+ except WebhookVerificationError:
15
+ abort(400)
16
+ if event["type"] == "activity.created":
17
+ print(event["data"]["receipts"])
18
+ return "", 204
@@ -0,0 +1,21 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "getlurk"
7
+ version = "0.2.1"
8
+ description = "The Lurk API for Python"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ dependencies = []
12
+ license = { text = "Apache-2.0" }
13
+ license-files = ["LICENSE", "NOTICE"]
14
+
15
+ [tool.hatch.build.targets.wheel]
16
+ packages = ["src/getlurk"]
17
+
18
+ [project.urls]
19
+ Homepage = "https://github.com/getlurk/lurk-sdk-py"
20
+ Source = "https://github.com/getlurk/lurk-sdk-py"
21
+ Issues = "https://github.com/getlurk/lurk-sdk-py/issues"