Example: Securities¶
Description:
In [1]:
Copied!
from morningpy.api.ticker import get_all_etfs
etfs = get_all_etfs()
print("ETFs:")
print(etfs.head())
from morningpy.api.ticker import get_all_etfs
etfs = get_all_etfs()
print("ETFs:")
print(etfs.head())
--------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[1], line 3 1 from morningpy.api.ticker import get_all_etfs ----> 3 etfs = get_all_etfs() 4 print("ETFs:") 5 print(etfs.head()) File c:\Users\Thomas\VS\morningpy\env\Lib\site-packages\morningpy\api\ticker.py:27, in get_all_etfs() 18 def get_all_etfs() -> pd.DataFrame: 19 """ 20 Get all tickers of type 'etf'. 21 (...) 25 DataFrame containing all ETF tickers. 26 """ ---> 27 return TickerExtractor(asset_type="etf").get() File c:\Users\Thomas\VS\morningpy\env\Lib\site-packages\morningpy\extractor\ticker.py:37, in TickerExtractor.__init__(self, asset_type, ticker, isin, performance_id) 35 self.isin = isin 36 self.performance_id = performance_id ---> 37 self.tickers = pd.read_parquet("data/tickers.parquet") File c:\Users\Thomas\VS\morningpy\env\Lib\site-packages\pandas\io\parquet.py:669, in read_parquet(path, engine, columns, storage_options, use_nullable_dtypes, dtype_backend, filesystem, filters, **kwargs) 666 use_nullable_dtypes = False 667 check_dtype_backend(dtype_backend) --> 669 return impl.read( 670 path, 671 columns=columns, 672 filters=filters, 673 storage_options=storage_options, 674 use_nullable_dtypes=use_nullable_dtypes, 675 dtype_backend=dtype_backend, 676 filesystem=filesystem, 677 **kwargs, 678 ) File c:\Users\Thomas\VS\morningpy\env\Lib\site-packages\pandas\io\parquet.py:258, in PyArrowImpl.read(self, path, columns, filters, use_nullable_dtypes, dtype_backend, storage_options, filesystem, **kwargs) 256 if manager == "array": 257 to_pandas_kwargs["split_blocks"] = True --> 258 path_or_handle, handles, filesystem = _get_path_or_handle( 259 path, 260 filesystem, 261 storage_options=storage_options, 262 mode="rb", 263 ) 264 try: 265 pa_table = self.api.parquet.read_table( 266 path_or_handle, 267 columns=columns, (...) 270 **kwargs, 271 ) File c:\Users\Thomas\VS\morningpy\env\Lib\site-packages\pandas\io\parquet.py:141, in _get_path_or_handle(path, fs, storage_options, mode, is_dir) 131 handles = None 132 if ( 133 not fs 134 and not is_dir (...) 139 # fsspec resources can also point to directories 140 # this branch is used for example when reading from non-fsspec URLs --> 141 handles = get_handle( 142 path_or_handle, mode, is_text=False, storage_options=storage_options 143 ) 144 fs = None 145 path_or_handle = handles.handle File c:\Users\Thomas\VS\morningpy\env\Lib\site-packages\pandas\io\common.py:882, in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options) 873 handle = open( 874 handle, 875 ioargs.mode, (...) 878 newline="", 879 ) 880 else: 881 # Binary mode --> 882 handle = open(handle, ioargs.mode) 883 handles.append(handle) 885 # Convert BytesIO or file objects passed with an encoding FileNotFoundError: [Errno 2] No such file or directory: 'data/tickers.parquet'