securetar


Namesecuretar JSON
Version 2024.2.0 PyPI version JSON
download
home_pagehttps://github.com/pvizeli/securetar
SummaryPython module to handle tarfile backups.
upload_time2024-02-12 17:52:02
maintainer
docs_urlNone
authorPascal Vizeli
requires_python>=3.9
licenseApache License 2.0
keywords
VCS
bugtrack_url
requirements cryptography
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Secure Tar
Secure Tarfile library

It's a streaming wrapper around python tarfile and allow secure handling files and support encryption.


```python

with SecureTarFile("test.tar", "w") as tar_file:
        atomic_contents_add(
            tar_file,
            temp_orig,
            excludes=[],
            arcname=".",
        )

with SecureTarFile("test.tar", "w", b"AES128_KEY_SIZE") as tar_file:
        atomic_contents_add(
            tar_file,
            temp_orig,
            excludes=[],
            arcname=".",
        )

```

A common pattern is to create an outer uncompressed tarfile that contains
a variety of inner tar files. This can be accomplished without writing 
out multiple files with the following pattern.

```python

outer_secure_tar_file = SecureTarFile("pkg.tar", "w", gzip=False)
with outer_secure_tar_file as outer_tar_file:
    with outer_secure_tar_file.create_inner_tar(
        "./backup1.tar.gz", gzip=True
    ) as inner_tar_file:
        atomic_contents_add(
            inner_tar_file,
            path_1,
            excludes=[],
            arcname=".",
        )

    with outer_secure_tar_file.create_inner_tar(
        "./backup2.tar.gz", gzip=True
    ) as inner_tar_file:
        atomic_contents_add(
            inner_tar_file,
            path_2,
            excludes=[],
            arcname=".",
        )

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pvizeli/securetar",
    "name": "securetar",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "",
    "author": "Pascal Vizeli",
    "author_email": "pvizeli@syshack.ch",
    "download_url": "https://files.pythonhosted.org/packages/67/df/9e13731929d9baece9c9f9ffe7012a089f78b67053844bf4e2a30ebee262/securetar-2024.2.0.tar.gz",
    "platform": "any",
    "description": "# Secure Tar\nSecure Tarfile library\n\nIt's a streaming wrapper around python tarfile and allow secure handling files and support encryption.\n\n\n```python\n\nwith SecureTarFile(\"test.tar\", \"w\") as tar_file:\n        atomic_contents_add(\n            tar_file,\n            temp_orig,\n            excludes=[],\n            arcname=\".\",\n        )\n\nwith SecureTarFile(\"test.tar\", \"w\", b\"AES128_KEY_SIZE\") as tar_file:\n        atomic_contents_add(\n            tar_file,\n            temp_orig,\n            excludes=[],\n            arcname=\".\",\n        )\n\n```\n\nA common pattern is to create an outer uncompressed tarfile that contains\na variety of inner tar files. This can be accomplished without writing \nout multiple files with the following pattern.\n\n```python\n\nouter_secure_tar_file = SecureTarFile(\"pkg.tar\", \"w\", gzip=False)\nwith outer_secure_tar_file as outer_tar_file:\n    with outer_secure_tar_file.create_inner_tar(\n        \"./backup1.tar.gz\", gzip=True\n    ) as inner_tar_file:\n        atomic_contents_add(\n            inner_tar_file,\n            path_1,\n            excludes=[],\n            arcname=\".\",\n        )\n\n    with outer_secure_tar_file.create_inner_tar(\n        \"./backup2.tar.gz\", gzip=True\n    ) as inner_tar_file:\n        atomic_contents_add(\n            inner_tar_file,\n            path_2,\n            excludes=[],\n            arcname=\".\",\n        )\n\n```\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Python module to handle tarfile backups.",
    "version": "2024.2.0",
    "project_urls": {
        "Homepage": "https://github.com/pvizeli/securetar"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "354fe760584397e2a2d88ce61539fb2a708f05d695744bf66909588d529a234c",
                "md5": "9ea27a183fbec4371e496843d57da696",
                "sha256": "ec47b359f4b9a074ae0d186bcde82bea5fd9dce7040b38f468446ce2c98b381f"
            },
            "downloads": -1,
            "filename": "securetar-2024.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9ea27a183fbec4371e496843d57da696",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 9195,
            "upload_time": "2024-02-12T17:52:01",
            "upload_time_iso_8601": "2024-02-12T17:52:01.420189Z",
            "url": "https://files.pythonhosted.org/packages/35/4f/e760584397e2a2d88ce61539fb2a708f05d695744bf66909588d529a234c/securetar-2024.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "67df9e13731929d9baece9c9f9ffe7012a089f78b67053844bf4e2a30ebee262",
                "md5": "cab6163b73567d3f2d6f3f2066c9f839",
                "sha256": "ea01eb573fd47957cc11651c7bef1d545cf53322ccf8bdd5dd38a4ddd2d35d53"
            },
            "downloads": -1,
            "filename": "securetar-2024.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cab6163b73567d3f2d6f3f2066c9f839",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 10815,
            "upload_time": "2024-02-12T17:52:02",
            "upload_time_iso_8601": "2024-02-12T17:52:02.964910Z",
            "url": "https://files.pythonhosted.org/packages/67/df/9e13731929d9baece9c9f9ffe7012a089f78b67053844bf4e2a30ebee262/securetar-2024.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-12 17:52:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pvizeli",
    "github_project": "securetar",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "cryptography",
            "specs": []
        }
    ],
    "lcname": "securetar"
}
        
Elapsed time: 0.18229s