# PYLIB3
- The pylib3 is a shared python library, that includes common functions
that can be used in any python package.
- This package can be used both with python2 and python3
## Usage:
- Install the pylib3 package (inside your project virtual environment)
```
pip install pylib3
```
- To import the pylib3 package
```
import pylib3
```
- To use one of the common functions from the pylib3 package
```
from pylib3 import timer
```
## Common Functions:
```
get_version(caller, version_file)
```
Gets the version number from the version_file
param str caller: source file caller (i.e __file__)
param str version_file: a version file to get the version number from
returns (str): version number or '0.0.0' if the version_file doesn't exists
```
init_logging(log_file, verbose=False, console=False, info='white', debug='blue', warning='yellow', error='red', critical='red')
```
Logger initialization
param str log_file: log file name
param bool console: if set to True will print logs both to a file and to stdout (console)
param bool verbose: if set to True will print more information
param str info: info messages color
param str debug: debug messages color
param str warning: warning messages color
param str error: error messages color
param str critical: critical messages color
```
timer(func)
```
This function used as a decorator function to print the
elapsed time of the passed function
param obj func: original function
returns (obj): wrapper function
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/shlomi.ben.david/pylib3",
"name": "pylib3",
"maintainer": "",
"docs_url": null,
"requires_python": ">=2.7",
"maintainer_email": "",
"keywords": "",
"author": "Shlomi Ben-David",
"author_email": "shlomi.ben.david@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e9/0f/4b3fe6dcafd64690bb6f53eabea26120303c7368095efaf3e81576c68d5d/pylib3-0.0.4.tar.gz",
"platform": null,
"description": "# PYLIB3\n\n- The pylib3 is a shared python library, that includes common functions\n that can be used in any python package.\n- This package can be used both with python2 and python3\n\n## Usage:\n- Install the pylib3 package (inside your project virtual environment)\n```\npip install pylib3\n```\n\n- To import the pylib3 package\n```\nimport pylib3\n```\n\n- To use one of the common functions from the pylib3 package\n```\nfrom pylib3 import timer\n```\n\n## Common Functions:\n\n```\nget_version(caller, version_file)\n```\n\nGets the version number from the version_file\n\nparam str caller: source file caller (i.e __file__)\nparam str version_file: a version file to get the version number from\nreturns (str): version number or '0.0.0' if the version_file doesn't exists\n\n```\ninit_logging(log_file, verbose=False, console=False, info='white', debug='blue', warning='yellow', error='red', critical='red')\n```\n\nLogger initialization\n\nparam str log_file: log file name\nparam bool console: if set to True will print logs both to a file and to stdout (console)\nparam bool verbose: if set to True will print more information\nparam str info: info messages color\nparam str debug: debug messages color\nparam str warning: warning messages color\nparam str error: error messages color\nparam str critical: critical messages color\n\n```\ntimer(func)\n```\n\nThis function used as a decorator function to print the\nelapsed time of the passed function\n\nparam obj func: original function\nreturns (obj): wrapper function\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Python Shared Library",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://gitlab.com/shlomi.ben.david/pylib3"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e90f4b3fe6dcafd64690bb6f53eabea26120303c7368095efaf3e81576c68d5d",
"md5": "9c4b7066e60f2993b4b3edd5cf0f5904",
"sha256": "9daa6eb37e13ae349f73f0b33fad41010d07a82c70391e3e7985bb6f12b082ed"
},
"downloads": -1,
"filename": "pylib3-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "9c4b7066e60f2993b4b3edd5cf0f5904",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=2.7",
"size": 9441,
"upload_time": "2023-06-07T14:34:42",
"upload_time_iso_8601": "2023-06-07T14:34:42.642431Z",
"url": "https://files.pythonhosted.org/packages/e9/0f/4b3fe6dcafd64690bb6f53eabea26120303c7368095efaf3e81576c68d5d/pylib3-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-07 14:34:42",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "shlomi.ben.david",
"gitlab_project": "pylib3",
"lcname": "pylib3"
}