Skip to main content

No project description provided

Project description

PrivatePrefs

Easily Keep API Keys out of GitHub

Pytest - Coverage Package CI PyPI - Version PyPI - Python Version GitHub Hatch project

It's often tempting to hard code sensitive data like API Keys, passwords, email addresses, usernames, etc directly into python scripts, but if it's checked into Version Control and pushed to public repository on GitHub, GitLab or Bitbucket, then your sensitive personal data will be compromised.

If sensitive data does end up in a public Repository it can be a real pain to remove, because you have to delete the sensitive data, purge it from the history, have github purge their cache. After the that you will still need to change your password or API Keys 😱.

This could have been prevented by using PrivatePrefs 😎. It's works by requiring you to enter sensitive information into the command line, then retrieve it using python, hopefully eliminating the temptation to hard code it. See here for more info (LINK TO HOW IT WORKS)


Table of Contents

Installation

Use pip to install

pip install privateprefs

Quick Start

Save string

run from command line
privateprefs save "my key" "abcd4321"

 

Load string

run in python
import privateprefs as prefs
prefs.load("my key")

CLI Demo

use command line interface insert and manage key-value pairs

save first key-value pair

privateprefs save "my key1" "value 1"

 

load key

privateprefs load "my key1"
returns loaded key='my key1' value='value 1'

 

save second key-value pair

privateprefs save "my key2" "value 2"    

list all stored key value pars

privateprefs list    
returns
    stored (key  :  value)
    -------------------------------------------------------------
    my key1   :   value 1
    my key2   :   value 2
    -------------------------------------------------------------

delete a single key-value pair

privateprefs delete "my key2"

delete all key-value pairs

-- WARNING ALL SAVED DATA WILL BE PERMANENTLY DELETED --
privateprefs delete --all

License

privateprefs is distributed under the terms of the MIT license.

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

privateprefs-0.4.2.tar.gz (12.4 kB view hashes)

Uploaded Source

Built Distribution

privateprefs-0.4.2-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

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