A CLI tool to do LeetCode and LeetCode-like exercises locally
Project description
localeet
A CLI tool to select and solve LeetCode and LeetCode-like problems locally
installation
pip install localeet
usage
localeet
This will find a random question from LeetCode's free question set. It will create a code file shell (Python by default) with the question description and other metadata in it in your current working directory. It will then pop open a code editor (VSCode by default) with the new file opened in it.
Examples of output files:
cli args
See the installed version of localeet with:
localeet --version
localeet -v
Using any of these CLI args will use the output path provided, and create any needed directories in that path as well.
localeet --output_path ~/leetcode
localeet --path problems
localeet -o ~/leetcode/problems/2023-7-22
You can set the max or min difficulty of the problem selected using a
string or an int {1: easy, 2: medium, 3: hard}
.
localeet --max_difficulty medium
localeet --max 1
localeet --min_difficulty 3
localeet --min hard
To specify a code editor other than VSCode, pass the CLI arg used to open said editor using one of these args:
localeet -e charm
localeet --editor subl
localeet --code_editor_open_command atom
To specify a language other than Python, use one of the following CLI arg formats:
localeet --programming_language rust
localeet --language go
localeet -l ts
Valid language options:
c++
cpp
java
python
python3
py
c
c#
cs
javascript
js
ruby
rb
swift
go
golang
scala
kotlin
kt
rust
rs
php
typescript
ts
racket
rkt
erlang
erl
elixir
ex
dart
Print the manual:
localeet --help
overriding defaults
If you want to set a different default value permanently, set it in your environment like in these examples:
export LOCALEET_DEFAULT_MAX_DIFFICULTY=medium
export LOCALEET_DEFAULT_MIN_DIFFICULTY=medium
export LOCALEET_DEFAULT_OUTPUT_PATH=./leetcode
export LOCALEET_DEFAULT_CODE_EDITOR_OPEN_COMMAND=vi
export LOCALEET_DEFAULT_LANGUAGE=cpp
contributions
local setup
git clone https://github.com/dannybrown37/localeet.git
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .[dev, test]
pre-commit install
pytest tests -s -vv
contribution process
- Create a new branch
- Add features you wish to propose
- Stage and commit your changes, ensure pre-commit checks pass
- Push your branch
- Open a pull request
- Ensure Pull Request Verification CI/CD pipeline passes
- Get approved & merged
- Ensure Publish to PyPI pipeline passes
feature ideas
- Add commitizen for auto version updating
- Support submitting responses to LeetCode via CLI as well
- Whatever your imagination holds
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for localeet-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 346848175052a3263492f24c0eacded8c00e442b32520eca7314513262e801d8 |
|
MD5 | 0df48b6899a498032fb0c3a9916afbeb |
|
BLAKE2b-256 | 87bb1c6a52e14d94f42c8848cfd3d6cdb2f18d988456597e2674a75838d35d0b |