Skip to content

Commit 6e6cb9c

Browse files
author
Kotsias, Panagiotis-Christos
committed
Added content parser
1 parent f254f47 commit 6e6cb9c

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

etherscan/parsing.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import requests
2+
3+
4+
class ResponseParser:
5+
@staticmethod
6+
def _get_content(response: requests.Response):
7+
return response.json()
8+
9+
@staticmethod
10+
def get_status(response: requests.Response):
11+
c = ResponseParser._get_content(response)
12+
return c["status"]
13+
14+
@staticmethod
15+
def get_message(response: requests.Response):
16+
c = ResponseParser._get_content(response)
17+
return c["message"]
18+
19+
@staticmethod
20+
def get_result(response: requests.Response):
21+
c = ResponseParser._get_content(response)
22+
return c["result"]

0 commit comments

Comments
 (0)