Skip to main content

A command line tool to generate a .gitignore file

Project description

ignr.py

ignr.py (or simply ignr) is a Python-based command line utility to fetch .gitignore templates from gitignore.io. gitignore.io has official command line tools, but they rely on bash or zsh, and may not be compatible with all systems out there.

The .gitignore file in this repository was generated using ignr, if you want to look at a sample!

There's also a Go-based alternative, gogi, but not everyone uses Go.

ignr was created for Python users who prefer to install via PyPI and/or pip.

Note: Version 2.0 completely drops Python 2 support in favor of Python 3, released late-2019.

Usage

Install using

pip install ignr

List

ignr -l

Lists all available .gitignore templates on gitignore.io.

Search

ignr -s mac

Searches for supplied query in list of available templates from gitignore.io, similar to using grep.

Preview

ignr -p scala macOS

Prints a preview of the template without generating a .gitignore file. List multiple space-separated languages, frameworks, operating systems to get combined output.

Create

ignr -n node sass windows

Generates a new .gitignore file in the current directory. List multiple space-separated languages, frameworks, operating systems to get combined output.

If a .gitignore already exists in the directory, ignr will give you an option to back it up.

Troubleshooting

Since gitignore.io uses HTTPS, running this utility in certain macOS environments may result in an SSL "handshake failure" error, which is discussed in detail in this requests issue.

Unfortunately, there is no trivial fix.

In my experience, switching from the included Python in El Capitan to a standalone Python installed via brew solved the issue. All my existing packages seemed to remain intact.

Contribute

Feel free to make improvements. PRs are greatly appreciated.

I can be reached @Antrikshy or via reddit.

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

gnor-0.0.2.tar.gz (39.8 kB view details)

Uploaded Source

Built Distribution

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

gnor-0.0.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file gnor-0.0.2.tar.gz.

File metadata

  • Download URL: gnor-0.0.2.tar.gz
  • Upload date:
  • Size: 39.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for gnor-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3904615a14c1898f8fac0587bc54ddc40e103be1479afde99f66108833c3126f
MD5 1d8647d4f77733dd9715a1a2f5e40fe7
BLAKE2b-256 d9dc9120e9d98f8f668672ef0542d7a91f57e9291acc5540043b10e8559deed6

See more details on using hashes here.

File details

Details for the file gnor-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: gnor-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for gnor-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bfeab80643213d607883c242bcfd70a64dc3601f8cf4cc05cdbd495051619ccb
MD5 05c8e99be4ad833f14c173ba94db4f0f
BLAKE2b-256 5bb760b13932f2e4bf491c5fd7b61824c9161998e41094a41cd175b8ecf3f2f7

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