tdjson 1.8.56.post3__cp311-cp311-win_amd64.whl

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.

Potentially problematic release.


This version of tdjson might be problematic. Click here for more details.

tdjson/__init__.py ADDED
@@ -0,0 +1,16 @@
1
+ """""" # start delvewheel patch
2
+ def _delvewheel_patch_1_11_2():
3
+ import os
4
+ if os.path.isdir(libs_dir := os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'tdjson.libs'))):
5
+ os.add_dll_directory(libs_dir)
6
+
7
+
8
+ _delvewheel_patch_1_11_2()
9
+ del _delvewheel_patch_1_11_2
10
+ # end delvewheel patch
11
+
12
+ from .tdjson_ext import td_create_client_id, td_send, td_receive, td_execute
13
+
14
+ __version__ = "1.8.56.post3"
15
+ __copyright__ = "Copyright (c) 2025 AYMENJD"
16
+ __license__ = "MIT License"
tdjson/tdjson.cpp ADDED
@@ -0,0 +1,17 @@
1
+ #include <nanobind/nanobind.h>
2
+ #include <td/telegram/td_json_client.h>
3
+
4
+ namespace nb = nanobind;
5
+
6
+ NB_MODULE(tdjson_ext, m) {
7
+ m.def("td_create_client_id", &td_create_client_id, nb::call_guard<nb::gil_scoped_release>(),
8
+ "Returns an opaque identifier of a new TDLib instance")
9
+ .def("td_send", &td_send, nb::call_guard<nb::gil_scoped_release>(), nb::arg("client_id"), nb::arg("request"),
10
+ "Sends request to the TDLib client. May be called from any thread")
11
+ .def("td_receive", &td_receive, nb::call_guard<nb::gil_scoped_release>(), nb::arg("timeout"),
12
+ "Receives incoming updates and request responses. Must not be called simultaneously from two different "
13
+ "threads")
14
+ .def("td_execute", &td_execute, nb::call_guard<nb::gil_scoped_release>(), nb::arg("request"),
15
+ "Synchronously executes a TDLib request");
16
+ // TODO: td_set_log_message_callback?
17
+ }
Binary file
@@ -0,0 +1,2 @@
1
+ Version: 1.11.2
2
+ Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-qrxhze5s\\cp311-win_amd64\\build\\venv\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-qrxhze5s\\cp311-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-qrxhze5s\\cp311-win_amd64\\built_wheel\\tdjson-1.8.56.post3-cp311-cp311-win_amd64.whl']
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.2
2
+ Name: tdjson
3
+ Version: 1.8.56.post3
4
+ Summary: High-performance Python binding for TDLib JSON interface. Works on Linux x86_64, includes pre-built TDLib, and outperforms python ctypes
5
+ Keywords: tdlib,telegram,python-binding,high-performance,linux
6
+ Author-Email: AYMEN Mohammed <let.me.code.safe@gmail.com>
7
+ License: MIT
8
+ Project-URL: Source, https://github.com/AYMENJD/tdjson
9
+ Project-URL: Tracker, https://github.com/AYMENJD/tdjson/issues
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+
13
+ # tdjson [![Version](https://img.shields.io/pypi/v/tdjson?style=flat&logo=pypi)](https://pypi.org/project/tdjson) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.56-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/tdjson?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/tdjson)
14
+
15
+ `tdjson` is a high-performance Python binding for [TDLib](https://github.com/tdlib/td)'s JSON interface. Outperforms `ctypes`, and **includes** `TDLib` for easy setup and use. Mainly created for [Pytdbot](https://github.com/pytdbot/client)
16
+
17
+ ## Compatibility
18
+
19
+ `tdjson` is compatible with most Linux `x86_64` and `aarch64` (arm64) distributions that use `glibc 2.17+`. This includes most modern Linux distributions:
20
+
21
+ - Debian 8+
22
+ - Ubuntu 13.10+
23
+ - Fedora 19+
24
+ - RHEL 7+
25
+
26
+ ## Installation
27
+
28
+ You can install `tdjson` directly from PyPI:
29
+
30
+ ```bash
31
+ pip install tdjson
32
+ ```
33
+
34
+ ## Usage
35
+
36
+ Here’s a quick example to get you started:
37
+
38
+ ```python
39
+ import json
40
+ import tdjson
41
+
42
+ # Create a new TDLib client
43
+ client_id = tdjson.td_create_client_id()
44
+
45
+ # Send a request to TDLib
46
+ request = {"@type": "getOption", "name": "version"}
47
+ tdjson.td_send(client_id, json.dumps(request))
48
+
49
+ # Receive updates or responses
50
+ response = tdjson.td_receive(10.0)
51
+ print(response)
52
+
53
+ # Synchronously execute a TDLib request
54
+ result = tdjson.td_execute(json.dumps({"@type": "getTextEntities", "text": "@telegram /test_command https://telegram.org telegram.me", "@extra": ["5", 7.0, "a"]}))
55
+ print(result)
56
+ ```
57
+
58
+ For more detailed examples, check out the [examples](https://github.com/AYMENJD/tdjson/blob/main/examples) folder.
59
+
60
+ ## License
61
+
62
+ MIT [LICENSE](https://github.com/AYMENJD/tdjson/blob/main/LICENSE)
@@ -0,0 +1,13 @@
1
+ tdjson/tdjson.cpp,sha256=K0Anr2CnYUuFur1cxEYFb0a2gYRGajPdIS3uuxA0hrE,930
2
+ tdjson/tdjson_ext.cp311-win_amd64.pyd,sha256=eVNNzg2SHrol4mEgoC1YM4WEnE3BhRlAqD5tOPTX878,69632
3
+ tdjson/__init__.py,sha256=P6TObUW4NKCFaoI8k7oafnTT-9afQZ-1-VOHNa7BgYY,497
4
+ tdjson-1.8.56.post3.dist-info/DELVEWHEEL,sha256=7UKm9Y9N_oBORDgMw5Mutvt7Y2Rr4FKKw35F_IvdY10,406
5
+ tdjson-1.8.56.post3.dist-info/METADATA,sha256=cCHQKYK9JEwtrcMDfcpCN3pToe5E_g9xPjhxEJpQhNk,2282
6
+ tdjson-1.8.56.post3.dist-info/RECORD,,
7
+ tdjson-1.8.56.post3.dist-info/WHEEL,sha256=oXhHG6ewLm-FNdEna2zwgy-K0KEl4claZ1ztR4VTx0I,106
8
+ tdjson-1.8.56.post3.dist-info/licenses/LICENSE,sha256=5UtIwVyAt1vfjtGnPfb13fQ3MydM56MWonFOFO_TXtQ,1083
9
+ tdjson.libs/libcrypto-1_1-x64-e49918c764ec483eebd41c009e8eb34f.dll,sha256=5JkYx2TsSD7r1BwAno6zTxYhAx1DbgZ_2zqeuq0SDs4,3515904
10
+ tdjson.libs/libssl-1_1-x64-3bffe2c986c235bbe3dcf336937fc666.dll,sha256=eUd6uZANYoQN6_N-020QtTVL9uZjzICVoueeFSzSFVs,694272
11
+ tdjson.libs/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll,sha256=pMIim9wqKmMKzcCVtNhgCOXD47x3cxdDVPPaT1vrnN4,575056
12
+ tdjson.libs/tdjson-dd6612b1cc6e05f52c1cb67fc37280f8.dll,sha256=2ofoloOTxHqO6OIkdEBZXntyvsBnGHLjaYgTsaDNgzo,24933376
13
+ tdjson.libs/zlib1-cb7ab3788d10940df874acd97b1821bb.dll,sha256=y3qzeI0QlA34dKzZexghu7XuSpHz7sEZgrtb96PJZEM,120814
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: scikit-build-core 0.11.6
3
+ Root-Is-Purelib: false
4
+ Tag: cp311-cp311-win_amd64
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 AYMEN
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.