Skip to main content

CLI to automate the development workflow.

Project description

logo

License PyPI GitHub Code Style CI Coverage

pytoil is a small, helpful CLI to help developers manage their local and remote projects with ease!

What is it?

pytoil is a handy tool that helps you stay on top of all your projects, remote or local. It's primarily aimed at python developers but you could easily use it to manage any project!

pytoil is:

  • Easy to use โœ…
  • Easy to configure โœ…
  • Safe (it won't edit your repos at all) โœ…
  • Snappy (it's asynchronous from the ground up and as much as possible is done concurrently, clone all your repos in seconds!) ๐Ÿ’จ
  • Useful! (I hope ๐Ÿ˜ƒ)

Say goodbye to janky bash scripts ๐Ÿ‘‹๐Ÿป

Background

Like many developers I suspect, I quickly became bored of typing repeated commands to manage my projects, create virtual environments, install packages, fire off cURL snippets to check if I had a certain repo etc.

So I wrote some shell functions to do some of this for me...

And these shell functions grew and grew and grew.

Until one day I saw that the file I kept these functions in was over 1000 lines of bash (a lot of printf's so it wasn't all logic but still). And 1000 lines of bash is waaaay too much!

And because I'd basically hacked it all together, it was very fragile. If a part of a function failed, it would just carry on and wreak havoc! I'd have to do rm -rf all_my_projects... I mean careful forensic investigation to fix it.

So I decided to make a robust CLI with the proper error handling and testability of python, and here it is! ๐ŸŽ‰

Installation

As pytoil is a CLI program, I'd recommend installing with pipx.

$ pipx install pytoil
---> 100%
Successfully installed pytoil

You can always fall back to pip

$ python3 -m pip install pytoil
---> 100%
Successfully installed pytoil

pytoil will install everything it needs in python to work. However, it's full feature set can only be accessed if you have the following external dependencies:

  • git
  • conda (if you work with conda environments)
  • VSCode (if you want to use pytoil to automatically open your projects for you)
  • poetry (if you want to create poetry environments)
  • flit (if you want to create flit environments)

Quickstart

pytoil is super easy to get started with.

After you install pytoil, the first time you run it you'll get something like this.

$ pytoil <any command>

No pytoil config file detected!
? Interactively configure pytoil? [y/n]

If you say yes, pytoil will walk you through a few questions and fill out your config file with the values you enter. If you'd rather not do this interactively, just say no and it will instead put a default config file in the right place for you to edit later.

Once you've configured it properly, you can do things like...

See your local and remote projects

$ pytoil show local
Local Projects

Showing 3 out of 3 local projects

  Name              Created          Modified
 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  project 1         13 days ago      9 days ago
  project 2         a day ago        a minute ago
  project 3         a month ago      a month ago

See which ones you have on GitHub, but not on your computer

$ pytoil show diff
Diff: Remote - Local

Showing 3 out of 3 projects

  Name             Size       Created                Modified
 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  remote 1         154.6 kB   a month ago            29 days ago
  remote 2         2.1 MB     1 year, 15 days ago    11 months ago
  remote 3         753.7 kB   1 year, 6 months ago   a month ago

Easily grab a project, regardless of where it is

$ pytoil checkout myproject

// Will now either open that project if local
// or clone it, then open it if not

Create a new project and virtual environment in one go

$ pytoil new myproject --venv venv

Creating project: 'myproject' at '/Users/you/projects/myproject'

Creating virtual environment for: 'myproject'

And even do this from a cookiecutter template

$ pytoil new myproject --venv venv --cookie https://github.com/some/cookie.git

Creating project: 'myproject' with cookiecutter template: 'https://github.com/some/cookie.git'

// You'll then be asked all the cookiecutter questions defined in the template
// After which pytoil will take over and create the virtual environment as normal

And loads more!

Help

Like all good CLI programs, pytoil (as well as all it's subcommands, and all their subcommands!) has a --help option to show you what to do.

$ pytoil --help

Usage: pytoil [OPTIONS] COMMAND [ARGS]...

  Helpful CLI to automate the development workflow.

  - Create and manage your local and remote projects

  - Build projects from cookiecutter templates.

  - Easily create/manage virtual environments.

  - Minimal configuration required.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  checkout  Checkout an existing development project.
  config    Interact with pytoil's configuration.
  docs      Open pytoil's documentation in your browser.
  find      Quickly locate a project.
  gh        Open one of your projects on GitHub.
  info      Get useful info for a project.
  new       Create a new development project.
  pull      Pull down your remote projects.
  remove    Remove projects from your local filesystem.
  show      View your local/remote projects.

pytoil's CLI is designed such that if you don't specify any arguments, it won't do anything! just show you the --help. This is called being a 'well behaved' unix command line tool.

This is true for any subcommand of pytoil so you won't accidentally break anything if you don't specify arguments ๐ŸŽ‰

And if you get truly stuck, you can quickly open pytoil's documentation with:

$ pytoil docs

Opening pytoil's documentation in your browser...

# Now you'll be on this page in whatever your default browser is!

Check out the docs for more ๐Ÿ’ฅ

Contributing

pytoil is an open source project and, as such, welcomes contributions of all kinds ๐Ÿ˜ƒ

Your best bet is to check out the contributing guide in the docs!

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

pytoil-0.25.0.tar.gz (42.1 kB view details)

Uploaded Source

Built Distribution

pytoil-0.25.0-py3-none-any.whl (56.9 kB view details)

Uploaded Python 3

File details

Details for the file pytoil-0.25.0.tar.gz.

File metadata

  • Download URL: pytoil-0.25.0.tar.gz
  • Upload date:
  • Size: 42.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pytoil-0.25.0.tar.gz
Algorithm Hash digest
SHA256 3aba3a32b27680210ae232b03dd386d4d4324860ae11305fad06ad8288e0af2e
MD5 27830b471588b1f00ab8046b60991347
BLAKE2b-256 0220a058dcd16eb869944bfe95a80dccf1b9a17bbbd677ce168dab6e53b11913

See more details on using hashes here.

File details

Details for the file pytoil-0.25.0-py3-none-any.whl.

File metadata

  • Download URL: pytoil-0.25.0-py3-none-any.whl
  • Upload date:
  • Size: 56.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for pytoil-0.25.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98033efcab2e0309acf14a69cde5b2c7a88e47ff7e49db4d0a09a17cd578be73
MD5 5f7c75a66856c947108601cb54fd1a59
BLAKE2b-256 1d341ca2ddfcf66a3d11cf6f84f28acb872474093690d6db89684de493632309

See more details on using hashes here.

Supported by

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