https://github.com/ohidurbappy/reusable
Python reusable code, utility functions and time saver.
https://github.com/ohidurbappy/reusable
functions helper pypi python python-library python3 reusable reusable-components reusable-functions utility utility-library
Last synced: 3 months ago
JSON representation
Python reusable code, utility functions and time saver.
- Host: GitHub
- URL: https://github.com/ohidurbappy/reusable
- Owner: ohidurbappy
- License: mit
- Created: 2020-09-04T02:17:39.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-04T09:23:54.000Z (about 5 years ago)
- Last Synced: 2025-09-29T11:15:22.648Z (8 months ago)
- Topics: functions, helper, pypi, python, python-library, python3, reusable, reusable-components, reusable-functions, utility, utility-library
- Language: Python
- Homepage: https://pypi.org/project/reusable/
- Size: 43.9 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.rst
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# reusable
Python reusable code, utility functions and time saver.
## Overview
Python `reusable` library contains a handful of reusable functions and utility class
### Install
```bash
pip install -U reusable
```
## Usage
### Loading Configuration files as class attributes
```python
from reusable import AppConfig
config=AppConfig('config.json')
mykey=config.my_key
```
### Load config file accessible via class methods
```python
from reusable import Config
config=Config('config.json')
mykey=config.get('my_key')
```
## Available functions
- **random_string()** : return a random string of specified length and character set
- **print_table()** : prints a data table provided as list
- **print_time_taken** [decorator] : prints the time of execution of a parameter
- **groupby_count()** : groups a given list according the number of times it appears
- **generate_all_datetime_regex** : generate the regex for all possible datetime
- **download_file** : download a file from the given url
- **is_python3()** : check if the interpreter is python v3
- **is_python_above_or_equal()** : check if the interpreter is above or equal to the given version
- **check_modules_installed()** : check if the given modules are installed
- **random_useragent()** : return a random useragent
- **is_valid_json()** : checks if given string is valid json
- **headline()** : return a formatted string in headline style
- **splash()** : return a string with splash style
- **multiline_input()** : takes multiline user input
- **get_datadir()** : returns the app data folder
- **get_windows_appdata_dir()** : similar to get_datadir() but windows only
- **slugify()** : Makes slug text from given vlaue
- **float_range()** : Returns a iterable of floating range