pycares 4.4.0__cp311-cp311-win32.whl → 4.6.0__cp311-cp311-win32.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.
- pycares/__init__.py +150 -97
- pycares/_cares.pyd +0 -0
- pycares/_version.py +1 -1
- pycares/errno.py +2 -1
- pycares/py.typed +0 -0
- pycares/utils.py +7 -10
- pycares-4.6.0.dist-info/METADATA +164 -0
- pycares-4.6.0.dist-info/RECORD +12 -0
- {pycares-4.4.0.dist-info → pycares-4.6.0.dist-info}/WHEEL +1 -1
- pycares/_cares.cp311-win32.pyd +0 -0
- pycares-4.4.0.dist-info/METADATA +0 -271
- pycares-4.4.0.dist-info/RECORD +0 -11
- {pycares-4.4.0.dist-info → pycares-4.6.0.dist-info/licenses}/LICENSE +0 -0
- {pycares-4.4.0.dist-info → pycares-4.6.0.dist-info}/top_level.txt +0 -0
pycares/__init__.py
CHANGED
@@ -9,79 +9,68 @@ from . import errno
|
|
9
9
|
from .utils import ascii_bytes, maybe_str, parse_name
|
10
10
|
from ._version import __version__
|
11
11
|
|
12
|
-
import collections.abc
|
13
12
|
import socket
|
14
13
|
import math
|
15
14
|
import functools
|
16
15
|
import sys
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
"QUERY_CLASS_ANY" : "C_ANY",
|
76
|
-
}
|
77
|
-
|
78
|
-
for k, v in exported_pycares_symbols_map.items():
|
79
|
-
globals()[k] = getattr(_lib, v)
|
80
|
-
|
81
|
-
|
82
|
-
globals()['ARES_VERSION'] = maybe_str(_ffi.string(_lib.ares_version(_ffi.NULL)))
|
83
|
-
|
84
|
-
|
16
|
+
from collections.abc import Callable, Iterable
|
17
|
+
from typing import Any, Optional, Union
|
18
|
+
|
19
|
+
IP4 = tuple[str, int]
|
20
|
+
IP6 = tuple[str, int, int, int]
|
21
|
+
|
22
|
+
# Flag values
|
23
|
+
ARES_FLAG_USEVC = _lib.ARES_FLAG_USEVC
|
24
|
+
ARES_FLAG_PRIMARY = _lib.ARES_FLAG_PRIMARY
|
25
|
+
ARES_FLAG_IGNTC = _lib.ARES_FLAG_IGNTC
|
26
|
+
ARES_FLAG_NORECURSE = _lib.ARES_FLAG_NORECURSE
|
27
|
+
ARES_FLAG_STAYOPEN = _lib.ARES_FLAG_STAYOPEN
|
28
|
+
ARES_FLAG_NOSEARCH = _lib.ARES_FLAG_NOSEARCH
|
29
|
+
ARES_FLAG_NOALIASES = _lib.ARES_FLAG_NOALIASES
|
30
|
+
ARES_FLAG_NOCHECKRESP = _lib.ARES_FLAG_NOCHECKRESP
|
31
|
+
|
32
|
+
# Nameinfo flag values
|
33
|
+
ARES_NI_NOFQDN = _lib.ARES_NI_NOFQDN
|
34
|
+
ARES_NI_NUMERICHOST = _lib.ARES_NI_NUMERICHOST
|
35
|
+
ARES_NI_NAMEREQD = _lib.ARES_NI_NAMEREQD
|
36
|
+
ARES_NI_NUMERICSERV = _lib.ARES_NI_NUMERICSERV
|
37
|
+
ARES_NI_DGRAM = _lib.ARES_NI_DGRAM
|
38
|
+
ARES_NI_TCP = _lib.ARES_NI_TCP
|
39
|
+
ARES_NI_UDP = _lib.ARES_NI_UDP
|
40
|
+
ARES_NI_SCTP = _lib.ARES_NI_SCTP
|
41
|
+
ARES_NI_DCCP = _lib.ARES_NI_DCCP
|
42
|
+
ARES_NI_NUMERICSCOPE = _lib.ARES_NI_NUMERICSCOPE
|
43
|
+
ARES_NI_LOOKUPHOST = _lib.ARES_NI_LOOKUPHOST
|
44
|
+
ARES_NI_LOOKUPSERVICE = _lib.ARES_NI_LOOKUPSERVICE
|
45
|
+
ARES_NI_IDN = _lib.ARES_NI_IDN
|
46
|
+
ARES_NI_IDN_ALLOW_UNASSIGNED = _lib.ARES_NI_IDN_ALLOW_UNASSIGNED
|
47
|
+
ARES_NI_IDN_USE_STD3_ASCII_RULES = _lib.ARES_NI_IDN_USE_STD3_ASCII_RULES
|
48
|
+
|
49
|
+
# Bad socket
|
50
|
+
ARES_SOCKET_BAD = _lib.ARES_SOCKET_BAD
|
51
|
+
|
52
|
+
# Query types
|
53
|
+
QUERY_TYPE_A = _lib.T_A
|
54
|
+
QUERY_TYPE_AAAA = _lib.T_AAAA
|
55
|
+
QUERY_TYPE_ANY = _lib.T_ANY
|
56
|
+
QUERY_TYPE_CAA = _lib.T_CAA
|
57
|
+
QUERY_TYPE_CNAME = _lib.T_CNAME
|
58
|
+
QUERY_TYPE_MX = _lib.T_MX
|
59
|
+
QUERY_TYPE_NAPTR = _lib.T_NAPTR
|
60
|
+
QUERY_TYPE_NS = _lib.T_NS
|
61
|
+
QUERY_TYPE_PTR = _lib.T_PTR
|
62
|
+
QUERY_TYPE_SOA = _lib.T_SOA
|
63
|
+
QUERY_TYPE_SRV = _lib.T_SRV
|
64
|
+
QUERY_TYPE_TXT = _lib.T_TXT
|
65
|
+
|
66
|
+
# Query classes
|
67
|
+
QUERY_CLASS_IN = _lib.C_IN
|
68
|
+
QUERY_CLASS_CHAOS = _lib.C_CHAOS
|
69
|
+
QUERY_CLASS_HS = _lib.C_HS
|
70
|
+
QUERY_CLASS_NONE = _lib.C_NONE
|
71
|
+
QUERY_CLASS_ANY = _lib.C_ANY
|
72
|
+
|
73
|
+
ARES_VERSION = maybe_str(_ffi.string(_lib.ares_version(_ffi.NULL)))
|
85
74
|
PYCARES_ADDRTTL_SIZE = 256
|
86
75
|
|
87
76
|
|
@@ -138,7 +127,7 @@ def _query_cb(arg, status, timeouts, abuf, alen):
|
|
138
127
|
result = None
|
139
128
|
break
|
140
129
|
if r is not None:
|
141
|
-
if isinstance(r,
|
130
|
+
if isinstance(r, Iterable):
|
142
131
|
result.extend(r)
|
143
132
|
else:
|
144
133
|
result.append(r)
|
@@ -328,22 +317,22 @@ class Channel:
|
|
328
317
|
__qclasses__ = (_lib.C_IN, _lib.C_CHAOS, _lib.C_HS, _lib.C_NONE, _lib.C_ANY)
|
329
318
|
|
330
319
|
def __init__(self,
|
331
|
-
flags = None,
|
332
|
-
timeout = None,
|
333
|
-
tries = None,
|
334
|
-
ndots = None,
|
335
|
-
tcp_port = None,
|
336
|
-
udp_port = None,
|
337
|
-
servers = None,
|
338
|
-
domains = None,
|
339
|
-
lookups = None,
|
340
|
-
sock_state_cb = None,
|
341
|
-
socket_send_buffer_size = None,
|
342
|
-
socket_receive_buffer_size = None,
|
343
|
-
rotate = False,
|
344
|
-
local_ip = None,
|
345
|
-
local_dev = None,
|
346
|
-
resolvconf_path = None):
|
320
|
+
flags: Optional[int] = None,
|
321
|
+
timeout: Optional[float] = None,
|
322
|
+
tries: Optional[int] = None,
|
323
|
+
ndots: Optional[int] = None,
|
324
|
+
tcp_port: Optional[int] = None,
|
325
|
+
udp_port: Optional[int] = None,
|
326
|
+
servers: Optional[Iterable[Union[str, bytes]]] = None,
|
327
|
+
domains: Optional[Iterable[Union[str, bytes]]] = None,
|
328
|
+
lookups: Union[str, bytes, None] = None,
|
329
|
+
sock_state_cb: Optional[Callable[[int, bool, bool], None]] = None,
|
330
|
+
socket_send_buffer_size: Optional[int] = None,
|
331
|
+
socket_receive_buffer_size: Optional[int] = None,
|
332
|
+
rotate: bool = False,
|
333
|
+
local_ip: Union[str, bytes, None] = None,
|
334
|
+
local_dev: Optional[str] = None,
|
335
|
+
resolvconf_path: Union[str, bytes, None] = None):
|
347
336
|
|
348
337
|
channel = _ffi.new("ares_channel *")
|
349
338
|
options = _ffi.new("struct ares_options *")
|
@@ -430,11 +419,11 @@ class Channel:
|
|
430
419
|
if local_dev:
|
431
420
|
self.set_local_dev(local_dev)
|
432
421
|
|
433
|
-
def cancel(self):
|
422
|
+
def cancel(self) -> None:
|
434
423
|
_lib.ares_cancel(self._channel[0])
|
435
424
|
|
436
425
|
@property
|
437
|
-
def servers(self):
|
426
|
+
def servers(self) -> list[str]:
|
438
427
|
servers = _ffi.new("struct ares_addr_node **")
|
439
428
|
|
440
429
|
r = _lib.ares_get_servers(self._channel[0], servers)
|
@@ -457,7 +446,7 @@ class Channel:
|
|
457
446
|
return server_list
|
458
447
|
|
459
448
|
@servers.setter
|
460
|
-
def servers(self, servers):
|
449
|
+
def servers(self, servers: Iterable[Union[str, bytes]]) -> None:
|
461
450
|
c = _ffi.new("struct ares_addr_node[%d]" % len(servers))
|
462
451
|
for i, server in enumerate(servers):
|
463
452
|
if _lib.ares_inet_pton(socket.AF_INET, ascii_bytes(server), _ffi.addressof(c[i].addr.addr4)) == 1:
|
@@ -487,7 +476,7 @@ class Channel:
|
|
487
476
|
|
488
477
|
return rfds, wfds
|
489
478
|
|
490
|
-
def process_fd(self, read_fd, write_fd):
|
479
|
+
def process_fd(self, read_fd: int, write_fd: int) -> None:
|
491
480
|
_lib.ares_process_fd(self._channel[0], _ffi.cast("ares_socket_t", read_fd), _ffi.cast("ares_socket_t", write_fd))
|
492
481
|
|
493
482
|
def timeout(self, t = None):
|
@@ -509,7 +498,7 @@ class Channel:
|
|
509
498
|
|
510
499
|
return (tv.tv_sec + tv.tv_usec / 1000000.0)
|
511
500
|
|
512
|
-
def gethostbyaddr(self, addr, callback):
|
501
|
+
def gethostbyaddr(self, addr: str, callback: Callable[[Any, int], None]) -> None:
|
513
502
|
if not callable(callback):
|
514
503
|
raise TypeError("a callable is required")
|
515
504
|
|
@@ -528,7 +517,7 @@ class Channel:
|
|
528
517
|
_global_set.add(userdata)
|
529
518
|
_lib.ares_gethostbyaddr(self._channel[0], address, _ffi.sizeof(address[0]), family, _lib._host_cb, userdata)
|
530
519
|
|
531
|
-
def gethostbyname(self, name, family, callback):
|
520
|
+
def gethostbyname(self, name: str, family: socket.AddressFamily, callback: Callable[[Any, int], None]) -> None:
|
532
521
|
if not callable(callback):
|
533
522
|
raise TypeError("a callable is required")
|
534
523
|
|
@@ -536,7 +525,16 @@ class Channel:
|
|
536
525
|
_global_set.add(userdata)
|
537
526
|
_lib.ares_gethostbyname(self._channel[0], parse_name(name), family, _lib._host_cb, userdata)
|
538
527
|
|
539
|
-
def getaddrinfo(
|
528
|
+
def getaddrinfo(
|
529
|
+
self,
|
530
|
+
host: str,
|
531
|
+
port: Optional[int],
|
532
|
+
callback: Callable[[Any, int], None],
|
533
|
+
family: socket.AddressFamily = 0,
|
534
|
+
type: int = 0,
|
535
|
+
proto: int = 0,
|
536
|
+
flags: int = 0
|
537
|
+
) -> None:
|
540
538
|
if not callable(callback):
|
541
539
|
raise TypeError("a callable is required")
|
542
540
|
|
@@ -557,7 +555,7 @@ class Channel:
|
|
557
555
|
hints.ai_protocol = proto
|
558
556
|
_lib.ares_getaddrinfo(self._channel[0], parse_name(host), service, hints, _lib._addrinfo_cb, userdata)
|
559
557
|
|
560
|
-
def query(self, name, query_type, callback, query_class=None):
|
558
|
+
def query(self, name: str, query_type: str, callback: Callable[[Any, int], None], query_class: Optional[str] = None) -> None:
|
561
559
|
self._do_query(_lib.ares_query, name, query_type, callback, query_class=query_class)
|
562
560
|
|
563
561
|
def search(self, name, query_type, callback, query_class=None):
|
@@ -590,7 +588,7 @@ class Channel:
|
|
590
588
|
else:
|
591
589
|
raise ValueError("invalid IP address")
|
592
590
|
|
593
|
-
def getnameinfo(self, address, flags, callback):
|
591
|
+
def getnameinfo(self, address: Union[IP4, IP6], flags: int, callback: Callable[[Any, int], None]) -> None:
|
594
592
|
if not callable(callback):
|
595
593
|
raise TypeError("a callable is required")
|
596
594
|
|
@@ -849,7 +847,62 @@ class ares_addrinfo_result(AresResult):
|
|
849
847
|
_lib.ares_freeaddrinfo(ares_addrinfo)
|
850
848
|
|
851
849
|
|
850
|
+
__all__ = (
|
851
|
+
"ARES_FLAG_USEVC",
|
852
|
+
"ARES_FLAG_PRIMARY",
|
853
|
+
"ARES_FLAG_IGNTC",
|
854
|
+
"ARES_FLAG_NORECURSE",
|
855
|
+
"ARES_FLAG_STAYOPEN",
|
856
|
+
"ARES_FLAG_NOSEARCH",
|
857
|
+
"ARES_FLAG_NOALIASES",
|
858
|
+
"ARES_FLAG_NOCHECKRESP",
|
859
|
+
|
860
|
+
# Nameinfo flag values
|
861
|
+
"ARES_NI_NOFQDN",
|
862
|
+
"ARES_NI_NUMERICHOST",
|
863
|
+
"ARES_NI_NAMEREQD",
|
864
|
+
"ARES_NI_NUMERICSERV",
|
865
|
+
"ARES_NI_DGRAM",
|
866
|
+
"ARES_NI_TCP",
|
867
|
+
"ARES_NI_UDP",
|
868
|
+
"ARES_NI_SCTP",
|
869
|
+
"ARES_NI_DCCP",
|
870
|
+
"ARES_NI_NUMERICSCOPE",
|
871
|
+
"ARES_NI_LOOKUPHOST",
|
872
|
+
"ARES_NI_LOOKUPSERVICE",
|
873
|
+
"ARES_NI_IDN",
|
874
|
+
"ARES_NI_IDN_ALLOW_UNASSIGNED",
|
875
|
+
"ARES_NI_IDN_USE_STD3_ASCII_RULES",
|
876
|
+
|
877
|
+
# Bad socket
|
878
|
+
"ARES_SOCKET_BAD",
|
852
879
|
|
853
|
-
__all__ = exported_pycares_symbols + list(exported_pycares_symbols_map.keys()) + ['AresError', 'Channel', 'errno', '__version__']
|
854
880
|
|
855
|
-
|
881
|
+
# Query types
|
882
|
+
"QUERY_TYPE_A",
|
883
|
+
"QUERY_TYPE_AAAA",
|
884
|
+
"QUERY_TYPE_ANY",
|
885
|
+
"QUERY_TYPE_CAA",
|
886
|
+
"QUERY_TYPE_CNAME",
|
887
|
+
"QUERY_TYPE_MX",
|
888
|
+
"QUERY_TYPE_NAPTR",
|
889
|
+
"QUERY_TYPE_NS",
|
890
|
+
"QUERY_TYPE_PTR",
|
891
|
+
"QUERY_TYPE_SOA",
|
892
|
+
"QUERY_TYPE_SRV",
|
893
|
+
"QUERY_TYPE_TXT",
|
894
|
+
|
895
|
+
# Query classes
|
896
|
+
"QUERY_CLASS_IN",
|
897
|
+
"QUERY_CLASS_CHAOS",
|
898
|
+
"QUERY_CLASS_HS",
|
899
|
+
"QUERY_CLASS_NONE",
|
900
|
+
"QUERY_CLASS_ANY",
|
901
|
+
|
902
|
+
|
903
|
+
"ARES_VERSION",
|
904
|
+
"AresError",
|
905
|
+
"Channel",
|
906
|
+
"errno",
|
907
|
+
"__version__"
|
908
|
+
)
|
pycares/_cares.pyd
ADDED
Binary file
|
pycares/_version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
|
2
|
-
__version__ = '4.
|
2
|
+
__version__ = '4.6.0'
|
pycares/errno.py
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
from typing import Union
|
1
2
|
|
2
3
|
from ._cares import ffi as _ffi, lib as _lib
|
3
4
|
from .utils import maybe_str
|
@@ -41,7 +42,7 @@ for symbol in exported_pycares_symbols:
|
|
41
42
|
globals()["errorcode"][value] = symbol
|
42
43
|
|
43
44
|
|
44
|
-
def strerror(code):
|
45
|
+
def strerror(code: int) -> Union[str, bytes]:
|
45
46
|
return maybe_str(_ffi.string(_lib.ares_strerror(code)))
|
46
47
|
|
47
48
|
|
pycares/py.typed
ADDED
File without changes
|
pycares/utils.py
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
|
2
|
+
from typing import Union
|
3
|
+
|
2
4
|
try:
|
3
5
|
import idna as idna2008
|
4
6
|
except ImportError:
|
@@ -24,25 +26,20 @@ def maybe_str(data):
|
|
24
26
|
raise TypeError('only str (ascii encoding) and bytes are supported')
|
25
27
|
|
26
28
|
|
27
|
-
def
|
28
|
-
for c in text:
|
29
|
-
if ord(c) > 0x7f:
|
30
|
-
return False
|
31
|
-
return True
|
32
|
-
|
33
|
-
def parse_name_idna2008(name):
|
29
|
+
def parse_name_idna2008(name: str) -> str:
|
34
30
|
parts = name.split('.')
|
35
31
|
r = []
|
36
32
|
for part in parts:
|
37
|
-
if
|
33
|
+
if part.isascii():
|
38
34
|
r.append(part.encode('ascii'))
|
39
35
|
else:
|
40
36
|
r.append(idna2008.encode(part))
|
41
37
|
return b'.'.join(r)
|
42
38
|
|
43
|
-
|
39
|
+
|
40
|
+
def parse_name(name: Union[str, bytes]) -> bytes:
|
44
41
|
if isinstance(name, str):
|
45
|
-
if
|
42
|
+
if name.isascii():
|
46
43
|
return name.encode('ascii')
|
47
44
|
if idna2008 is not None:
|
48
45
|
return parse_name_idna2008(name)
|
@@ -0,0 +1,164 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: pycares
|
3
|
+
Version: 4.6.0
|
4
|
+
Summary: Python interface for c-ares
|
5
|
+
Home-page: http://github.com/saghul/pycares
|
6
|
+
Author: Saúl Ibarra Corretgé
|
7
|
+
Author-email: s@saghul.net
|
8
|
+
License: MIT
|
9
|
+
Platform: POSIX
|
10
|
+
Platform: Microsoft Windows
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
12
|
+
Classifier: Intended Audience :: Developers
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
14
|
+
Classifier: Operating System :: POSIX
|
15
|
+
Classifier: Operating System :: Microsoft :: Windows
|
16
|
+
Classifier: Programming Language :: Python
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
23
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
24
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
25
|
+
Requires-Python: >=3.9
|
26
|
+
Description-Content-Type: text/x-rst
|
27
|
+
License-File: LICENSE
|
28
|
+
Requires-Dist: cffi>=1.5.0
|
29
|
+
Provides-Extra: idna
|
30
|
+
Requires-Dist: idna>=2.1; extra == "idna"
|
31
|
+
Dynamic: author
|
32
|
+
Dynamic: author-email
|
33
|
+
Dynamic: classifier
|
34
|
+
Dynamic: description
|
35
|
+
Dynamic: description-content-type
|
36
|
+
Dynamic: home-page
|
37
|
+
Dynamic: license
|
38
|
+
Dynamic: license-file
|
39
|
+
Dynamic: platform
|
40
|
+
Dynamic: provides-extra
|
41
|
+
Dynamic: requires-dist
|
42
|
+
Dynamic: requires-python
|
43
|
+
Dynamic: summary
|
44
|
+
|
45
|
+
Looking for new maintainers
|
46
|
+
===========================
|
47
|
+
|
48
|
+
https://github.com/saghul/pycares/issues/139
|
49
|
+
|
50
|
+
pycares: Python interface for c-ares
|
51
|
+
====================================
|
52
|
+
|
53
|
+
pycares is a Python module which provides an interface to c-ares.
|
54
|
+
`c-ares <https://c-ares.org>`_ is a C library that performs
|
55
|
+
DNS requests and name resolutions asynchronously.
|
56
|
+
|
57
|
+
|
58
|
+
Documentation
|
59
|
+
-------------
|
60
|
+
|
61
|
+
http://readthedocs.org/docs/pycares/
|
62
|
+
|
63
|
+
|
64
|
+
Bundled c-ares
|
65
|
+
--------------
|
66
|
+
|
67
|
+
pycares currently bundles c-ares as a submodule for ease of building. Using the system
|
68
|
+
provided c-ares is possible if the ``PYCARES_USE_SYSTEM_LIB`` environment variable is
|
69
|
+
set to ``1`` when building.
|
70
|
+
|
71
|
+
NOTE: Versions prior to 4.0.0 used to embed a modified c-ares with extended TTL support.
|
72
|
+
That is no longer the case and as a result only A and AAAA records will have TTL information.
|
73
|
+
Follow this PR in uppstream c-ares, looks like TTLs will be added: https://github.com/c-ares/c-ares/pull/393
|
74
|
+
|
75
|
+
|
76
|
+
Installation
|
77
|
+
------------
|
78
|
+
|
79
|
+
GNU/Linux, macOS, Windows, others:
|
80
|
+
|
81
|
+
::
|
82
|
+
|
83
|
+
pip install pycares
|
84
|
+
|
85
|
+
FreeBSD:
|
86
|
+
|
87
|
+
::
|
88
|
+
|
89
|
+
cd /usr/ports/dns/py-pycares && make install
|
90
|
+
|
91
|
+
|
92
|
+
IDNA 2008 support
|
93
|
+
^^^^^^^^^^^^^^^^^
|
94
|
+
|
95
|
+
If the ``idna`` package is installed, pycares will support IDNA 2008 encoding otherwise the builtin idna codec will be used,
|
96
|
+
which provides IDNA 2003 support.
|
97
|
+
|
98
|
+
You can force this at installation time as follows:
|
99
|
+
|
100
|
+
::
|
101
|
+
|
102
|
+
pip install pycares[idna]
|
103
|
+
|
104
|
+
|
105
|
+
Running the test suite
|
106
|
+
----------------------
|
107
|
+
|
108
|
+
From the top level directory, run: ``python -m unittest -v``
|
109
|
+
|
110
|
+
NOTE: Running the tests requires internet access and are somewhat environment sensitive because real DNS quesries
|
111
|
+
are made, there is no mocking. If you observe a failure that the CI cannot reproduce, please try to setup an
|
112
|
+
environment as close as the current CI.
|
113
|
+
|
114
|
+
|
115
|
+
Using it from the cli, a la dig
|
116
|
+
-------------------------------
|
117
|
+
|
118
|
+
This module can be used directly from the command line in a similar fashion to dig (limited, of course):
|
119
|
+
|
120
|
+
::
|
121
|
+
|
122
|
+
$ python -m pycares google.com
|
123
|
+
;; QUESTION SECTION:
|
124
|
+
;google.com IN A
|
125
|
+
|
126
|
+
;; ANSWER SECTION:
|
127
|
+
google.com 300 IN A 172.217.17.142
|
128
|
+
|
129
|
+
$ python -m pycares mx google.com
|
130
|
+
;; QUESTION SECTION:
|
131
|
+
;google.com IN MX
|
132
|
+
|
133
|
+
;; ANSWER SECTION:
|
134
|
+
google.com 600 IN MX 50 alt4.aspmx.l.google.com
|
135
|
+
google.com 600 IN MX 10 aspmx.l.google.com
|
136
|
+
google.com 600 IN MX 40 alt3.aspmx.l.google.com
|
137
|
+
google.com 600 IN MX 20 alt1.aspmx.l.google.com
|
138
|
+
google.com 600 IN MX 30 alt2.aspmx.l.google.com
|
139
|
+
|
140
|
+
|
141
|
+
Author
|
142
|
+
------
|
143
|
+
|
144
|
+
Saúl Ibarra Corretgé <s@saghul.net>
|
145
|
+
|
146
|
+
|
147
|
+
License
|
148
|
+
-------
|
149
|
+
|
150
|
+
Unless stated otherwise on-file pycares uses the MIT license, check LICENSE file.
|
151
|
+
|
152
|
+
|
153
|
+
Supported Python versions
|
154
|
+
-------------------------
|
155
|
+
|
156
|
+
Python >= 3.9 are supported. Both CPython and PyPy are supported.
|
157
|
+
|
158
|
+
|
159
|
+
Contributing
|
160
|
+
------------
|
161
|
+
|
162
|
+
If you'd like to contribute, fork the project, make a patch and send a pull
|
163
|
+
request. Have a look at the surrounding code and please, make yours look
|
164
|
+
alike :-)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
pycares/__init__.py,sha256=FUE_1XczxLUO4f9jWARbumO4oAWM4eF1UBS9Cs0EiQw,32626
|
2
|
+
pycares/__main__.py,sha256=-WwwGX4NQ8hpOqrNuCy59quCQJt7IAwQXdQjga5s4WA,2880
|
3
|
+
pycares/_cares.pyd,sha256=55JQ2MTzY-zVme6BBKqZjNLbDmJRP2-p7t__6L-7CxU,106496
|
4
|
+
pycares/_version.py,sha256=MJZC_xBqothvBje6hgJoAUxF_5eXQehYQJjvordXTlQ,25
|
5
|
+
pycares/errno.py,sha256=87ma2-f61ZbeU-9o5rUUscHsD4_i7aU5eyU2e7bzruQ,1141
|
6
|
+
pycares/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
pycares/utils.py,sha256=ZzjEdkygbU3_B1g4SVwlDS949PhttJG2gK735_6G5Ps,1344
|
8
|
+
pycares-4.6.0.dist-info/licenses/LICENSE,sha256=ZzIVbIpf5QFzaiLCDSjxhvH5EViAWLVO-W4ZgBzWvb8,1090
|
9
|
+
pycares-4.6.0.dist-info/METADATA,sha256=6ztMhOO8J7uN5j4lwhCs9YnOpryWYEsr-l_1NUl82tM,4622
|
10
|
+
pycares-4.6.0.dist-info/WHEEL,sha256=I99dtlfkk-5L1B15Qfzj7-xiZvhh_dAlG7jM-T8z0MQ,97
|
11
|
+
pycares-4.6.0.dist-info/top_level.txt,sha256=nIeo7L2XUVBQZO2YE6pH7tlKaBWTfmmRcXbqe_NWYCw,15
|
12
|
+
pycares-4.6.0.dist-info/RECORD,,
|
pycares/_cares.cp311-win32.pyd
DELETED
Binary file
|
pycares-4.4.0.dist-info/METADATA
DELETED
@@ -1,271 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: pycares
|
3
|
-
Version: 4.4.0
|
4
|
-
Summary: Python interface for c-ares
|
5
|
-
Home-page: http://github.com/saghul/pycares
|
6
|
-
Author: Saúl Ibarra Corretgé
|
7
|
-
Author-email: s@saghul.net
|
8
|
-
License: MIT
|
9
|
-
Platform: POSIX
|
10
|
-
Platform: Microsoft Windows
|
11
|
-
Classifier: Development Status :: 5 - Production/Stable
|
12
|
-
Classifier: Intended Audience :: Developers
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
14
|
-
Classifier: Operating System :: POSIX
|
15
|
-
Classifier: Operating System :: Microsoft :: Windows
|
16
|
-
Classifier: Programming Language :: Python
|
17
|
-
Classifier: Programming Language :: Python :: 3
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
20
|
-
Classifier: Programming Language :: Python :: 3.10
|
21
|
-
Classifier: Programming Language :: Python :: 3.11
|
22
|
-
Classifier: Programming Language :: Python :: 3.12
|
23
|
-
Classifier: Programming Language :: Python :: Implementation :: CPython
|
24
|
-
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
25
|
-
Requires-Python: >=3.8
|
26
|
-
Description-Content-Type: text/x-rst
|
27
|
-
License-File: LICENSE
|
28
|
-
Requires-Dist: cffi >=1.5.0
|
29
|
-
Provides-Extra: idna
|
30
|
-
Requires-Dist: idna >=2.1 ; extra == 'idna'
|
31
|
-
|
32
|
-
Looking for new maintainers
|
33
|
-
|
34
|
-
===========================
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
https://github.com/saghul/pycares/issues/139
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
pycares: Python interface for c-ares
|
43
|
-
|
44
|
-
====================================
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
pycares is a Python module which provides an interface to c-ares.
|
49
|
-
|
50
|
-
`c-ares <https://c-ares.org>`_ is a C library that performs
|
51
|
-
|
52
|
-
DNS requests and name resolutions asynchronously.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
Documentation
|
59
|
-
|
60
|
-
-------------
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
http://readthedocs.org/docs/pycares/
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
Bundled c-ares
|
71
|
-
|
72
|
-
--------------
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
pycares currently bundles c-ares as a submodule for ease of building. Using the system
|
77
|
-
|
78
|
-
provided c-ares is possible if the ``PYCARES_USE_SYSTEM_LIB`` environment variable is
|
79
|
-
|
80
|
-
set to ``1`` when building.
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
NOTE: Versions prior to 4.0.0 used to embed a modified c-ares with extended TTL support.
|
85
|
-
|
86
|
-
That is no longer the case and as a result only A and AAAA records will have TTL information.
|
87
|
-
|
88
|
-
Follow this PR in uppstream c-ares, looks like TTLs will be added: https://github.com/c-ares/c-ares/pull/393
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
Installation
|
95
|
-
|
96
|
-
------------
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
GNU/Linux, macOS, Windows, others:
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
::
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
pip install pycares
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
FreeBSD:
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
::
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
cd /usr/ports/dns/py-pycares && make install
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
IDNA 2008 support
|
127
|
-
|
128
|
-
^^^^^^^^^^^^^^^^^
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
If the ``idna`` package is installed, pycares will support IDNA 2008 encoding otherwise the builtin idna codec will be used,
|
133
|
-
|
134
|
-
which provides IDNA 2003 support.
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
You can force this at installation time as follows:
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
::
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
pip install pycares[idna]
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
Running the test suite
|
153
|
-
|
154
|
-
----------------------
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
From the top level directory, run: ``python -m unittest -v``
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
NOTE: Running the tests requires internet access and are somewhat environment sensitive because real DNS quesries
|
163
|
-
|
164
|
-
are made, there is no mocking. If you observe a failure that the CI cannot reproduce, please try to setup an
|
165
|
-
|
166
|
-
environment as close as the current CI.
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
Using it from the cli, a la dig
|
173
|
-
|
174
|
-
-------------------------------
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
This module can be used directly from the command line in a similar fashion to dig (limited, of course):
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
::
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
$ python -m pycares google.com
|
187
|
-
|
188
|
-
;; QUESTION SECTION:
|
189
|
-
|
190
|
-
;google.com IN A
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
;; ANSWER SECTION:
|
195
|
-
|
196
|
-
google.com 300 IN A 172.217.17.142
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
$ python -m pycares mx google.com
|
201
|
-
|
202
|
-
;; QUESTION SECTION:
|
203
|
-
|
204
|
-
;google.com IN MX
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
;; ANSWER SECTION:
|
209
|
-
|
210
|
-
google.com 600 IN MX 50 alt4.aspmx.l.google.com
|
211
|
-
|
212
|
-
google.com 600 IN MX 10 aspmx.l.google.com
|
213
|
-
|
214
|
-
google.com 600 IN MX 40 alt3.aspmx.l.google.com
|
215
|
-
|
216
|
-
google.com 600 IN MX 20 alt1.aspmx.l.google.com
|
217
|
-
|
218
|
-
google.com 600 IN MX 30 alt2.aspmx.l.google.com
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
Author
|
225
|
-
|
226
|
-
------
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
Saúl Ibarra Corretgé <s@saghul.net>
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
License
|
237
|
-
|
238
|
-
-------
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
Unless stated otherwise on-file pycares uses the MIT license, check LICENSE file.
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
Supported Python versions
|
249
|
-
|
250
|
-
-------------------------
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
Python >= 3.8 are supported. Both CPython and PyPy are supported.
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
Contributing
|
261
|
-
|
262
|
-
------------
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
If you'd like to contribute, fork the project, make a patch and send a pull
|
267
|
-
|
268
|
-
request. Have a look at the surrounding code and please, make yours look
|
269
|
-
|
270
|
-
alike :-)
|
271
|
-
|
pycares-4.4.0.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
pycares/__init__.py,sha256=EIkDaFs0MmRAYi6Ce2VzcA3H14-25zPyiD_6TfSBCSQ,30609
|
2
|
-
pycares/__main__.py,sha256=-WwwGX4NQ8hpOqrNuCy59quCQJt7IAwQXdQjga5s4WA,2880
|
3
|
-
pycares/_cares.cp311-win32.pyd,sha256=WgM7Bg81yKpwFkJqvFNZq-2-TSDC_xGsPcQzdO3ybqs,106496
|
4
|
-
pycares/_version.py,sha256=buznFPbE02AhKSlwGt5SQ5JVt8sGNwDi8x7ugj-5D08,25
|
5
|
-
pycares/errno.py,sha256=cForwpErZsnPUQYttEgUjWZgi37cyrOGCWxUcO76HUE,1089
|
6
|
-
pycares/utils.py,sha256=lKohvVcx0fjDcbkK0hGgvgY5WWnshj1Snxy-gGRbDNo,1399
|
7
|
-
pycares-4.4.0.dist-info/LICENSE,sha256=ZzIVbIpf5QFzaiLCDSjxhvH5EViAWLVO-W4ZgBzWvb8,1090
|
8
|
-
pycares-4.4.0.dist-info/METADATA,sha256=TpMurCYkzSHcxQ52Qw99F10bUdEusS_FGPr6U-qWvLc,4453
|
9
|
-
pycares-4.4.0.dist-info/WHEEL,sha256=1hQMSMLa8wpOIN866ksgBSFaZ-xM7VQgzYiKWe8vFok,98
|
10
|
-
pycares-4.4.0.dist-info/top_level.txt,sha256=nIeo7L2XUVBQZO2YE6pH7tlKaBWTfmmRcXbqe_NWYCw,15
|
11
|
-
pycares-4.4.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|