ezpkl


Nameezpkl JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/yesinkim/ezpkl.git
Summarylovely pickling🥒 for context manager hater👊
upload_time2024-09-18 10:48:15
maintainerNone
docs_urlNone
authorbailando
requires_python>=3
licenseNone
keywords pickle file easy easypickle
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # EZPKL: lovely pickling🥒 for context manager hater👊

 [![PyPI version](https://badge.fury.io/py/ezpkl.svg)](https://badge.fury.io/py/ezpkl) [![Python Downloads](https://static.pepy.tech/badge/ezpkl)](https://pepy.tech/project/ezpkl)

<h4 align="center">
    <p>
        English |
        <a href="https://github.com/yesinkim/ezpkl/blob/main/README_ko.md">한국어</a>
    </p>
</h4>

![EZPKL character](https://raw.githubusercontent.com/yesinkim/ezpkl/main/assets/banner.png)
I hate `with open(file_path) as file...` and I don't want to google `how to save pickle in python` anymore. 
then, i made it.

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install ezpkl.

```bash
pip install ezpkl
```

## Usage

### Save Object to pkl

```python
from ezpkl import save_pkl

a = [1, 2, 3, 4, 5]

# 'a.pkl' will be saved in the current directory.
save_pkl(var=a)

# 'a_list_temp.pkl' will be saved in the current directory.
save_pkl(var=a, file_name='a_list_temp')
```

### Load Object

```python
from ezpkl import load_pkl

a = load_pkl('a.pkl')
```

### Save Object to txt

```python
from ezpkl import save_txt

a = [1, 2, 3, 4, 5]

# 'a.txt' will be saved in the current directory.
save_txt(data=a)

# 'a_list_temp.txt' will be saved in the current directory.
save_txt(data=a, file_name='a_list_temp')
```

### Load Object

```python
from ezpkl import load_txt

a = load_txt('a.txt')
```

### Save List Object to txt with separator

```python
from ezpkl import save_txt

a = ["apple", "banana", "cherry"]

# 'a.txt' will be saved in the current directory with newline separator (default).
save_txt(data=a)
# a.txt file content:
# apple
# banana
# cherry

# 'a_list_temp.txt' will be saved in the current directory with space separator.
save_txt(data=a, file_name='a_list_temp', separator=' ')
# a_list_temp.txt file content:
# apple banana cherry

# 'a_list_temp.txt' will be saved in the current directory without separator.
save_txt(data=a, file_name='a_list_temp', separator=None)
# a_list_temp.txt file content:
# applebananacherry
```

## License

[MIT](https://choosealicense.com/licenses/mit/)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yesinkim/ezpkl.git",
    "name": "ezpkl",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": "pickle, file, easy, easypickle",
    "author": "bailando",
    "author_email": "bailando.ys@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ca/69/365df678ee53049b31edbe99ea3145ed4cf26a65dad14bfff1296f91176e/ezpkl-0.2.0.tar.gz",
    "platform": null,
    "description": "# EZPKL: lovely pickling\ud83e\udd52 for context manager hater\ud83d\udc4a\n\n [![PyPI version](https://badge.fury.io/py/ezpkl.svg)](https://badge.fury.io/py/ezpkl) [![Python Downloads](https://static.pepy.tech/badge/ezpkl)](https://pepy.tech/project/ezpkl)\n\n<h4 align=\"center\">\n    <p>\n        English |\n        <a href=\"https://github.com/yesinkim/ezpkl/blob/main/README_ko.md\">\ud55c\uad6d\uc5b4</a>\n    </p>\n</h4>\n\n![EZPKL character](https://raw.githubusercontent.com/yesinkim/ezpkl/main/assets/banner.png)\nI hate `with open(file_path) as file...` and I don't want to google `how to save pickle in python` anymore. \nthen, i made it.\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install ezpkl.\n\n```bash\npip install ezpkl\n```\n\n## Usage\n\n### Save Object to pkl\n\n```python\nfrom ezpkl import save_pkl\n\na = [1, 2, 3, 4, 5]\n\n# 'a.pkl' will be saved in the current directory.\nsave_pkl(var=a)\n\n# 'a_list_temp.pkl' will be saved in the current directory.\nsave_pkl(var=a, file_name='a_list_temp')\n```\n\n### Load Object\n\n```python\nfrom ezpkl import load_pkl\n\na = load_pkl('a.pkl')\n```\n\n### Save Object to txt\n\n```python\nfrom ezpkl import save_txt\n\na = [1, 2, 3, 4, 5]\n\n# 'a.txt' will be saved in the current directory.\nsave_txt(data=a)\n\n# 'a_list_temp.txt' will be saved in the current directory.\nsave_txt(data=a, file_name='a_list_temp')\n```\n\n### Load Object\n\n```python\nfrom ezpkl import load_txt\n\na = load_txt('a.txt')\n```\n\n### Save List Object to txt with separator\n\n```python\nfrom ezpkl import save_txt\n\na = [\"apple\", \"banana\", \"cherry\"]\n\n# 'a.txt' will be saved in the current directory with newline separator (default).\nsave_txt(data=a)\n# a.txt file content:\n# apple\n# banana\n# cherry\n\n# 'a_list_temp.txt' will be saved in the current directory with space separator.\nsave_txt(data=a, file_name='a_list_temp', separator=' ')\n# a_list_temp.txt file content:\n# apple banana cherry\n\n# 'a_list_temp.txt' will be saved in the current directory without separator.\nsave_txt(data=a, file_name='a_list_temp', separator=None)\n# a_list_temp.txt file content:\n# applebananacherry\n```\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "lovely pickling\ud83e\udd52 for context manager hater\ud83d\udc4a",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/yesinkim/ezpkl.git"
    },
    "split_keywords": [
        "pickle",
        " file",
        " easy",
        " easypickle"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a770bc055c8d2846a5bb3af2a2c1ac82e818270bb996768f467193c2ea21482b",
                "md5": "f849ff3babb5edcd3ebbd3e1ce7e5da6",
                "sha256": "9614e3c6f3596d30f4c9a1583ebaafa3949bed7154f85bb4aeaca73068bbc19c"
            },
            "downloads": -1,
            "filename": "ezpkl-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f849ff3babb5edcd3ebbd3e1ce7e5da6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 6227,
            "upload_time": "2024-09-18T10:48:14",
            "upload_time_iso_8601": "2024-09-18T10:48:14.378142Z",
            "url": "https://files.pythonhosted.org/packages/a7/70/bc055c8d2846a5bb3af2a2c1ac82e818270bb996768f467193c2ea21482b/ezpkl-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca69365df678ee53049b31edbe99ea3145ed4cf26a65dad14bfff1296f91176e",
                "md5": "9501820a2adec88b7487f55b52f5d682",
                "sha256": "ed50b84846ab48fc7f84496917d7f84205e8782030a19d965a7e4c2985ffc6ae"
            },
            "downloads": -1,
            "filename": "ezpkl-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9501820a2adec88b7487f55b52f5d682",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 4554,
            "upload_time": "2024-09-18T10:48:15",
            "upload_time_iso_8601": "2024-09-18T10:48:15.226748Z",
            "url": "https://files.pythonhosted.org/packages/ca/69/365df678ee53049b31edbe99ea3145ed4cf26a65dad14bfff1296f91176e/ezpkl-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-18 10:48:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yesinkim",
    "github_project": "ezpkl",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ezpkl"
}
        
Elapsed time: 0.30739s