@@ -5,8 +5,7 @@ Simple DNS resolver for asyncio
5
5
.. image :: https://secure.travis-ci.org/saghul/aiodns.png?branch=master
6
6
:target: http://travis-ci.org/saghul/aiodns
7
7
8
- aiodns provides a simple way for doing asynchronous DNS resolutions
9
- with a synchronous looking interface by using `pycares <https://github.com/saghul/pycares >`_.
8
+ aiodns provides a simple way for doing asynchronous DNS resolutions using `pycares <https://github.com/saghul/pycares >`_.
10
9
11
10
12
11
Example
@@ -17,22 +16,6 @@ Example
17
16
import asyncio
18
17
import aiodns
19
18
20
- loop = asyncio.get_event_loop()
21
- resolver = aiodns.DNSResolver(loop=loop)
22
- f = resolver.query('google.com','A')
23
- result = loop.run_until_complete(f)
24
- print(result)
25
-
26
-
27
- The following query types are supported: A, AAAA, CNAME, MX, NAPTR, NS, PTR, SOA, SRV, TXT.
28
-
29
- The library supports both *asyncio * and *Trollius *.
30
-
31
- If you use use Python 3.5+, you can use the `async ` and `await ` statements::
32
-
33
- import asyncio
34
- import aiodns
35
-
36
19
loop = asyncio.get_event_loop()
37
20
resolver = aiodns.DNSResolver(loop=loop)
38
21
@@ -43,18 +26,8 @@ If you use use Python 3.5+, you can use the `async` and `await` statements::
43
26
result = loop.run_until_complete(coro)
44
27
45
28
29
+ The following query types are supported: A, AAAA, ANY, CNAME, MX, NAPTR, NS, PTR, SOA, SRV, TXT.
46
30
47
- If you use Python 3.3/3.4 you may use `yield from ` statement::
48
-
49
- @asyncio.coroutine
50
- def func():
51
- result = yield from resolver.query('google.com','A')
52
-
53
- For Trollius you should use another syntax like::
54
-
55
- @trollius.coroutine
56
- def func():
57
- result = yield trollius.From(resolver.query('google.com','A'))
58
31
59
32
API
60
33
===
@@ -81,7 +54,7 @@ The API is pretty simple, three functions are provided in the ``DNSResolver`` cl
81
54
Running the test suite
82
55
======================
83
56
84
- To run the test suite: ``python test_aiodns .py ``
57
+ To run the test suite: ``python tests .py ``
85
58
86
59
87
60
Author
@@ -99,8 +72,7 @@ aiodns uses the MIT license, check LICENSE file.
99
72
Python versions
100
73
===============
101
74
102
- Python >= 3.4 is natively supported. Python 3.3 supported using the `asyncio package <https://pypi.python.org/pypi/asyncio >`_.
103
- Older Python versions(2.6 - 3.2) are supported using `trollius <https://pypi.python.org/pypi/trollius >`_.
75
+ Python >= 3.5 are supported.
104
76
105
77
106
78
Contributing
0 commit comments