Skip to main content

grep's the env

Project description

grepenv

greps your env 🔎

PyPI version Coverage Status Pipeline

About

A simple tool to search through your environment.
Provides additional options for highlighting, searching specifically keys or values, and extracting values from best match keys.

Installation

grepenv can be installed using pip, but pipx is recommended:

pipx install grepenv

This installs the grepenv shell script:

grepenv --help

Usage

grepenv takes a regex pattern, and matches it against currently available environment variables.
Calling grepenv --example will show some example usage.

$ grepenv xdg # Will find any key or value that contains the letters xdg (lower or upper case).
$ grepenv "_api_(key|token)_" -k # finds any environment that looks like an api key. Searches only keys.
GITHUB_API_TOKEN=abc_NlNhalNDL78NAhdKhNAk78bdf7f
OPENAI_API_KEY=123_abcdefghijklmno
$ grepenv -fk git # find-key 'git'- finds all keys matching the pattern 'git' and gets their values.
123_abcdefghijklmnop

Development

This repo uses poetry as a build system, and invoke for task running.

inv can then be used to run as follows:

$ inv lint
$ inv test
$ inv build
$ inv --list # Shows available commands

You can achieve similar results with a one liner bash alias, but after having rewritten that alias on every machine I've used, I decided to turn it into a package for maintainability.

Another language might have been more fun to use, but since pip is by FAR the most available package manager (compared to say cargo), here we are.

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

grepenv-1.0.4.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

grepenv-1.0.4-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file grepenv-1.0.4.tar.gz.

File metadata

  • Download URL: grepenv-1.0.4.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1018-azure

File hashes

Hashes for grepenv-1.0.4.tar.gz
Algorithm Hash digest
SHA256 d10aa5b5b581bc97d1170df48ed90c2f4575889334848b6ba8d3ee5c46c7bdff
MD5 c90b77bd4ef8f4ed8eedff241b49e309
BLAKE2b-256 698daf459975419e6cfdcf05b8e4970baec394ec7e33ecb1d75e737505009075

See more details on using hashes here.

File details

Details for the file grepenv-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: grepenv-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1018-azure

File hashes

Hashes for grepenv-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e5ee3927c9f1938f2690763982d3d3e29acd9afc71531966c2d9df8da9247359
MD5 9f0a0f992496ae9c68f27091581ec5a3
BLAKE2b-256 be72aa67fc78faf9855d4f1643232b5f9c62cb53a7d928b03624ec469d07a282

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