Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 59 additions & 34 deletions GithubCloner2022.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,73 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import datetime
import pandas as pd

from Modules.DataFrameHandler_Mod.DFHandler import DataFrameHandler as DfH
from Modules.GetData_Mod.DataManager import DataManager as DM
from Modules.DataManager_Mod.DataManager import DataManager as DM
from Modules.Formatter_Mod.Formatter import Formatter as FMT
from Modules.PrintMessage_Mod.CloneMessenger import CloneMessenger as CM


# ?######### Start Basic Configuration ##########
filename = 'Github_Repositories.csv'
name = 'Github Repository Cloner'
version = '[V2.0.11]'
version = '[V2.0.12]'
author = '[FacuFalcone - CaidevOficial]'
fileConfigName = 'Modules/API_Info.json'
# ?######### End Basic Configuration ##########

try:
# ?#########? Start Initialization ##########
JsonFile = pd.read_json(f"./{fileConfigName}", orient='records')
JsonAPI = JsonFile['Github']
JsonDFConfigs = JsonFile['DataFrame']['Fields']
# ?#########? End Initialization ############

# ?#########? Start Objects Instances ##########
Handler = DfH()
Manager = DM()
# ?#########? End Objects Instances ##########

# ?#########? Start DataManager Configuration ##########
Manager.InitialConfig(name, version, author, JsonAPI)
# ?#########? End DataManager Configuration ##########

# ?#########? Start DataFrame Configuration ##########
#* Reads the 'csv' File to get the dataframe
df = pd.read_csv(filename)

#* Sets the Main DF to the class to handle it
Handler.MainDataFrame = df
Handler.ConfigsJsonValues = JsonDFConfigs
Handler.ConfigurateDataFrame(Handler.ConfigsJsonValues['Course'])
# ?#########? End DataFrame Configuration ##########

# ?#########? Start Initialize DataManager ##########
Manager.CloneRepositories(Handler)
# ?##########? End Initialize DataManager ###########

except Exception as e:
print(f'Exception: {e.args}')
if __name__ == '__main__':

start_time = datetime.datetime.now()
try:
# ?#########? Start Initialization ##########
JsonFile = pd.read_json(f"./{fileConfigName}", orient='records')
JsonAPI = JsonFile['Github']
JsonDFConfigs = JsonFile['DataFrame']['Fields']
# ?#########? End Initialization ############

# ?#########? Start Objects Instances ##########
Handler = DfH()
Manager = DM()
Messenger = CM()
Timer = FMT()
# ?#########? End Objects Instances ##########

# ?#########? Start DataManager Configuration ##########
Manager.InitialConfig(name, version, author, JsonAPI)
# ?#########? End DataManager Configuration ##########

# ?#########? Start DataFrame Configuration ##########
# *# Reads the 'csv' File to get the dataframe
df = pd.read_csv(filename)

# *# Sets the Main DF to the class to handle it
Handler.MainDataFrame = df
Handler.ConfigsJsonValues = JsonDFConfigs
Handler.ConfigurateDataFrame(Handler.ConfigsJsonValues['Course'])
# ?#########? End DataFrame Configuration ##########

# ?#########? Start Initialize DataManager ##########
Manager.CloneRepositories(Handler)
# ?##########? End Initialize DataManager ###########
except Exception as e:
print(f'Exception: {e.args}')
finally:
# ?#########? Start Timer Config ##########
Timer.CrudeTime = start_time
# ?#########? End Timer Config ##########

# ?#########? Start Print Message ##########
Messenger.Message = f"Elapsed Time: {Timer.FormattedTimeStr}"
Messenger.PrintMessage()

Messenger.Message = f"Thanks for using {name} {version} by {author}! ♥"
Messenger.PrintMessage()

Messenger.Message = "Success! All task done. Press a key to close the app"
Messenger.PrintMessage()
# ?#########? End Print Message ##########

end = input()
11 changes: 8 additions & 3 deletions Github_Repositories.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
"Marca temporal","Nombre/s","Apellido/s","División","DNI / Legajo","E-Mail","Link al repositorio"
"2022/02/13 10:26:52 p. m. GMT-3","Neptune","Romane God","1G - Professor 1 - Helper 1","222222","neptune@notplanet.com","https://github.com/caidevOficial/SPD2022_TPS.git"
"2022/02/13 10:26:52 p. m. GMT-3","Poseidon","Grecian God","1F - Professor 2 - Helper 2","333333","poseidon@sea.com","https://github.com/caidevOficial/Python_ITBA_IEEE.git"
"2022/02/13 10:26:52 p. m. GMT-3","Neptune","Romane God","1G - Professor 1 - Helper 1","222222","neptune@notplanet.com","https://github.com/caidevOficial/Python_RepositoryCloner"
"2022/02/13 10:26:52 p. m. GMT-3","Poseidon","Grecian God","1F - Professor 2 - Helper 2","333333","poseidon@sea.com","https://github.com/caidevOficial/Python_ITBA_IEEE"
"2022/02/13 10:26:52 p. m. GMT-3","Hades","Grecian God","1F - Professor 2 - Helper 2","111111","Hades@underworld.com","https://github.com/caidevOficial/CaidevOficial.git"
"2022/02/13 10:26:52 p. m. GMT-3","Zeus","Grecian God","1G - Professor 1 - Helper 1","444444","zeus@ray.com","https://github.com/caidevOficial/Python_IEEE_Team14293.git"
"2022/02/13 10:26:52 p. m. GMT-3","Zeus","Grecian God","1G - Professor 1 - Helper 1","444444","zeus@ray.com","https://github.com/caidevOficial/Python_RepositoryCloner.git"
"2022/02/13 10:26:52 p. m. GMT-3","Mercury","Romane God","1G - Professor 1 - Helper 1","222222","neptune@notplanet.com","https://github.com/caidevOficial/SPD2022_TPS.git"
"2022/02/13 10:26:52 p. m. GMT-3","Artemisa","Grecian God","1G - Professor 1 - Helper 1","444444","zeus@ray.com","https://github.com/caidevOficial/Python_IEEE_Team14293.git"
"2022/02/13 10:26:52 p. m. GMT-3","Helios","Romane God","1F - Professor 2 - Helper 2","555555","Helios@notsun.com","https://github.com/caidevOficial/Python_RepositoryCloner"
"2022/02/13 10:26:52 p. m. GMT-3","Odin","Nordic God","1G - Professor 1 - Helper 1","777777","odin@fatherofall.com","https://github.com/caidevOficial/Python_RepositoryCloner.git"
"2022/02/13 10:26:52 p. m. GMT-3","Thor","Nordic God","1F - Professor 2 - Helper 2","888888","thor@thundergod.com","https://github.com/caidevOficial/Python_RepositoryCloner"
"2022/02/13 10:26:52 p. m. GMT-3","Loki","Nordic God","1G - Professor 1 - Helper 1","888888","loki@trapgod.com","https://github.com/caidevOficial/Python_RepositoryCloner"
"2022/02/13 10:26:52 p. m. GMT-3","Valhalla","Nordic Reign","1F - Professor 2 - Helper 2","999999","valhalla@nordicreign.com","https://github.com/caidevOficial/Python_RepositoryCloner"
Binary file added Media/FinalMessage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Modules/API_Info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Github": {
"URL": "https://api.github.com/repos",
"USER": "CaidevOficial",
"REPO": "Python_Udemy_DataManipulation",
"REPO": "Python_RepositoryCloner",
"BRANCH": "main"
},
"DataFrame": {
Expand Down
7 changes: 4 additions & 3 deletions Modules/DataFrameHandler_Mod/DFHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,11 @@ def ConfigurateDataFrame(self, columnValue: str) -> None:
columnValue (str): [The column value to configurate]. \n
"""

#* Gets the unique values of the column 'columnValue' [Division]
# *# Gets the unique values of the column 'columnValue' [Division]
self.ConfigUniqueValuesInColumn(columnValue)
#* For each unique value of the column 'columnValue' [Division]
#* Creates a list of dataframes with the students that have the specified value in the column 'columnValue' [Division]
# *# For each unique value of the column 'columnValue' [Division]
# *# Creates a list of dataframes with the students that have the
# *# specified value in the column 'columnValue' [Division]
for unique in self.UniqueColumns:
self.CreateListDFStudentsBy(
self.MainDataFrame, columnValue, unique)
Expand Down
8 changes: 4 additions & 4 deletions Modules/DataFrameHandler_Mod/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# GNU General Public License V3
#
#
# Copyright (c) 2022 [FacuFalcone]
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
Loading