-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hi,
I'm using Jupyter Notebook to execute the following code:
import json
from nakamoto import SectorNakamoto, Nakamoto
from nakamoto.sector import CustomSector, Client, Geography, Market, Repository
currency = 'ETC'
nakamoto_config = {
'plot_notebook': True,
'plot_image_path': 'image.png'
}
market_url = 'https://coinmarketcap.com/currencies/ethereum-classic/#markets'
market = Market(currency, market_url, **nakamoto_config)
client = Client(currency, **nakamoto_config)
The problem is that Market(currency, market_url, **nakamoto_config)
throw this error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-30-b88230843554> in <module>
13
14 market_url = 'https://coinmarketcap.com/currencies/ethereum-classic/#markets'
---> 15 market = Market(currency, market_url, **nakamoto_config)
16
17 client = Client(currency, **nakamoto_config)
~/anaconda3/lib/python3.7/site-packages/nakamoto/sector/market.py in __init__(self, currency, market_url, **kwargs)
10 self.type = 'market'
11 self.market_url = market_url
---> 12 self.generate_market_data()
13
14 def generate_market_data(self):
~/anaconda3/lib/python3.7/site-packages/nakamoto/sector/market.py in generate_market_data(self)
17 table = r.html.find('#markets-table', first=True)
18 session.close()
---> 19 market_df = pd.read_html(table.html)[0]
20 volume_data = market_df['Volume (24h)']
21 volume_data = volume_data.str.replace('$', '', regex=False)
AttributeError: 'NoneType' object has no attribute 'html'
If I comment the markets lines client throw this error:
---------------------------------------------------------------------------
JSONDecodeError Traceback (most recent call last)
<ipython-input-29-34b9cc44f973> in <module>
15 #market = Market(currency, market_url, **nakamoto_config)
16
---> 17 client = Client(currency, **nakamoto_config)
~/anaconda3/lib/python3.7/site-packages/nakamoto/sector/client.py in __init__(self, currency, **kwargs)
12 ether_test = (self.currency == 'ETC') or (self.currency == 'ETH')
13 if ether_test:
---> 14 self.generate_evm_client_data()
15 else:
16 raise "Node Client only implemented for EVM-based Nodes"
~/anaconda3/lib/python3.7/site-packages/nakamoto/sector/client.py in generate_evm_client_data(self)
30
31 response = requests.get(url)
---> 32 response_hash = json.loads(response.text).get('data')
33 df = pd.DataFrame.from_dict(response_hash)
34 client_raw = df.groupby('client').nunique()
~/anaconda3/lib/python3.7/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
346 parse_int is None and parse_float is None and
347 parse_constant is None and object_pairs_hook is None and not kw):
--> 348 return _default_decoder.decode(s)
349 if cls is None:
350 cls = JSONDecoder
~/anaconda3/lib/python3.7/json/decoder.py in decode(self, s, _w)
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
339 if end != len(s):
~/anaconda3/lib/python3.7/json/decoder.py in raw_decode(self, s, idx)
353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Do I use it right ? Any Idea about how to solve it ?
Metadata
Metadata
Assignees
Labels
No labels