sopsy


Namesopsy JSON
Version 1.2.1 PyPI version JSON
download
home_pageNone
SummarySOPS Python wrapper library
upload_time2025-07-26 19:41:10
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords sops
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SOPSy

[![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fgithub.com%2Fnikaro%2Fsopsy%2Fraw%2Fmain%2Fpyproject.toml)](https://www.python.org/downloads/)
[![PyPI - Version](https://img.shields.io/pypi/v/sopsy)](https://pypi.org/project/sopsy/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/sopsy)](https://pypi.org/project/sopsy/#files)
[![build](https://github.com/nikaro/sopsy/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/nikaro/sopsy/actions/workflows/ci.yml)
[![codecov](https://codecov.io/github/nikaro/sopsy/graph/badge.svg?token=DEVPQ8M6C4)](https://codecov.io/github/nikaro/sopsy)
[![Ceasefire Now](https://badge.techforpalestine.org/default)](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/).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sopsy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "sops",
    "author": null,
    "author_email": "Nicolas Karolak <nicolas@karolak.fr>",
    "download_url": "https://files.pythonhosted.org/packages/af/bd/55feeb922c4e83c02a36a81d09beebf4cd1dc8ceac36e0d25a39359a2e32/sopsy-1.2.1.tar.gz",
    "platform": null,
    "description": "# SOPSy\n\n[![Python Version from PEP 621 TOML](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fgithub.com%2Fnikaro%2Fsopsy%2Fraw%2Fmain%2Fpyproject.toml)](https://www.python.org/downloads/)\n[![PyPI - Version](https://img.shields.io/pypi/v/sopsy)](https://pypi.org/project/sopsy/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/sopsy)](https://pypi.org/project/sopsy/#files)\n[![build](https://github.com/nikaro/sopsy/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/nikaro/sopsy/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/github/nikaro/sopsy/graph/badge.svg?token=DEVPQ8M6C4)](https://codecov.io/github/nikaro/sopsy)\n[![Ceasefire Now](https://badge.techforpalestine.org/default)](https://techforpalestine.org/learn-more)\n\nSOPSy is a simple Python wrapper arround [SOPS](https://github.com/getsops/sops).\n\n## Installation\n\nSOPS binary must be installed and available in your `$PATH`:\n\n```sh\n# use your package manager to install it\nbrew install sops\n```\n\nInstall the SOPSy library:\n\n```sh\npip install sopsy\n\n# or with whatever your package/project manager is\nuv add sopsy\n```\n\n## Quickstart\n\nRetrieve a secret value:\n\n```python\nfrom sopsy import Sops\n\nsops = Sops(\"secrets.yml\")\n\nmy_secret_key = sops.get(\"my_secret_key\")\nprint(f\"single secret: {my_secret_key}\")\n\nsecrets = sops.decrypt()\nprint(f\"all my secrets: {secrets}\")\n```\n\nEncrypt a file:\n\n```python\nimport json\nfrom pathlib import Path\nfrom sopsy import Sops\n\nplaintext_content = json.dumps({\"hello\": \"world\"})\nPath(\"secrets.json\").write_text(plaintext_content)\n\ns = Sops(\"secrets.json\", in_place=True)\n# you either need a `.sops.yml` configuration file with `creation_rules` set\n# or append some arguments to the `Sops.global_args` attribute:\n# s.global_args.extend([\n#     \"--age\", \"age1yt3tfqlfrwdwx0z0ynwplcr6qxcxfaqycuprpmy89nr83ltx74tqdpszlw\"\n# ])\ns.encrypt()\n```\n\n## API Reference\n\nCheck [documentation](http://sopsy.nikaro.net/reference/).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "SOPS Python wrapper library",
    "version": "1.2.1",
    "project_urls": {
        "Changelog": "https://sopsy.nikaro.net/changelog/",
        "Homepage": "https://sopsy.nikaro.net",
        "Issues": "https://github.com/nikaro/sopsy/issues",
        "Repository": "https://github.com/nikaro/sopsy"
    },
    "split_keywords": [
        "sops"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8bd3fbb22b18176ee0aa41af23ccaeee2ce879158042bf2335dfdcbc14bc5ea6",
                "md5": "852cb6d9bb0a7d8c8e8f8b0ea300ec6a",
                "sha256": "3ff3fae9d53eb52acb5b3c15662db2f9521b8e2fb1a199872c37fb330d84d8c4"
            },
            "downloads": -1,
            "filename": "sopsy-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "852cb6d9bb0a7d8c8e8f8b0ea300ec6a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7486,
            "upload_time": "2025-07-26T19:41:09",
            "upload_time_iso_8601": "2025-07-26T19:41:09.488009Z",
            "url": "https://files.pythonhosted.org/packages/8b/d3/fbb22b18176ee0aa41af23ccaeee2ce879158042bf2335dfdcbc14bc5ea6/sopsy-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "afbd55feeb922c4e83c02a36a81d09beebf4cd1dc8ceac36e0d25a39359a2e32",
                "md5": "52dcb3fcab191487d8bb9e5cababc91c",
                "sha256": "2159a82f6fee10b7e29b688e4a0bdc1a50e96e8da2357ff46f97554aff0990f1"
            },
            "downloads": -1,
            "filename": "sopsy-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "52dcb3fcab191487d8bb9e5cababc91c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 108860,
            "upload_time": "2025-07-26T19:41:10",
            "upload_time_iso_8601": "2025-07-26T19:41:10.626613Z",
            "url": "https://files.pythonhosted.org/packages/af/bd/55feeb922c4e83c02a36a81d09beebf4cd1dc8ceac36e0d25a39359a2e32/sopsy-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-26 19:41:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nikaro",
    "github_project": "sopsy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sopsy"
}
        
Elapsed time: 1.23781s