SOPS Python wrapper library
Project description
SOPSy
SOPSy is a simple Python wrapper arround SOPS.
Installation
pip install sopsy
Usage
Retrieve a secret value
from sopsy import Sops
secrets = Sops("secrets.yml").decrypt()
my_secret_key = secrets.get("my_secret_key")
print(my_secret_key)
Encrypt a file
import json
from pathlib import Path
from sopsy import Sops
plaintext_content = json.dumps({"hello": "world"})
Path("secrets.json").write_text(plaintext_content)
s = Sops("secrets.json", in_place=True)
# you either need a `.sops.yml` configuration file with `creation_rules` set
# or append some arguments to the `Sops.global_args` attribute:
# s.global_args.extend([
# "--age", "age1yt3tfqlfrwdwx0z0ynwplcr6qxcxfaqycuprpmy89nr83ltx74tqdpszlw"
# ])
s.encrypt()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sopsy-0.1.3.tar.gz
(30.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
sopsy-0.1.3-py3-none-any.whl
(28.0 kB
view details)
File details
Details for the file sopsy-0.1.3.tar.gz.
File metadata
- Download URL: sopsy-0.1.3.tar.gz
- Upload date:
- Size: 30.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1101135a9c8bf13220b8425493dd2ffed097fca83a46c0d79900c75929ed282
|
|
| MD5 |
8b59c8692f2b14ca8874a84522456d0e
|
|
| BLAKE2b-256 |
9e2c3908e82382ae579cdc0bb31ad2c5aedd9a10e5f82c07ece77bdb28c5e1ef
|
File details
Details for the file sopsy-0.1.3-py3-none-any.whl.
File metadata
- Download URL: sopsy-0.1.3-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccc492c898a92e1453beeef40a401888378cb1aa8a39606347facba753d5bea7
|
|
| MD5 |
2691bec5f0a4700ac312d393f8dd804d
|
|
| BLAKE2b-256 |
8ef97a9c3f2b6d35b48f482e056ff835dbbc78c0625a62f0f8ad97de292ea125
|