Skip to main content

Your new CLI tool helping you learn and fix errors in Python fast!

Project description

tldr: Your new CLI tool for Python

PyPI version Python Version License Build Status


What is tldr?

tldr is a lightweight command-line tool that helps you quickly understand Python error messages and suggests actionable fixes so you can debug faster and code smarter. It is built to accommodate all experience levels, helping beginners gain a clearer understanding of Python errors while enabling more advanced users to save time during the debugging process. It natively handles errors and provides solutions (and edits files if needed) for most basic cases, though it has AI support if needed. All local, no API keys needed!


Features

  • Looks through your Python tracebacks and explains errors in plain English
  • Experimental --autofix option attempts to automatically fix errors
  • Simple CLI interface: run tldr <filename>.py to get instant feedback
  • Tons of internal flags for ease of use
  • Native error handling, but has AI-powered fallback
  • Minimal dependencies for easy installation and usage

Initial Installation

Install tldr directly in your terminal:

pip install tldrcli

That's it! tldr is ready to use!

Using tldr

Using tldr is as simple as running your Python file, but without typing python first. Instead of:

python <filename>.py

You just type:

tldr <filename>.py

If your script runs without errors, tldr will quietly exit (no unnecessary noise). However, if something does go wrong, tldr will instantly catch the error, explain it in plain English, and even suggest possible fixes right away. The table below shows some of the things tldr can do:

tldr <filename>.py               # Run code and explain error
tldr --help | -h                 # Show quick docs 
tldr --version | -v              # Show current version
tldr --reset | -r                # Reset and clear all data 
tldr <filename>.py --autofix     # Experimental auto-fix mode (use with caution)
tldr --ol | -o                   # Setup instructions for complex --autofix
tldr --oc | -c                   # Verify setup
tldr --stats | -s                # View usage statistics and error history

After installing tldr, you can run tldr --help to see the full extent of what it can do. Like this, tldr is already a great tool for Python beginners to learn and understand. However, there are always some errors that it cannot predict. To ensure that tldr can help you regardless of the situation, set up the local AI model by following the steps in tldr --ol . Once that is done, running tldr --oc will verify if the setup was done correctly. Below are the same steps you will find in your terminal if you choose to install it later:

  • In your terminal, run pip install ollama
  • Visit https://ollama.com/ and download the installer
  • Run the installer and follow the setup instructions
  • Once installed, open a terminal and run ollama run llama3:8b

Contributing

Contributions, issues, and feature requests are welcome! Feel free to open issues to report bugs, request features, submit pull requests to improve the codebase, or more!

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

Devanshu Pandya, pandyadevh@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tldrcli-0.2.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tldrcli-0.2-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file tldrcli-0.2.tar.gz.

File metadata

  • Download URL: tldrcli-0.2.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for tldrcli-0.2.tar.gz
Algorithm Hash digest
SHA256 04606ef9bd13036ef181f5b90bf1cf2b09c6cf9ebd57563e1a14c063d70ca641
MD5 052c53b9f800dd2f1630b3a264253821
BLAKE2b-256 0c39b589464062768f17d3932c2ad2e4bbb551ff812aebf8351a7360c1e7c201

See more details on using hashes here.

File details

Details for the file tldrcli-0.2-py3-none-any.whl.

File metadata

  • Download URL: tldrcli-0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for tldrcli-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1dcf26d0dee8c75c391e37d5ca21d759dd107a452f46708181d29c9d8e2e9ed1
MD5 bd412ca10eb344dd473892e67c7df3ef
BLAKE2b-256 7db7a98587cd7a24a371cc4b30cf336358414034a42866c70d81d9cb62eae788

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page