pocketwelt


Namepocketwelt JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryPython powertool in your pocket
upload_time2024-09-28 10:48:38
maintainerNone
docs_urlNone
authorneurowelt
requires_python<4.0,>=3.8
licenseMIT
keywords python utilities
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pocketwelt

Python powertool in your pocket :hammer:

## Introduction

`pocketwelt` purpose is to provide basic tools for Python projects.

Idea for this package came from my personal experience of repeating certain methods over and over again - quite simple, but yet too complex to keep them in my memory at all times.

Hopefully `pocketwelt` will help you as it helps me - as a pocekt tool that comes in handy when I want to kickstart development as fast as possible or simply forgot about simple base64 encoding ;)

Worth noting - package uses only built-in Python libraries. My purpose is to keep this as vanilla as possible, so it does not collide with other dependencies you might have in your project.

## Installation

`pocketwelt` is available on [PyPi](https://pypi.org/project/pocketwelt/) and you can install it via pip:

```bash
pip install pocketwelt
```

You can also install it straight from git:

```bash
pip install git+https://github.com/neurowelt/pocketwelt.git
```

## Usage

Since this package is built using only vanilla Python libraries you can start using it right away after installing! Check out a few examples to get you going:
* [Custom colored logger](#custom-colored-logger)
* [Pickle your custom class](#pickle-your-custom-class)
* [Decode `base64` images](#decode-base64-images)

### Custom colored logger

`pocketwelt` comes with a neat `CustomLogger` class that provides colored logs and simple file based logging. You can create as many loggers as you want by simply calling the following method:

```python
from pocketwelt import getCustomLogger

error_logger = getCustomLogger("Error Logger", "ERROR")
info_logger = getCustomLogger("Info Logger", "INFO")

# Use as usual
error_logger.error("Error")
error_logger.info("Info that won't log")
info_logger.info("Info")
```

### Pickle your custom class

Often times when working with large dictionaries that contain more complex types you may want to save your current class for later to quickly reload it. You can more than easily use the following methods to do this:

```python
from pocketwelt import save_pickle, load_pickle
from your_script.complex_class import CustomClass

# Perform some operations with your class
llm = CustomClass()
llm.func()
llm.calc()

# Save object for later
save_pickle(llm, "llm.pkl")

# Reload it back
llm = load_pickle("llm.pkl")
```

### Decode `base64` images

You never know when you're going have to decode some base64 objects - that's where the `encodings` module comes in! For example, decoding `base64` image to `PIL.Image` never have been easier:

```python
from pocketwelt import b64_decode
from PIL import Image

decoded_obj = b64_decode(b64_image)
image = Image.open(decoded_obj)
```

> [!TIP]
> Check out the [official documentation](https://neurowelt.github.io/pocketwelt/) to read in detail about every single method and their limitations!

## Contribute

If you have a tool in your mind that you would like to see added to this package - feel encouraged to setup an [issue](https://github.com/neurowelt/pocketwelt/issues), create a [pull request](https://github.com/neurowelt/pocketwelt/pulls) with your own code or just [write to me](mailto:neurowelt.dev@gmail.com) with anything that comes to your mind!

Whenever you see a bug, vulnerability or place for enhancement, also do not hesitate to open an [issue](https://github.com/neurowelt/pocketwelt/issues) describing your findings. Any contribution will be greatly appreciated <3

## Notes

When going through the `tests` directory you will find [a painting of Gandalf](./tests/test_image.png) (see [original](https://www.jefmurray.com/gallery/)) that I use for testing. It was created by Jef Murray, a reknown fantasy illustrator. I recommend visiting his [site](https://www.jefmurray.com/gallery/) to see more of his work.
MIT License

Copyright (c) - 2024 - neurowelt

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pocketwelt",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "python, utilities",
    "author": "neurowelt",
    "author_email": "neurowelt.dev@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/47/cc/5092b2b9d8ff2158b94cc76c8a2b4bdf905a6e7d3a2af030fa539b725c52/pocketwelt-0.1.1.tar.gz",
    "platform": null,
    "description": "# pocketwelt\n\nPython powertool in your pocket :hammer:\n\n## Introduction\n\n`pocketwelt` purpose is to provide basic tools for Python projects.\n\nIdea for this package came from my personal experience of repeating certain methods over and over again - quite simple, but yet too complex to keep them in my memory at all times.\n\nHopefully `pocketwelt` will help you as it helps me - as a pocekt tool that comes in handy when I want to kickstart development as fast as possible or simply forgot about simple base64 encoding ;)\n\nWorth noting - package uses only built-in Python libraries. My purpose is to keep this as vanilla as possible, so it does not collide with other dependencies you might have in your project.\n\n## Installation\n\n`pocketwelt` is available on [PyPi](https://pypi.org/project/pocketwelt/) and you can install it via pip:\n\n```bash\npip install pocketwelt\n```\n\nYou can also install it straight from git:\n\n```bash\npip install git+https://github.com/neurowelt/pocketwelt.git\n```\n\n## Usage\n\nSince this package is built using only vanilla Python libraries you can start using it right away after installing! Check out a few examples to get you going:\n* [Custom colored logger](#custom-colored-logger)\n* [Pickle your custom class](#pickle-your-custom-class)\n* [Decode `base64` images](#decode-base64-images)\n\n### Custom colored logger\n\n`pocketwelt` comes with a neat `CustomLogger` class that provides colored logs and simple file based logging. You can create as many loggers as you want by simply calling the following method:\n\n```python\nfrom pocketwelt import getCustomLogger\n\nerror_logger = getCustomLogger(\"Error Logger\", \"ERROR\")\ninfo_logger = getCustomLogger(\"Info Logger\", \"INFO\")\n\n# Use as usual\nerror_logger.error(\"Error\")\nerror_logger.info(\"Info that won't log\")\ninfo_logger.info(\"Info\")\n```\n\n### Pickle your custom class\n\nOften times when working with large dictionaries that contain more complex types you may want to save your current class for later to quickly reload it. You can more than easily use the following methods to do this:\n\n```python\nfrom pocketwelt import save_pickle, load_pickle\nfrom your_script.complex_class import CustomClass\n\n# Perform some operations with your class\nllm = CustomClass()\nllm.func()\nllm.calc()\n\n# Save object for later\nsave_pickle(llm, \"llm.pkl\")\n\n# Reload it back\nllm = load_pickle(\"llm.pkl\")\n```\n\n### Decode `base64` images\n\nYou never know when you're going have to decode some base64 objects - that's where the `encodings` module comes in! For example, decoding `base64` image to `PIL.Image` never have been easier:\n\n```python\nfrom pocketwelt import b64_decode\nfrom PIL import Image\n\ndecoded_obj = b64_decode(b64_image)\nimage = Image.open(decoded_obj)\n```\n\n> [!TIP]\n> Check out the [official documentation](https://neurowelt.github.io/pocketwelt/) to read in detail about every single method and their limitations!\n\n## Contribute\n\nIf you have a tool in your mind that you would like to see added to this package - feel encouraged to setup an [issue](https://github.com/neurowelt/pocketwelt/issues), create a [pull request](https://github.com/neurowelt/pocketwelt/pulls) with your own code or just [write to me](mailto:neurowelt.dev@gmail.com) with anything that comes to your mind!\n\nWhenever you see a bug, vulnerability or place for enhancement, also do not hesitate to open an [issue](https://github.com/neurowelt/pocketwelt/issues) describing your findings. Any contribution will be greatly appreciated <3\n\n## Notes\n\nWhen going through the `tests` directory you will find [a painting of Gandalf](./tests/test_image.png) (see [original](https://www.jefmurray.com/gallery/)) that I use for testing. It was created by Jef Murray, a reknown fantasy illustrator. I recommend visiting his [site](https://www.jefmurray.com/gallery/) to see more of his work.\nMIT License\n\nCopyright (c) - 2024 - neurowelt\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python powertool in your pocket",
    "version": "0.1.1",
    "project_urls": null,
    "split_keywords": [
        "python",
        " utilities"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "24b2636d9f90a42a6f602c0b2e48efc1419d138859f458d87a3bc103ff6f2531",
                "md5": "48e3c57e6295017e2facbe6d108e6e47",
                "sha256": "7694530b7dd3251d77d92191705bad32e180da0cf82c6141d57668f177fc427b"
            },
            "downloads": -1,
            "filename": "pocketwelt-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "48e3c57e6295017e2facbe6d108e6e47",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 17011,
            "upload_time": "2024-09-28T10:48:36",
            "upload_time_iso_8601": "2024-09-28T10:48:36.755683Z",
            "url": "https://files.pythonhosted.org/packages/24/b2/636d9f90a42a6f602c0b2e48efc1419d138859f458d87a3bc103ff6f2531/pocketwelt-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "47cc5092b2b9d8ff2158b94cc76c8a2b4bdf905a6e7d3a2af030fa539b725c52",
                "md5": "0aebee23cca4a0a98ccd9b8adc877777",
                "sha256": "e229414c299abb5b07cc02c06c6db722cfc8c71f2e2cf45f7a81fb17c22c0920"
            },
            "downloads": -1,
            "filename": "pocketwelt-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0aebee23cca4a0a98ccd9b8adc877777",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 14918,
            "upload_time": "2024-09-28T10:48:38",
            "upload_time_iso_8601": "2024-09-28T10:48:38.121858Z",
            "url": "https://files.pythonhosted.org/packages/47/cc/5092b2b9d8ff2158b94cc76c8a2b4bdf905a6e7d3a2af030fa539b725c52/pocketwelt-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-28 10:48:38",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pocketwelt"
}
        
Elapsed time: 0.32994s