utilfunction


Nameutilfunction JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/DSDanielPark/utilfunction
SummaryThe Python package utilfunction wraps and distributes useful functions in an easy-to-use way.
upload_time2024-03-20 14:16:28
maintainerNone
docs_urlNone
authorparkminwoo
requires_python>=3.6
licenseNone
keywords utils utility preprocessing analysis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Development Status :: 3 - Alpha <br>
*Copyright (c) 2023 MinWoo Park*
<br>

# util-function
![Util-Func](https://img.shields.io/badge/pypi-utilfunction-orange)
![Pypi Version](https://img.shields.io/pypi/v/utilfunction.svg)
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v2.0%20adopted-black.svg)](code_of_conduct.md)
[![Python Version](https://img.shields.io/badge/python-3.6%2C3.7%2C3.8-black.svg)](code_of_conduct.md)
![Code convention](https://img.shields.io/badge/code%20convention-pep8-black)

The Python package utilfunction wraps and distributes useful functions in an easy-to-use way. We have collected functions that are simpler in function than many distributed Python packages or whose category is ambiguous.

For personal purposes, I am curating repetitive functions and planning to categorize and distribute them along with documentation in the future. I recommend not using them until major version 1.
<br>

# Installation
```
pip install utilfunction
```
```
$ pip install git+https://github.com/dsdanielpark/util-function.git
```


<br>

# Features
`path_finder.py` - function: find_all <br>
 Find the path of a file or folder. 
```python
from utilfunction import find_all

nii_file_list = find_all('./home', 'file', 'mask.nii.gz')
```
<br>

`astyper.py` - function: col_converter <br>
Restores a column whose array is stored as a string type back to an array type.
```python
from utilfunction import col_convert

df_has_converted_col = col_convert(df, "embedding_arrays")
```

<br>

`beep.py` - function: beep <br>
Make beep
```python
from utilfunction import beep

beep()

sec=10
feq=800
beep(sec, feq)
```

<br>


`bib2md.py` - function: bib2md <br>
Convert `bib file` to `markdown file`  
```python
from utilfunction import bib2md

bib_path = './sample_data/attention_based.bib'
save_path = './sample_data/attention_based.md'
title_key = 'title'

bib2md(bib_path, title_key, save_path)

```

<br>

`pq.py` - function: df_to_pq <br>
pd.DataFrame object to parquet object
```python
from utilfunction import df_to_pq

example_df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})
output_folder = 'output'
output_file_name = 'example.parquet'
df_to_pq(example_df, output_folder, output_file_name)
```

<br>

`pq.py` - function: gen_hex <br>
Generating random hex

```python
from utilfunction import gen_hex

gen_hex(8)
```


# How to Contribute
Please create a pull request for any function that is useful and simple to reuse. Create a function, and write a tutorial with the same name as the function in the doc folder. Any snippet that you are comfortable with and use often will do. However, some contents may be revised and adjusted later for convenience.

1. Create a Python file containing functions in [`utilfunction folder`](https://github.com/DSDanielPark/utilfunction/tree/main/utifunc). You must include formatting and doc strings in your function.
2. Write brief explanations and examples in the [`doc folder`](https://github.com/DSDanielPark/utilfunction/tree/main/doc)
3. Write a one-line code example in README.md
5. Make a Pull Request
<br>

Please refer to the `find_all` function in [`path_finder.py`](https://github.com/DSDanielPark/utilfunction/blob/main/utifunc/path_finder.py).

<br>

- Styled with black `black .`
- Lnted with pylint `pylint --rcfile=setup.cfg util-function/`
- Type-checked with mypy `mypy util-function/`
- Pass the pytest unit tests `pytest`



# Notice
- This repo goes through a simple QA process, there are no major refactoring plans, and it's not a planned project, so it's in alpha.
- If there is a reference, please list it at the top of each Python file.
- Coverage of Python versions is subject to change. However, the code formatting is changed to black during the QA process.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DSDanielPark/utilfunction",
    "name": "utilfunction",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "Utils, Utility, Preprocessing, Analysis",
    "author": "parkminwoo",
    "author_email": "parkminwoo1991@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/c3/8d/ba0f4e37f08ab0fa1a3260d4ccfed36f221db6c74a401aa06d7bff736aba/utilfunction-1.0.0.tar.gz",
    "platform": null,
    "description": "Development Status :: 3 - Alpha <br>\r\n*Copyright (c) 2023 MinWoo Park*\r\n<br>\r\n\r\n# util-function\r\n![Util-Func](https://img.shields.io/badge/pypi-utilfunction-orange)\r\n![Pypi Version](https://img.shields.io/pypi/v/utilfunction.svg)\r\n[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v2.0%20adopted-black.svg)](code_of_conduct.md)\r\n[![Python Version](https://img.shields.io/badge/python-3.6%2C3.7%2C3.8-black.svg)](code_of_conduct.md)\r\n![Code convention](https://img.shields.io/badge/code%20convention-pep8-black)\r\n\r\nThe Python package utilfunction wraps and distributes useful functions in an easy-to-use way. We have collected functions that are simpler in function than many distributed Python packages or whose category is ambiguous.\r\n\r\nFor personal purposes, I am curating repetitive functions and planning to categorize and distribute them along with documentation in the future. I recommend not using them until major version 1.\r\n<br>\r\n\r\n# Installation\r\n```\r\npip install utilfunction\r\n```\r\n```\r\n$ pip install git+https://github.com/dsdanielpark/util-function.git\r\n```\r\n\r\n\r\n<br>\r\n\r\n# Features\r\n`path_finder.py` - function: find_all <br>\r\n Find the path of a file or folder. \r\n```python\r\nfrom utilfunction import find_all\r\n\r\nnii_file_list = find_all('./home', 'file', 'mask.nii.gz')\r\n```\r\n<br>\r\n\r\n`astyper.py` - function: col_converter <br>\r\nRestores a column whose array is stored as a string type back to an array type.\r\n```python\r\nfrom utilfunction import col_convert\r\n\r\ndf_has_converted_col = col_convert(df, \"embedding_arrays\")\r\n```\r\n\r\n<br>\r\n\r\n`beep.py` - function: beep <br>\r\nMake beep\r\n```python\r\nfrom utilfunction import beep\r\n\r\nbeep()\r\n\r\nsec=10\r\nfeq=800\r\nbeep(sec, feq)\r\n```\r\n\r\n<br>\r\n\r\n\r\n`bib2md.py` - function: bib2md <br>\r\nConvert `bib file` to `markdown file`  \r\n```python\r\nfrom utilfunction import bib2md\r\n\r\nbib_path = './sample_data/attention_based.bib'\r\nsave_path = './sample_data/attention_based.md'\r\ntitle_key = 'title'\r\n\r\nbib2md(bib_path, title_key, save_path)\r\n\r\n```\r\n\r\n<br>\r\n\r\n`pq.py` - function: df_to_pq <br>\r\npd.DataFrame object to parquet object\r\n```python\r\nfrom utilfunction import df_to_pq\r\n\r\nexample_df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]})\r\noutput_folder = 'output'\r\noutput_file_name = 'example.parquet'\r\ndf_to_pq(example_df, output_folder, output_file_name)\r\n```\r\n\r\n<br>\r\n\r\n`pq.py` - function: gen_hex <br>\r\nGenerating random hex\r\n\r\n```python\r\nfrom utilfunction import gen_hex\r\n\r\ngen_hex(8)\r\n```\r\n\r\n\r\n# How to Contribute\r\nPlease create a pull request for any function that is useful and simple to reuse. Create a function, and write a tutorial with the same name as the function in the doc folder. Any snippet that you are comfortable with and use often will do. However, some contents may be revised and adjusted later for convenience.\r\n\r\n1. Create a Python file containing functions in [`utilfunction folder`](https://github.com/DSDanielPark/utilfunction/tree/main/utifunc). You must include formatting and doc strings in your function.\r\n2. Write brief explanations and examples in the [`doc folder`](https://github.com/DSDanielPark/utilfunction/tree/main/doc)\r\n3. Write a one-line code example in README.md\r\n5. Make a Pull Request\r\n<br>\r\n\r\nPlease refer to the `find_all` function in [`path_finder.py`](https://github.com/DSDanielPark/utilfunction/blob/main/utifunc/path_finder.py).\r\n\r\n<br>\r\n\r\n- Styled with black `black .`\r\n- Lnted with pylint `pylint --rcfile=setup.cfg util-function/`\r\n- Type-checked with mypy `mypy util-function/`\r\n- Pass the pytest unit tests `pytest`\r\n\r\n\r\n\r\n# Notice\r\n- This repo goes through a simple QA process, there are no major refactoring plans, and it's not a planned project, so it's in alpha.\r\n- If there is a reference, please list it at the top of each Python file.\r\n- Coverage of Python versions is subject to change. However, the code formatting is changed to black during the QA process.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "The Python package utilfunction wraps and distributes useful functions in an easy-to-use way.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/DSDanielPark/utilfunction"
    },
    "split_keywords": [
        "utils",
        " utility",
        " preprocessing",
        " analysis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c809abf21b37b2e6c979aa6a717b079dfcba5feaf2810087dc1ba47d7d38d1a3",
                "md5": "87b98413e9045339754fd9b6136215b3",
                "sha256": "fbabd2cfa783f7ba694c820cc1083b80c9f1bb884029cf1bf9e63d0fce45059a"
            },
            "downloads": -1,
            "filename": "utilfunction-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "87b98413e9045339754fd9b6136215b3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 11309,
            "upload_time": "2024-03-20T14:16:26",
            "upload_time_iso_8601": "2024-03-20T14:16:26.627272Z",
            "url": "https://files.pythonhosted.org/packages/c8/09/abf21b37b2e6c979aa6a717b079dfcba5feaf2810087dc1ba47d7d38d1a3/utilfunction-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c38dba0f4e37f08ab0fa1a3260d4ccfed36f221db6c74a401aa06d7bff736aba",
                "md5": "67d13b2e68d39575f809b0864fadf552",
                "sha256": "0bc6b5f93cd43d8ead1450a8be82809c859646affc1ade6489224165552ee0e9"
            },
            "downloads": -1,
            "filename": "utilfunction-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "67d13b2e68d39575f809b0864fadf552",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 11078,
            "upload_time": "2024-03-20T14:16:28",
            "upload_time_iso_8601": "2024-03-20T14:16:28.652303Z",
            "url": "https://files.pythonhosted.org/packages/c3/8d/ba0f4e37f08ab0fa1a3260d4ccfed36f221db6c74a401aa06d7bff736aba/utilfunction-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-20 14:16:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DSDanielPark",
    "github_project": "utilfunction",
    "github_not_found": true,
    "lcname": "utilfunction"
}
        
Elapsed time: 0.20708s