Skip to main content

owned

A little tool to manage secrets.

The package uses the 'owner' library to embed information into byte content (weaving) and store it locally, as well as post the resulting hash to a blockchain for ownership verification. Includes helper functions to verify the posting of hashes on the blockchain.

To install: pip install owned

Main Functionalities

  1. store_content(content, ...) -> str

    • Optionally weaves metadata into the content (using 'owner') before storage.
    • Saves the content in the ~/.config/owned folder under a file name derived from its hash.
    • Returns the computed hash string (the 'key').
  2. post_hash_to_blockchain(hash_str, provider_uri='http://127.0.0.1:8545', ...)

    • Posts the hash to a chosen blockchain via web3.py.
    • Returns transaction or logging information.
  3. verify_hash_on_blockchain(hash_str, provider_uri='http://127.0.0.1:8545', ...)

    • Verifies that a particular hash has been posted on the blockchain.
    • Returns information such as block number, transaction details, or a boolean indicating presence.

Helper Functions

  • DFLT_HASH: Default hashing function (sha256).
  • weave_content(content, extra_info=None): Uses 'owner.HeadWeaver' to weave extra bytes into the content.
  • unweave_content(woven_bytes): Recovers content and metadata from woven bytes.
  • Additional internal functions for file handling and directory creation.

Examples

>>> from owned import store_content, unweave_content
>>> import os

Store some content (with weaving) and get its hash key.

>>> test_content = b"Hello, doctest!"
>>> key = store_content(test_content, extra_info=b"Extra info", use_weave=True)

Verify the file exists in ~/.config/owned

>>> file_path = os.path.expanduser(f"~/.config/owned/{key}")
>>> assert os.path.isfile(file_path)

Check the length of the SHA256 hash (64 hex chars).

>>> len(key)
64

Read the stored file and unweave the content.

>>> with open(file_path, "rb") as f:
...     woven_data = f.read()
>>> original_content = unweave_content(woven_data)
>>> original_content == test_content
True

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

owned-0.0.6.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

owned-0.0.6-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file owned-0.0.6.tar.gz.

File metadata

  • Download URL: owned-0.0.6.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for owned-0.0.6.tar.gz
Algorithm Hash digest
SHA256 d2f2da77b6fc9197e3b5ffac3fd0fc2d2b60be55be3462214c41d25c6647d684
MD5 1416f5750956818728ee6f435abf0141
BLAKE2b-256 e5219bbc40a2fe346aa0a2b5cb2936df47187f5c3c4233155c97dfbf476ca89f

See more details on using hashes here.

File details

Details for the file owned-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: owned-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for owned-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 297a7da127541577ab14e37de6af0d7348822af96cbe95d2932206e4a1363528
MD5 40e243c87b26780f881b14a7d02c967a
BLAKE2b-256 935ae99b7106bcd03f26319a826ea2f5e13a1c8d05c9c73ec1a1529fb76770c8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 files

0.0.5

1 file

0.0.4

1 file

0.0.3

2 files

0.0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page