SOPSy
SOPSy is a simple Python wrapper arround SOPS.
Installation
SOPS binary must be installed and available in your $PATH:
# use your package manager to install it
brew install sops
Install the SOPSy library:
pip install sopsy
# or with whatever your package/project manager is
uv add sopsy
Quickstart
Retrieve a secret value:
from sopsy import Sops
sops = Sops("secrets.yml")
my_secret_key = sops.get("my_secret_key")
print(f"single secret: {my_secret_key}")
secrets = sops.decrypt()
print(f"all my secrets: {secrets}")
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()
API Reference
Check documentation.
Release files for sopsy 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sopsy-1.2.1.tar.gz | 108.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sopsy-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 116.3 kB
Release files / sopsy-1.2.1.tar.gz
| Download URL | sopsy-1.2.1.tar.gz |
|---|---|
| Size | 108.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2159a82f6fee10b7e29b688e4a0bdc1a50e96e8da2357ff46f97554aff0990f1
|
|
BLAKE2b-256 checksum How to use checksums |
afbd55feeb922c4e83c02a36a81d09beebf4cd1dc8ceac36e0d25a39359a2e32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.3
|
Release files / sopsy-1.2.1-py3-none-any.whl
| Download URL | sopsy-1.2.1-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ff3fae9d53eb52acb5b3c15662db2f9521b8e2fb1a199872c37fb330d84d8c4
|
|
BLAKE2b-256 checksum How to use checksums |
8bd3fbb22b18176ee0aa41af23ccaeee2ce879158042bf2335dfdcbc14bc5ea6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.3
|