Package: leet2git
leet2gitThis repository tries to automate the steps needed to integrate your leetcode answers with github.This includes:Importing a question:generates the question file,generates the test file (python3 only),updates the READMESubmiting a question solutionImporting the latest accepted solution for each question with a single commandInstallationTo install the needed libraries, activate a virtual environment (recommended) and run:$pipinstallleet2gitInstall from SourceTo install from source, download this repository, navigate to the folder and run:$pipinstall-e.[dev]UsageCurrently, it is necessary to log into leetcode on either chrome or firefox before running the commands.$leet2git--help
Usage:leet2git[OPTIONS]COMMAND[ARGS]...

Options:--versionShowtheversionandexit.-s,--source-repositoryTEXTThepathtothefolderwherethecodewillbesaved.Overridesthedefaultconfig-l,--languageTEXTThelanguagetorunthecommand.Overridesthedefaultconfig--helpShowthismessageandexit.

Commands:deleteDeleteaquestionanditsfilesgetGeneratesallthefilesforaquestionimport-allGetallsolutionsandgeneratetheirfilesinitCreatesanewconfigurationfileandcangenerateagitrepository.resetResettheconfigurationfilerunRunaquestiononLeetcodeServerssubmitSubmitaquestiontoLeetcodeInit RepositoryNavigate to the source repository and run:$leet2gitinit--help
Usage:leet2gitinit[OPTIONS]Createsanewconfigurationfileandcangenerateagitrepository.

Options:-s,--source-repositoryTEXTthepathtothefolderwherethecodewillbesaved-l,--languageTEXTthedefaultlanguage-c,--create-repogeneratesagitrepositoryRunning this command will open the configuration file in the default editor.Dowloading All SubmissionsTo download the latest accepted submission for each solved problem:$leet2gitimport-allDownloading a Question to SolveTo generate the files of a given question:$leet2gitget--help
Usage:leet2gitget[OPTIONS]QUESTION_IDGeneratesallthefilesforaquestionArgs:question_id(int):thequestionidRunning a QuestionTo run a question on leetcode servers:$leet2gitrun--help
Usage:leet2gitsubmit[OPTIONS]QUESTION_IDRunaquestiononLeetcodeServersArgs:question_id(int):thequestionidSubmitting a QuestionTo submit a question to leetcode:$leet2gitsubmit--help
Usage:leet2gitsubmit[OPTIONS]QUESTION_IDSubmitaquestiontoLeetcodeArgs:question_id(int):thequestionidRemoving a QuestionTo remove a downloaded problem (delete files and remove from readme):$leet2gitdelete--help
Usage:leet2gitdelete[OPTIONS]QUESTION_IDDeleteaquestionanditsfilesArgs:question_id(int):thequestionidReset RepositoryWarning: This will delete the current question database and cannot be undone.Navigate to the source repository and run:$leet2gitreset--help
Usage:leet2gitreset[OPTIONS]Resettheconfigurationfile

Options:-s,--source-repositoryTEXTthepathtothefolderwherethecodewillbesaved-l,--languageTEXTthedefaultlanguage--soft(default)/--hardAsoftresetonlyerasesthedatabase.Ahardresetalsoerasethefiles.Running this command will open the configuration file in the default editor.ConfigurationRunning either the init or the reset command will open the configuration file in the default editor.
The file location will also be printed in the terminal, so you can edit in manually later.Example Configuration{"language":"python3","source_path":"path_to_repository","readme":{"show_difficulty":true,"show_category":true},"source_code":{"add_description":true},"test_code":{"generate_tests":true}}languageThe default language the Download/Submit the questions. Can be overriden when running a command with the -l option.Available Options:"bash""c""cpp""csharp""golang""java""javascript""kotlin""mysql""php""python""python3""ruby""rust""scala""swift"source_pathThe path to the code repositoryreadmeshow_difficulty: If true, will generate an extra section on README with different tables for each difficulty.show_category: If true, will generate an extra section on README with different tables for each category.source_codeadd_description: If True, will add the problem description as comments in the source file.test_codegenerate_tests: If true, will try to generate local test files for the question. Currently only python3 is supported.Language SupportLanguageGenerate/Import QuestionGenerate Local TestsSubmit/Run QuestionAuto Import/Include Librariesbash:heavy_check_mark::x::heavy_check_mark::x:c:heavy_check_mark::x::heavy_check_mark::x:cpp:heavy_check_mark::x::heavy_check_mark::x:csharp:heavy_check_mark::x::heavy_check_mark::x:golang:heavy_check_mark::x::heavy_check_mark::x:java:heavy_check_mark::x::heavy_check_mark::x:javascript:heavy_check_mark::x::heavy_check_mark::x:kotlin:heavy_check_mark::x::heavy_check_mark::x:mysql:heavy_check_mark::x::heavy_check_mark::x:php:heavy_check_mark::x::heavy_check_mark::x:python:heavy_check_mark::x::heavy_check_mark::x:python3:heavy_check_mark::heavy_check_mark::heavy_check_mark::large_orange_diamond:ruby:heavy_check_mark::x::heavy_check_mark::x:rust:heavy_check_mark::x::heavy_check_mark::x:scala:heavy_check_mark::x::heavy_check_mark::x:swift:heavy_check_mark::x::heavy_check_mark::x::heavy_check_mark:: Fully Supported
:large_orange_diamond:: Partially Supported
:x:: Not SupportedAfter stabilizing the code, I am planning to improve the language suport. Contributions are always welcomed ;)Contributors ✨Thanks goes to these wonderful people (emoji key):Yuri Rocha💻sungho-joo💻🐛This project follows theall-contributorsspecification. Contributions of any kind welcome!