Loader¶
Loader fetches data from data sources.
Each Loader class is implemented for its corresponding data source.
For example, you can use CSVLoader
class to load CSV dataset.
from jubakit.loader.csv import CSVLoader
loader = CSVLoader('/path/to/dataset.csv')
The Loader outputs a dict-like (key-value) object for each record loaded from the data source:
>>> for record in loader:
... print(record)
{'name': 'John', 'age': '24', 'gender': 'male'}
{'name': 'Jane', 'age': '35', 'gender': 'female'}
{'name': 'Mary', 'age': '19', 'gender': 'female'}
List of Loaders¶
Loaders for the following data sources are bundled with Jubakit.
- Plain line-based streams and files –
jubakit.loader.core
- Array-like (Python lists, NumPy arrays, etc.) data structure –
jubakit.loader.array
- SciPy sparse matrix data structure –
jubakit.loader.sparse
- CSV files –
jubakit.loader.csv
- PostgreSQL data –
jubakit.loader.postgresql
- Twitter streams –
jubakit.loader.twitter
- Chain Loaders (that wraps other Loaders) –
jubakit.loader.chain
You can extend these Loaders or even write your own one. See Loader Development Guide for details.