semvec/pypi-packages huggingface dataset:
cast-from-env 0.0.8
Get and cast environment variables
License: MIT

# cast-from-env

Get and cast environment variables

## Installation

`python setup.py install`

## Usage

Call `from_env()` with the name of an environment variable, and either a default
value to return if the environment variable is not set, or a type to cast the
environment variable's value to if it is set. If a default value is passed and the
variable is set, its value will be cast to the type of the default value.

Actually, any callable can be passed as the second parameter, and will be used to
cast the value if it's not None. So if you pass e.g. `json.loads` a JSON env var value
will be cast to a Python `list` or `dict`.

Also, if the type of the default value – or the type passed in instead – is `bool`,
`from_env()` will return `True` if the environment variable's string value is any
of `'1'`, `'true'`, `'t'`, `'yes'`, `'y'`, and `'on'`, and `False` otherwise.

## Examples

    from cast_from_env import from_env
    from json import loads

    from_env('STRING_VAR', 'default value')  # Value or 'default value' if not set
    from_env('INTEGER_VAR', 100)  # Value cast to int, or 100 if not set
    from_env('INTEGER_VAR', int)  # Value cast to int, or None if not set
    from_env('FLOAT_VAR', 1.0)  # Value cast to float, or 1.0 if not set
    from_env('TRUE_VAR', bool)  # True if value is '1', 'true', 'yes', or 'on'
    from_env('TRUE_VAR', True)  # True if value is '1', 'true', 'yes', 'on', or not set
    from_env('TEST_JSON', loads)  # JSON string is cast to Python list or dict
pkhelper 0.0.36
A module for some common things
License: MIT

# [Pkhelper](https://pk-628996.github.io/pkhelper)
Just something to get my work done<br><br><br>
![PyPI - Downloads](https://img.shields.io/pypi/dm/pkhelper)
## Installation
```sh
~$ pip install pkhelper
```
#### Can download direct link from Command Line.
  <br>**Usage:**<br>
```bash
~$ pkhelper --ddl your direct link
```

#### Can download gdrive files from command line.
<br>**Usage:**<br>
```bash 
~$ pkhelper --gdrive your link
```
<br><br>

You can also use it in script.<br>
```python
from pkhelper import gdrivedownload
file=gdrivedownload(url)
```

As Simple as this<br>
```python
from pkhelper import direct_dl
file=direct_dl(url)
```
As  simple as this.
```python
from pkhelper import direct_dl_async as ddl_a
file=ddl_a(url)
```
As Simple as this.
<br>
You can run bash commands in python and get output
```python
from pkhelper import bash
output=bash("ffmpeg")
```
If you want async bash command then

```python
from pkhelper import bash_async
output=await bash_async("ffmpeg")
```
You can generate direct download links of all branches of a public github repo
```python
from pkhelper import repo_ddl_link_gen
ddl_list=repo_ddl_link_gen("repository link")
```
To upload to gofile
```python
from pkhelper import *
json_text,download_page=await gofi_uploader(file)
print(download_page)
```