sopsy-1.2.1
توضیحات
SOPS Python wrapper library
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | sopsy-1.2.1 |
| نام | sopsy |
| نسخه کتابخانه | 1.2.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | Nicolas Karolak <nicolas@karolak.fr> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/sopsy/ |
| مجوز | MIT |
# SOPSy
[](https://www.python.org/downloads/)
[](https://pypi.org/project/sopsy/)
[](https://pypi.org/project/sopsy/#files)
[](https://github.com/nikaro/sopsy/actions/workflows/ci.yml)
[](https://codecov.io/github/nikaro/sopsy)
[](https://techforpalestine.org/learn-more)
SOPSy is a simple Python wrapper arround [SOPS](https://github.com/getsops/sops).
## Installation
SOPS binary must be installed and available in your `$PATH`:
```sh
# use your package manager to install it
brew install sops
```
Install the SOPSy library:
```sh
pip install sopsy
# or with whatever your package/project manager is
uv add sopsy
```
## Quickstart
Retrieve a secret value:
```python
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:
```python
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](http://sopsy.nikaro.net/reference/).
نیازمندی
| مقدار | نام |
|---|---|
| - | pyyaml>=6.0.1 |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl sopsy-1.2.1:
pip install sopsy-1.2.1.whl
نصب پکیج tar.gz sopsy-1.2.1:
pip install sopsy-1.2.1.tar.gz