Skip to main content

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

  1. Create a new branch
  2. Add features you wish to propose
  3. Stage and commit your changes, ensure pre-commit checks pass
  4. Push your branch
  5. Open a pull request
  6. Ensure Pull Request Verification CI/CD pipeline passes
  7. Get approved & merged
  8. 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

Metadata

Release files for localeet 0.2.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for localeet 0.2.12
File Size Uploaded Provenance Actions
localeet-0.2.12.tar.gz 17.7 kB Without provenance Details for localeet-0.2.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for localeet 0.2.12
File Interpreter ABI Platform Actions
localeet-0.2.12-py2.py3-none-any.whl Python 3, Python 2 none any Details for localeet-0.2.12-py2.py3-none-any.whl

Total release size: 25.7 kB

Release files / localeet-0.2.12.tar.gz

Download URL localeet-0.2.12.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8cfdf87d6ab00027f3d1afe0b9f5bfccc549e8da639b5da8b8bb21d5332481f1
BLAKE2b-256 checksum
How to use checksums
4698e2a558ae0ae51789ef78006a89dc467fa40105198ae59cd50062964511bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / localeet-0.2.12-py2.py3-none-any.whl

Download URL localeet-0.2.12-py2.py3-none-any.whl
Size 8.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
015db887a5da270871c259d969a02210cbead9f286fe9c81b932b57b9df4d2f8
BLAKE2b-256 checksum
How to use checksums
f76049014b989d4480eec4f6fc46178d59240fd09f1b0d1fcbb1cc9645ae8f79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for localeet 0.2.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page