DEV Community

Cover image for Pyre: Making Python development experience, just a little better
Dhravya
Dhravya

Posted on • Originally published at blog.dhravya.dev

Pyre: Making Python development experience, just a little better

pyre

Pyre

Create, open, manage your Python projects with ease.


This project was made as a joke, but somehow it's really useful, so I'm publishing it


πŸ‘€ Why Pyre?

  • I currently have 48 projects in Python projects directory, and had to navigate and find them. With Pyre, I just have to run one command to easily open the project, right in the editor I want. pyre open <project_name> does it for me.
  • I'm a procrastinator, and initialising Virtual environment, creating gitignore, etc. was a pain, so I basically used my old project - create-python-project and modified it to work with pyre. pyre new project_name does it all, really quickly.
  • Whenever I installed dependencies, I forgot to add them in the requirements.txt file, so pyre i <dependencies> automatically updates the requirements file, very convenient for me
  • It's just a tool to make Python development experience better, like Cargo does, for Rust.

If you found it useful and installed it, make sure to ⭐ this repository!

⬇️ Installation

Just run this command, make sure you have cargo installed

cargo install pyre
Enter fullscreen mode Exit fullscreen mode

Or, go to releases, download the latest version in the bin directory and done!

Now, run this to get started

pyre help
Enter fullscreen mode Exit fullscreen mode

πŸ“· Screenshots, and demonstrations

Help Command

pyre help

New Project command

Pyre new discord_bot)

You can configure your open editor to whatever you want. For my case, I have set it to code-insiders.cmd. To config editor, use pyre config-editor <open_command>

As it says, all new project names and their paths are saved to the system default for LocalData, I've used the dirs crate to get location, and create a pyre.json in the directory.

You can also add projects manually. So the project manager part is irrespective of programming language, I've added the Pyre directory, to quickly open this project. It will search for the project (add project using pyre add <name> [path (defaults to the current path)])

pyre open project_name

To list all projects and interactively open them,

pyre list

Installing dependencies (and automatically adding to requirements.txt)

pyre install

πŸ“ƒ TODO

  • Add (or Fix) the run command (the only way I could figure out was using std::process::Command, but then how will I take input etc? Asked for help, recommended to use Python interpreter...)
  • The stuff inside manager.rs is kinda badly implemented
  • Pip install isn't interactive i mean, it just prints the output after installation is done
  • The config commands should be better, maybe under the config subcommand where ppl can pass args to do stuff (like get the data file location, change default editor command, etc.)
  • Using my own Readme Generator and Nexxel's License generator to generate README.md and LICENSE easily

Support

Top comments (0)