Getting Started
Welcome to the Getting Started section of Nyctibius. This guide will walk you through the steps to install and start using the library in your projects.
Installation
To install Nyctibius, you can use the following command:
pip install nyctibius
Make sure you have Python 3.x installed on your system; the package requires Python version 3.7 or higher.
Usage
To use the Nyctibius package, follow these steps:
-
Import the package in your Python script:
from nyctibius import Harmonizer
-
Create an instance of the
Harmonizer
class:harmonizer = Harmonizer()
Harmonize has three core functionalities: extract
, load
, and transform
. The extract
method retrieves data from online or sources, the transform
method modifies the data in different formats into the same dataframe structure, and the load
method merges the data into a relational database.
-
Extract data from online sources and create a list of data information:
url = 'https://www.example.com' depth = 0 ext = 'csv' list_datainfo = harmonizer.extract(url=url, depth=depth, ext=ext) harmonizer = Harmonizer(list_datainfo)
-
Transform the data extracted from different sources into the same dataframe structure:
harmonizer.transform()
-
Load the data from the list of data information and merge it into a relational database:
results = harmonizer.load()
After loading the data, you can perform modifications and queries on the database. The Modifier
class allows you to modify the database, while the Querier
class enables you to query the database.
-
Import the modifier module and create an instance of the
Modifier
class:from nyctibius.db.modifier import Modifier modifier = Modifier(db_path='_path_/data/output/nyctibius.db')
-
Perform modifications:
tables = modifier.get_tables() print(tables)
-
Import the querier module and create an instance of the
Querier
class:from nyctibius.db.querier import Querier querier = Querier(db_path='_path_/data/output/nyctibius.db')
-
Perform queries:
querier.query('SELECT * FROM table_name')