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
94 changes: 60 additions & 34 deletions GithubCloner2022.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,74 @@
# 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()
9 changes: 7 additions & 2 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"
"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
Loading