· 4 years ago · Apr 19, 2021, 12:22 AM
1Intro
2
3This wrapper has both asynchronous & synchronous support, this intro will cover the basic of both. Lucily for you the API for asynchronous (awaiting) & synchronous (blocking) is identical.
4
5Getting started
6
7Awaiting
8
9import proxycheck
10
11client = proxycheck.Awaiting(
12 key="..."
13)
14
15ip = client.ip("98.75.2.4")
16
17if await ip.proxy():
18 print("Is proxy")
19
20risk_score = await ip.risk()
21latitude, longitude = await ip.geological()
22
23data = await ip.get()
24
25# A client should always be closed after being used!
26await client.close()
27Blocking
28
29import proxycheck
30
31client = proxycheck.Blocking(
32 key="..."
33)
34
35ip = client.ip("98.75.2.4")
36
37if ip.proxy():
38 print("Is proxy")
39
40risk_score = ip.risk()
41latitude, longitude = ip.geological()
42
43data = ip.get()
44
45# Python's garbage collector should
46# close connections correctly for Blocking.
47client.close()
48