The Python package utilfunction wraps and distributes useful functions in an easy-to-use way.
Project description
Development Status :: 3 - Alpha
Copyright (c) 2023 MinWoo Park
util-function
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.
Installation
pip install utilfunction
Features
path_finder.py
- function: find_path
Find the path of a file or folder.
from utilfunction import find_path
nii_file_list = find_path('./home', 'file', 'mask.nii.gz')
astyper.py
- function: col_converter
Restores a column whose array is stored as a string type back to an array type.
from utilfunction import col_convert
df_has_converted_col = col_convert(df, "embedding_arrays")
beep.py
- function: beep
Make beep
from utilfunction import beep
beep()
sec=10
feq=800
beep(sec, feq)
bib2md.py
- function: bib2md
Convert bib file
to markdown file
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)
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.
- Create a Python file containing functions in
utilfunction folder
. You must include formatting and doc strings in your function. - Write brief explanations and examples in the
doc folder
- Write a one-line code example in README.md
- Make a Pull Request
Please refer to the find_path
function in path_finder.py
.
- 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file utilfunction-0.1.6.tar.gz
.
File metadata
- Download URL: utilfunction-0.1.6.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 533fc9b5a2d4461762f5d14ab6c521dc9234ff0d98511f625347a5fe323d5fe5 |
|
MD5 | e274ba521a96196a26a5cea653ae82ed |
|
BLAKE2b-256 | 8ade22dcb5e768de70038482ffe8a1b4b6779154a93a2d39896fd14534bd4b5b |
File details
Details for the file utilfunction-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: utilfunction-0.1.6-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3df408b79ca6dd3f3d993744f626861432b11872e5afbe08ce37fc9efc44904d |
|
MD5 | 9519111633a06aee508868436947ba8a |
|
BLAKE2b-256 | 0bf0e78c856d52873ca68e785bbfa69a2b1c12651f9d427636b0a3b0622158d9 |