sojourner


Namesojourner JSON
Version 0.0.6 PyPI version JSON
download
home_pagehttps://github.com/withmartian/sojourner
Summarya minimal tool for managing client data stored in GCP
upload_time2024-08-20 22:08:44
maintainerNone
docs_urlNone
authorshy
requires_python>=3.7
licenseApache Software License 2.0
keywords nbdev jupyter notebook python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # sojourner


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Install

``` sh
pip install sojourner
```

It is likely that running this project will require a `.env` with a
bucket name as well as application credentials.

## Usage

``` python
import json
from sojourner import Sojourner

client = Sojourner()

data = json.dumps({"key": "value"}).encode()
success = client.store("client1", "sample.json", data, manifest="This is a sample JSON blob", version="1.0")
print(f"Store blob success: {success}")

# will fail after first run because overwriting is not allowed
retrieved_data, retrieved_metadata = client.get("client1", "sample.json")
print(f"Retrieved data: {json.loads(retrieved_data.decode())}")
print(f"Retrieved metadata: {retrieved_metadata}")

blob_list = client.list("client1")
print(f"Blob list: {blob_list}")
```

    Store blob success: True
    Retrieved data: {'key': 'value'}
    Retrieved metadata: Metadata(manifest: This is a sample JSON blob, timestamp: 2024-08-15 16:20:46, content_hash: 9724c1e2..., additional_info: {"version": "1.0"})
    Blob list: ['sample.csv', 'sample.json']

Alternatively, the package can be used through its CLI, `sj`:

``` bash
# Store a file
sj store sk telco_topics_annotated.json ./local_file.json --manifest "Data containing all summaries, topics, with ground truth scores from SK labelers."

# Retrieve a file
sj get sk telco_topics_annotated.json ./local_file.json

# List files
sj list sk
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/withmartian/sojourner",
    "name": "sojourner",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "nbdev jupyter notebook python",
    "author": "shy",
    "author_email": "sasha@withmartian.com",
    "download_url": "https://files.pythonhosted.org/packages/c6/8c/08e230b1cfad124e507d477b9eb1e06efdd25d60c555d87af8568bf3392e/sojourner-0.0.6.tar.gz",
    "platform": null,
    "description": "# sojourner\n\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n## Install\n\n``` sh\npip install sojourner\n```\n\nIt is likely that running this project will require a `.env` with a\nbucket name as well as application credentials.\n\n## Usage\n\n``` python\nimport json\nfrom sojourner import Sojourner\n\nclient = Sojourner()\n\ndata = json.dumps({\"key\": \"value\"}).encode()\nsuccess = client.store(\"client1\", \"sample.json\", data, manifest=\"This is a sample JSON blob\", version=\"1.0\")\nprint(f\"Store blob success: {success}\")\n\n# will fail after first run because overwriting is not allowed\nretrieved_data, retrieved_metadata = client.get(\"client1\", \"sample.json\")\nprint(f\"Retrieved data: {json.loads(retrieved_data.decode())}\")\nprint(f\"Retrieved metadata: {retrieved_metadata}\")\n\nblob_list = client.list(\"client1\")\nprint(f\"Blob list: {blob_list}\")\n```\n\n    Store blob success: True\n    Retrieved data: {'key': 'value'}\n    Retrieved metadata: Metadata(manifest: This is a sample JSON blob, timestamp: 2024-08-15 16:20:46, content_hash: 9724c1e2..., additional_info: {\"version\": \"1.0\"})\n    Blob list: ['sample.csv', 'sample.json']\n\nAlternatively, the package can be used through its CLI, `sj`:\n\n``` bash\n# Store a file\nsj store sk telco_topics_annotated.json ./local_file.json --manifest \"Data containing all summaries, topics, with ground truth scores from SK labelers.\"\n\n# Retrieve a file\nsj get sk telco_topics_annotated.json ./local_file.json\n\n# List files\nsj list sk\n```\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "a minimal tool for managing client data stored in GCP",
    "version": "0.0.6",
    "project_urls": {
        "Homepage": "https://github.com/withmartian/sojourner"
    },
    "split_keywords": [
        "nbdev",
        "jupyter",
        "notebook",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "326d6b0f0d1141a63cfd287123aeb00d0f84748b3599001faa5635bf527862b5",
                "md5": "47239e71e03e9535a5ffac3243d3cdcc",
                "sha256": "3830bcf754687a813f509ef6c023ef0d35c045cea3e2b58d53583279633b71b5"
            },
            "downloads": -1,
            "filename": "sojourner-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "47239e71e03e9535a5ffac3243d3cdcc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10082,
            "upload_time": "2024-08-20T22:08:42",
            "upload_time_iso_8601": "2024-08-20T22:08:42.971103Z",
            "url": "https://files.pythonhosted.org/packages/32/6d/6b0f0d1141a63cfd287123aeb00d0f84748b3599001faa5635bf527862b5/sojourner-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c68c08e230b1cfad124e507d477b9eb1e06efdd25d60c555d87af8568bf3392e",
                "md5": "0377b9cb64fbedcd5dbaf2090be33289",
                "sha256": "4305446b285342e3f11a7324838b096527247b669b098a55afd5005cef1e1f71"
            },
            "downloads": -1,
            "filename": "sojourner-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "0377b9cb64fbedcd5dbaf2090be33289",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 11076,
            "upload_time": "2024-08-20T22:08:44",
            "upload_time_iso_8601": "2024-08-20T22:08:44.181381Z",
            "url": "https://files.pythonhosted.org/packages/c6/8c/08e230b1cfad124e507d477b9eb1e06efdd25d60c555d87af8568bf3392e/sojourner-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-20 22:08:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "withmartian",
    "github_project": "sojourner",
    "github_not_found": true,
    "lcname": "sojourner"
}
        
shy
Elapsed time: 0.26169s