Skip to main content

No project description provided

Project description

Snappyr - Setup Projects Blazingly Fast.

Introduction

I'm someone who works a lot on different projects, especially in python. Having to manually set up things that takes me sometime to do, takes away the fun from it. Tools like poetry or uv are preferred for project management, but in my case, I require just the project setup, I can manage other things.

That's why I created Snappyr. It is a basic tool that just does it for me. With this tool in my arsenal, I focus my energy on creating projects, not worrying about other things. Snappyr is hardly 100 LOC, in pure python without any external dependencies, but it helps me a ton.

Features

Snappyr does a lot of redundant tasks, especially the ones we do in the start of a new python project. These include:

  1. Create the directory structure. Snappyr sets up the project directory. Snappyr can be made to adjust as per your need. Just fork the project, and create your own version. The format that works for me is:
project_name
|__ src/
|__ tests/
|__ scripts/
|__ docs/
|__ venv
|__ .env
|__ .gitignore
|__ main.py
|__ README.md
|__ requirements.txt
  1. Setting up virtual environment. Snappyr uses python virtual environment behind the scenes and creates a venv so that we don't run into dependency conflicts.

  2. Setup Git Repository for the project. By default, git is initialized in the project working directory. This can also be connected to a remote repository, or can be later configured using Git CLI.

  3. Package Mode. If I'm working on developing a library(which is often the case), I can specify in the Snappyr CLI and it'll configure the setuptools and other necessary requirements to be used for your project.

  4. Pre-commit hooks. Snappyr also add a boilerplate pre-commit hooks for the project.

Usage

Using snappyr is pretty easy. First, download the package through PyPI:

pip install snappyr

Snappyr is available through CLI, which can be run using poetry. After installing, use the commands to run:

poetry run snappyr --project_name="severance" --is_package=False

The options available in the CLI are --project_name: This is your project name. You can set this whatever you want. --is_package: If the project you are working on is a package, Snappyr will add additional things too.

Get it to work.

I feel the right way to use Snappyr is not through package, but setting this up in your machine so you can call it from anywhere. You just need to copy the main.py (renamed to snappyr), and follow the instructions as per your machine.

Windows

  1. Save the Script: Save the code as snappyr.py in a directory, e.g., C:\my_scripts.

  2. Add the script to PATH:

  • Open the Start Menu and search for "Environment Variables.
  • Click Edit the system environment variables > Environment Variables.
  • In the System Variables section, find the Path variable, select it, and click Edit.
  • Add the path to your directory (e.g., C:\my_scripts) and click OK.
  • Make It Callable: In C:\my_scripts, create a batch file (e.g., snappyr.bat) with the following content:
@echo off
python %~dp0snappyr.py %*
  1. This makes the script callable from anywhere in the command prompt as:
snappyr <project_name>

Linux/Mac

  1. Save the main.py as snappyr.py(or any other name you want)

  2. Make the file Executable, run the following command:

chmod +x snappyr.py
  1. Move it to a directory in your PATH (e.g., /usr/local/bin) so you can call it from anywhere:
mv snappyr.py /usr/local/bin/snappyr
  1. From your terminal, run:
snapper <project_name>

After setting this up, you can set up your projects as(from anywhere!!):

snappyr my_python_project

Contributing

This is a very small project, so it'll be very easy to add features. Get in touch with me if you have any ideas, and we can work on PRs.

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

snappyr-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

snappyr-0.1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file snappyr-0.1.0.tar.gz.

File metadata

  • Download URL: snappyr-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.4 Windows/10

File hashes

Hashes for snappyr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8bf57c09f95493e900aef0fc9271abd81d33f6890f8fb94aae584a3bfa7e2709
MD5 798be81c7e3cbee922651da58b014bb3
BLAKE2b-256 cbdcb94a9bd1ec92920fc316ea62b055b0fdb242b806fbe141802efbe7c86596

See more details on using hashes here.

File details

Details for the file snappyr-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: snappyr-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.4 Windows/10

File hashes

Hashes for snappyr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 efbcd891d2d83b22b292b68541df3adc4dc7a3d073bee8f428c450ca978b7b8f
MD5 028de8a1b08f35fcf0ddb8b90bc0b43e
BLAKE2b-256 ca9f4978659a1686cfdcf112d5641ec6976ef83d8f092b29fd9f1aa349dabe7d

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