Skip to main content

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.

Metadata

Release files for snappyr 0.1.1

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

Source distribution (sdist)

Source distribution for snappyr 0.1.1
File Size Uploaded Provenance Actions
snappyr-0.1.1.tar.gz 2.8 kB Without provenance Details for snappyr-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for snappyr 0.1.1
File Interpreter ABI Platform Actions
snappyr-0.1.1-py3-none-any.whl Python 3 none any Details for snappyr-0.1.1-py3-none-any.whl

Total release size: 5.8 kB

Release files / snappyr-0.1.1.tar.gz

Download URL snappyr-0.1.1.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
53b25e03c2e440ca90b571e087dc73450f64255a2d4bc6b650f95ba3e71bb660
BLAKE2b-256 checksum
How to use checksums
9548c37e9da0f98f93dfaaf87840f242ad52eaa021a0700a63eb17d7514bbfdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.4 Windows/10

Release files / snappyr-0.1.1-py3-none-any.whl

Download URL snappyr-0.1.1-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
110ad7d76236f96755412e7486bd5322d5941054e0b41ee952037743c141b2a5
BLAKE2b-256 checksum
How to use checksums
93cfa0a09abf225f882dfa736f50de8bbeb75778ba63a059260d8f0e5c497f11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.11.4 Windows/10

Security for snappyr 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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