pythonic_archive_kit


Namepythonic_archive_kit JSON
Version 2.0.1 PyPI version JSON
download
home_pageNone
SummaryThe Pythonic Archive Kit
upload_time2023-09-06 16:52:31
maintainerNone
docs_urlNone
authorAlyce Osbourne
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements cryptography
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PAK: Pythonic Archive Kit

[![PyPI version](https://badge.fury.io/py/pythonic-archive-kit.svg)](https://badge.fury.io/py/pythonic-archive-kit)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pythonic-archive-kit)](https://pypi.org/project/pythonic-archive-kit/)
[![PyPI - License](https://img.shields.io/pypi/l/pythonic-archive-kit)](

### Picklable and Encrypted Recursive Namespace

PAK is a Python library that provides a simple, recursive namespace that can be pickled and encrypted. It allows you to
manage structured data with ease.

## Features

- **Simple Interface**: PAK provides a simple interface for managing data. It can be used like a dictionary or an
  object. It automatically handles the creation of nested namespaces, this allows for structured data management.

- **Recursive Namespace**: PAK offers a recursive namespace that can be used like a dictionary or an object. This allows
  for flexible and structured data management.

- **Context Manager**: PAK provides a context manager that automatically saves and loads PAK objects. This makes it easy
  to manage your data.

- **Pickling**: PAK objects can be easily serialized, it utilizes pickle, or optionally dill, to serialize data. This
  allows you to save and load your PAK objects. This process is block hashed to help protect against data corruption
  and tampering.

- **Compression**: PAK supports compression of data using the `lzma' or 'gzip' packages. This
  reduces the size of your PAK files.

- **Encryption (Optional)**: PAK supports optional encryption of data using the `cryptography` package. This ensures the
  security of your PAK files.

## Installation

You can install PAK using pip:

```bash
pip install pythonic_archive_kit
```

This will provide the basic implementation of PAK. If you want to use encryption, you will need to install
the `cryptography` package:

```bash
pip install cryptography
# or
pip install pythonic_archive_kit[encryption]
```

And to include the more advanced serialization provided by `dill`:

```bash
pip install dill
# or
pip install pythonic_archive_kit[serialization]
```

## Usage

### Basic Usage

```python
from pythonic_archive_kit import load_pak, PAK, save_pak

# Create a PAK object
pak = PAK()
pak.foo = "bar"
pak["baz"] = "qux"

# Save and load PAK objects
save_pak(pak, "example.pak")
loaded_pak = load_pak("example.pak")
```

You can also make use of the paks context manager to automatically save and load PAK objects:

```python
from pythonic_archive_kit import open_pak

with open_pak("gamedata") as gamedata:
    ...
```

### Encryption (Optional)

To use encryption, ensure you have the `cryptography` package installed. You can encrypt PAK data by providing a
password:

```python
from pythonic_archive_kit import save_pak, load_pak, PAK

pak = PAK()
# Save an encrypted PAK file
save_pak(pak, "encrypted.pak", password = "mypassword")

# Load the encrypted PAK file
loaded_pak = load_pak("encrypted.pak", password = "mypassword")
```

A password can also be passed to the context manager:

```python
from pythonic_archive_kit import open_pak

with open_pak("gamedata", password = "mypassword") as gamedata:
    ...
```

### Examples

Here are some examples of how PAK can be used in different scenarios, including game development, project management,
and personal note-taking.

#### RPG Save Data

```python
# Save player data
from pythonic_archive_kit import open_pak

with open_pak("player_data.pak") as player_data:
    player_data.stats.level = 10
    player_data.inventory.gold = 500
    player_data.inventory.items = ["sword", "shield"]

# Load player data
with open_pak("player_data.pak") as player_data:
    print(player_data.stats.level)  # Output: 10
```

#### Project Management

```python
# Save project data
from pythonic_archive_kit import open_pak

with open_pak("project_data.pak") as project:
    project.name = "My Awesome Project"
    project.tasks = ["design", "implementation", "testing"]

# Load project data
with open_pak("project_data.pak") as project:
    print(project.name)  # Output: My Awesome Project
```

#### Personal Notes

```python
from pythonic_archive_kit import open_pak

# Save personal notes
with open_pak("personal_notes.pak") as notes:
  notes.journal.day1 = "Visited the park"
  notes.reminders = ["Buy groceries", "Call mom"]

# Load personal notes
with open_pak("personal_notes.pak") as notes:
  print(notes.journal.day1)  # Output: Visited the park
```

## Contributing

Feel free to contribute to PAK by opening an issue or pull request. If you have any questions, feel free to contact me
at via GitHub.

## License

#### GNU General Public License v3.0

PAK is licensed under the GNU General Public License v3.0. See the [LICENSE](LICENSE) file for more information.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pythonic_archive_kit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Alyce Osbourne",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/ac/2a/f7095db16548077927f0a7d3680f5e3e135e04b8faf337a0fdf614581aca/pythonic_archive_kit-2.0.1.tar.gz",
    "platform": null,
    "description": "# PAK: Pythonic Archive Kit\n\n[![PyPI version](https://badge.fury.io/py/pythonic-archive-kit.svg)](https://badge.fury.io/py/pythonic-archive-kit)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pythonic-archive-kit)](https://pypi.org/project/pythonic-archive-kit/)\n[![PyPI - License](https://img.shields.io/pypi/l/pythonic-archive-kit)](\n\n### Picklable and Encrypted Recursive Namespace\n\nPAK is a Python library that provides a simple, recursive namespace that can be pickled and encrypted. It allows you to\nmanage structured data with ease.\n\n## Features\n\n- **Simple Interface**: PAK provides a simple interface for managing data. It can be used like a dictionary or an\n  object. It automatically handles the creation of nested namespaces, this allows for structured data management.\n\n- **Recursive Namespace**: PAK offers a recursive namespace that can be used like a dictionary or an object. This allows\n  for flexible and structured data management.\n\n- **Context Manager**: PAK provides a context manager that automatically saves and loads PAK objects. This makes it easy\n  to manage your data.\n\n- **Pickling**: PAK objects can be easily serialized, it utilizes pickle, or optionally dill, to serialize data. This\n  allows you to save and load your PAK objects. This process is block hashed to help protect against data corruption\n  and tampering.\n\n- **Compression**: PAK supports compression of data using the `lzma' or 'gzip' packages. This\n  reduces the size of your PAK files.\n\n- **Encryption (Optional)**: PAK supports optional encryption of data using the `cryptography` package. This ensures the\n  security of your PAK files.\n\n## Installation\n\nYou can install PAK using pip:\n\n```bash\npip install pythonic_archive_kit\n```\n\nThis will provide the basic implementation of PAK. If you want to use encryption, you will need to install\nthe `cryptography` package:\n\n```bash\npip install cryptography\n# or\npip install pythonic_archive_kit[encryption]\n```\n\nAnd to include the more advanced serialization provided by `dill`:\n\n```bash\npip install dill\n# or\npip install pythonic_archive_kit[serialization]\n```\n\n## Usage\n\n### Basic Usage\n\n```python\nfrom pythonic_archive_kit import load_pak, PAK, save_pak\n\n# Create a PAK object\npak = PAK()\npak.foo = \"bar\"\npak[\"baz\"] = \"qux\"\n\n# Save and load PAK objects\nsave_pak(pak, \"example.pak\")\nloaded_pak = load_pak(\"example.pak\")\n```\n\nYou can also make use of the paks context manager to automatically save and load PAK objects:\n\n```python\nfrom pythonic_archive_kit import open_pak\n\nwith open_pak(\"gamedata\") as gamedata:\n    ...\n```\n\n### Encryption (Optional)\n\nTo use encryption, ensure you have the `cryptography` package installed. You can encrypt PAK data by providing a\npassword:\n\n```python\nfrom pythonic_archive_kit import save_pak, load_pak, PAK\n\npak = PAK()\n# Save an encrypted PAK file\nsave_pak(pak, \"encrypted.pak\", password = \"mypassword\")\n\n# Load the encrypted PAK file\nloaded_pak = load_pak(\"encrypted.pak\", password = \"mypassword\")\n```\n\nA password can also be passed to the context manager:\n\n```python\nfrom pythonic_archive_kit import open_pak\n\nwith open_pak(\"gamedata\", password = \"mypassword\") as gamedata:\n    ...\n```\n\n### Examples\n\nHere are some examples of how PAK can be used in different scenarios, including game development, project management,\nand personal note-taking.\n\n#### RPG Save Data\n\n```python\n# Save player data\nfrom pythonic_archive_kit import open_pak\n\nwith open_pak(\"player_data.pak\") as player_data:\n    player_data.stats.level = 10\n    player_data.inventory.gold = 500\n    player_data.inventory.items = [\"sword\", \"shield\"]\n\n# Load player data\nwith open_pak(\"player_data.pak\") as player_data:\n    print(player_data.stats.level)  # Output: 10\n```\n\n#### Project Management\n\n```python\n# Save project data\nfrom pythonic_archive_kit import open_pak\n\nwith open_pak(\"project_data.pak\") as project:\n    project.name = \"My Awesome Project\"\n    project.tasks = [\"design\", \"implementation\", \"testing\"]\n\n# Load project data\nwith open_pak(\"project_data.pak\") as project:\n    print(project.name)  # Output: My Awesome Project\n```\n\n#### Personal Notes\n\n```python\nfrom pythonic_archive_kit import open_pak\n\n# Save personal notes\nwith open_pak(\"personal_notes.pak\") as notes:\n  notes.journal.day1 = \"Visited the park\"\n  notes.reminders = [\"Buy groceries\", \"Call mom\"]\n\n# Load personal notes\nwith open_pak(\"personal_notes.pak\") as notes:\n  print(notes.journal.day1)  # Output: Visited the park\n```\n\n## Contributing\n\nFeel free to contribute to PAK by opening an issue or pull request. If you have any questions, feel free to contact me\nat via GitHub.\n\n## License\n\n#### GNU General Public License v3.0\n\nPAK is licensed under the GNU General Public License v3.0. See the [LICENSE](LICENSE) file for more information.",
    "bugtrack_url": null,
    "license": null,
    "summary": "The Pythonic Archive Kit",
    "version": "2.0.1",
    "project_urls": {
        "Home": "https://github.com/AlyceOsbourne/PythonicArchiveKit"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b6663c942c5caa4acf6e2941d243cdf303252384c2624d548d502d05665da70c",
                "md5": "a2a40625384ffd96d78bafb0b0c08dbc",
                "sha256": "45434b2ac5b3c082e47f61cdb90fdb94fd351dffa3a27859be33419d1212b44a"
            },
            "downloads": -1,
            "filename": "pythonic_archive_kit-2.0.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a2a40625384ffd96d78bafb0b0c08dbc",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 19550,
            "upload_time": "2023-09-06T16:52:29",
            "upload_time_iso_8601": "2023-09-06T16:52:29.707817Z",
            "url": "https://files.pythonhosted.org/packages/b6/66/3c942c5caa4acf6e2941d243cdf303252384c2624d548d502d05665da70c/pythonic_archive_kit-2.0.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ac2af7095db16548077927f0a7d3680f5e3e135e04b8faf337a0fdf614581aca",
                "md5": "df6cccd9fc604073ba5fa9d493c525ec",
                "sha256": "0de425991d26de4d08c45238e459dbec8a47bbc847eefa718ed70d427d19963c"
            },
            "downloads": -1,
            "filename": "pythonic_archive_kit-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "df6cccd9fc604073ba5fa9d493c525ec",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 19362,
            "upload_time": "2023-09-06T16:52:31",
            "upload_time_iso_8601": "2023-09-06T16:52:31.276678Z",
            "url": "https://files.pythonhosted.org/packages/ac/2a/f7095db16548077927f0a7d3680f5e3e135e04b8faf337a0fdf614581aca/pythonic_archive_kit-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-06 16:52:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AlyceOsbourne",
    "github_project": "PythonicArchiveKit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "cryptography",
            "specs": [
                [
                    "~=",
                    "41.0.3"
                ]
            ]
        }
    ],
    "lcname": "pythonic_archive_kit"
}
        
Elapsed time: 0.13155s