# Load necessary packages
import pandas as pd

# Define GitHub URL where climate data from Piracicaba is stored
url_1 = "https://github.com/FlorestaR/dados/blob/main/X_PIRACLIM/"
xls_2 = "DadosClima_Piracicaba.xlsx"
prm_3 = "?raw=true"
git_file = f"{url_1}{xls_2}{prm_3}"

# Define sheet name and column types (8 text columns, 16 numeric columns)
sheet_name = "DadosClima_Piracicaba"
dtype_dict = {i: 'category' for i in range(8)}  # First 8 columns as categories

# Load data from GitHub
# `engine='openpyxl'` ensures compatibility with Excel format

df = pd.read_excel(git_file, sheet_name=sheet_name, dtype=dtype_dict, engine='openpyxl')

# Show column names and structure of the dataframe
print(df.columns)
print(df.info())

# Shows first lines of the dataframe
print(df.head())