{"id":17887981,"url":"https://github.com/yurirocha15/leetcode2github","last_synced_at":"2025-03-22T19:33:39.972Z","repository":{"id":48324205,"uuid":"363884442","full_name":"yurirocha15/leetcode2github","owner":"yurirocha15","description":"Integrates your leetcode answers with github","archived":false,"fork":false,"pushed_at":"2023-08-11T19:58:37.000Z","size":41814,"stargazers_count":8,"open_issues_count":5,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-23T19:46:49.682Z","etag":null,"topics":["github","leetcode"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yurirocha15.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-03T09:51:46.000Z","updated_at":"2022-11-01T06:45:35.000Z","dependencies_parsed_at":"2022-08-20T09:50:13.864Z","dependency_job_id":null,"html_url":"https://github.com/yurirocha15/leetcode2github","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yurirocha15%2Fleetcode2github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yurirocha15%2Fleetcode2github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yurirocha15%2Fleetcode2github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yurirocha15%2Fleetcode2github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yurirocha15","download_url":"https://codeload.github.com/yurirocha15/leetcode2github/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221832715,"owners_count":16888309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","leetcode"],"created_at":"2024-10-28T13:36:16.021Z","updated_at":"2024-10-28T13:36:16.489Z","avatar_url":"https://github.com/yurirocha15.png","language":"Python","readme":"# leet2git\n[![Build Status](https://github.com/yurirocha15/leetcode2github/workflows/Build/badge.svg)](https://github.com/yurirocha15/leetcode2github/workflows/Build/badge.svg)\n[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/imports-isort-white)](https://pycqa.github.io/isort/)\n[![Linting: flake8 \u0026 mypy \u0026 pylint](https://img.shields.io/badge/linting-flake8%20%26%20mypy%20%26%20pylint-green)](https://pypi.org/project/pytest-pylint/)\n[![Stable Version](https://img.shields.io/github/v/tag/yurirocha15/leetcode2github)](https://img.shields.io/github/v/tag/yurirocha15/leetcode2github)\n[![Latest Release](https://img.shields.io/github/v/release/yurirocha15/leetcode2github?color=%233D9970)](https://img.shields.io/github/v/release/yurirocha15/leetcode2github?color=%233D9970)\n[![Pypi Version](https://img.shields.io/pypi/v/leet2git)](https://pypi.org/project/leet2git/)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\nThis repository tries to automate the steps needed to integrate your leetcode answers with github.\n\nThis includes:\n - Importing a question:\n   - generates the question file,\n   - generates the test file (python3 only),\n   - updates the README\n - Submiting a question solution\n - Importing the latest accepted solution for each question with a single command\n\n## Installation\n\nTo install the needed libraries, activate a virtual environment (recommended) and run:\n\n```shell\n$ pip install leet2git\n```\n\n### Install from Source\n\nTo install from source, download this repository, navigate to the folder and run:\n\n```shell\n$ pip install -e .[dev]\n```\n\n## Usage\n\nCurrently, it is necessary to log into leetcode on either chrome or firefox before running the commands.\n\n```shell\n$ leet2git --help\nUsage: leet2git [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --version                     Show the version and exit.\n  -s, --source-repository TEXT  The path to the folder where the code will be saved.\n                                Overrides the default config\n  -l, --language TEXT           The language to run the command.\n                                Overrides the default config\n  --help                        Show this message and exit.\n\nCommands:\n  delete      Delete a question and its files\n  get         Generates all the files for a question\n  import-all  Get all solutions and generate their files\n  init        Creates a new configuration file and can generate a git repository.\n  reset       Reset the configuration file\n  run         Run a question on Leetcode Servers\n  submit      Submit a question to Leetcode\n```\n\n### Init Repository\n\nNavigate to the source repository and run:\n\n```shell\n$ leet2git init --help\nUsage: leet2git init [OPTIONS]\n\n  Creates a new configuration file and can generate a git repository.\n\nOptions:\n  -s, --source-repository TEXT  the path to the folder where the code will be saved\n  -l, --language TEXT           the default language\n  -c, --create-repo             generates a git repository\n```\n\nRunning this command will open the configuration file in the default editor.\n\n### Dowloading All Submissions\n\nTo download the latest accepted submission for each solved problem:\n\n```shell\n$ leet2git import-all\n```\n\n### Downloading a Question to Solve\n\nTo generate the files of a given question:\n\n```shell\n$ leet2git get --help\nUsage: leet2git get [OPTIONS] QUESTION_ID\n\n  Generates all the files for a question\n\n  Args:     question_id (int): the question id\n```\n\n### Running a Question\n\nTo run a question on leetcode servers:\n\n```shell\n$ leet2git run --help\nUsage: leet2git submit [OPTIONS] QUESTION_ID\n\n  Run a question on Leetcode Servers\n\n  Args:     question_id (int): the question id\n```\n\n### Submitting a Question\n\nTo submit a question to leetcode:\n\n```shell\n$ leet2git submit --help\nUsage: leet2git submit [OPTIONS] QUESTION_ID\n\n  Submit a question to Leetcode\n\n  Args:     question_id (int): the question id\n```\n\n### Removing a Question\n\nTo remove a downloaded problem (delete files and remove from readme):\n\n```shell\n$ leet2git delete --help\nUsage: leet2git delete [OPTIONS] QUESTION_ID\n\n  Delete a question and its files\n\n  Args:     question_id (int): the question id\n```\n\n### Reset Repository\n\n**Warning: This will delete the current question database and cannot be undone.** Navigate to the source repository and run:\n\n```shell\n$ leet2git reset --help\nUsage: leet2git reset [OPTIONS]\n\n  Reset the configuration file\n\nOptions:\n  -s, --source-repository TEXT  the path to the folder where the code will be saved\n  -l, --language TEXT           the default language\n  --soft (default) / --hard     A soft reset only erases the database.\n                                A hard reset also erase the files.\n```\n\nRunning this command will open the configuration file in the default editor.\n\n## Configuration\n\nRunning either the init or the reset command will open the configuration file in the default editor.\nThe file location will also be printed in the terminal, so you can edit in manually later.\n\n### Example Configuration\n\n```json\n{\n    \"language\": \"python3\",\n    \"source_path\": \"path_to_repository\",\n    \"readme\": {\n        \"show_difficulty\": true,\n        \"show_category\": true\n    },\n    \"source_code\": {\n        \"add_description\": true\n    },\n    \"test_code\": {\n        \"generate_tests\": true\n    }\n}\n```\n\n### language\n\nThe default language the Download/Submit the questions. Can be overriden when running a command with the -l option.\n\nAvailable Options:\n- \"bash\"\n- \"c\"\n- \"cpp\"\n- \"csharp\"\n- \"golang\"\n- \"java\"\n- \"javascript\"\n- \"kotlin\"\n- \"mysql\"\n- \"php\"\n- \"python\"\n- \"python3\"\n- \"ruby\"\n- \"rust\"\n- \"scala\"\n- \"swift\"\n\n### source_path\n\nThe path to the code repository\n\n### readme\n\n- show_difficulty: If true, will generate an extra section on README with different tables for each difficulty.\n- show_category: If true, will generate an extra section on README with different tables for each category.\n\n### source_code\n\n- add_description: If True, will add the problem description as comments in the source file.\n\n### test_code\n\n- generate_tests: If true, will try to generate local test files for the question. Currently only python3 is supported.\n\n\n## Language Support\n\n| Language | Generate/Import Question | Generate Local Tests | Submit/Run Question | Auto Import/Include Libraries |\n|:--------:|--------------------------|----------------------|-----------------|-------------------------------|\n| bash | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| c | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| cpp | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| csharp | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| golang | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| java | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| javascript | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| kotlin | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| mysql | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| php | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| python | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| python3 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :large_orange_diamond: |\n| ruby | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| rust | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| scala | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n| swift | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: |\n\n:heavy_check_mark:: Fully Supported\n:large_orange_diamond:: Partially Supported\n:x:: Not Supported\n\nAfter stabilizing the code, I am planning to improve the language suport. Contributions are always welcomed ;)\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.yurirocha.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/4281771?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eYuri Rocha\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/yurirocha15/leetcode2github/commits?author=yurirocha15\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/sungho-joo\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/53804787?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003esungho-joo\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/yurirocha15/leetcode2github/commits?author=sungho-joo\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/yurirocha15/leetcode2github/issues?q=author%3Asungho-joo\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyurirocha15%2Fleetcode2github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyurirocha15%2Fleetcode2github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyurirocha15%2Fleetcode2github/lists"}