Package: pythonic_archive_kit
PAK: Pythonic Archive Kit[](Picklable and Encrypted Recursive NamespacePAK 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.FeaturesSimple 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 thecryptographypackage. This ensures the
security of your PAK files.InstallationYou can install PAK using pip:pipinstallpythonic_archive_kitThis will provide the basic implementation of PAK. If you want to use encryption, you will need to install
thecryptographypackage:pipinstallcryptography# orpipinstallpythonic_archive_kit[encryption]And to include the more advanced serialization provided bydill:pipinstalldill# orpipinstallpythonic_archive_kit[serialization]UsageBasic Usagefrompythonic_archive_kitimportload_pak,PAK,save_pak# Create a PAK objectpak=PAK()pak.foo="bar"pak["baz"]="qux"# Save and load PAK objectssave_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:frompythonic_archive_kitimportopen_pakwithopen_pak("gamedata")asgamedata:...Encryption (Optional)To use encryption, ensure you have thecryptographypackage installed. You can encrypt PAK data by providing a
password:frompythonic_archive_kitimportsave_pak,load_pak,PAKpak=PAK()# Save an encrypted PAK filesave_pak(pak,"encrypted.pak",password="mypassword")# Load the encrypted PAK fileloaded_pak=load_pak("encrypted.pak",password="mypassword")A password can also be passed to the context manager:frompythonic_archive_kitimportopen_pakwithopen_pak("gamedata",password="mypassword")asgamedata:...ExamplesHere are some examples of how PAK can be used in different scenarios, including game development, project management,
and personal note-taking.RPG Save Data# Save player datafrompythonic_archive_kitimportopen_pakwithopen_pak("player_data.pak")asplayer_data:player_data.stats.level=10player_data.inventory.gold=500player_data.inventory.items=["sword","shield"]# Load player datawithopen_pak("player_data.pak")asplayer_data:print(player_data.stats.level)# Output: 10Project Management# Save project datafrompythonic_archive_kitimportopen_pakwithopen_pak("project_data.pak")asproject:project.name="My Awesome Project"project.tasks=["design","implementation","testing"]# Load project datawithopen_pak("project_data.pak")asproject:print(project.name)# Output: My Awesome ProjectPersonal Notesfrompythonic_archive_kitimportopen_pak# Save personal noteswithopen_pak("personal_notes.pak")asnotes:notes.journal.day1="Visited the park"notes.reminders=["Buy groceries","Call mom"]# Load personal noteswithopen_pak("personal_notes.pak")asnotes:print(notes.journal.day1)# Output: Visited the parkContributingFeel 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.LicenseGNU General Public License v3.0PAK is licensed under the GNU General Public License v3.0. See theLICENSEfile for more information.