semvec/pypi-packages huggingface dataset:
py-json-config 0.1.4
JSONConfig was created to use .json files as configs
Requires Python: >3.5

# JSONConfig

### JSONConfig was created to use .json files as configs

### You can create own functions to get values from the config and update values

## How can i use it?

*Use this command to install the module*
```console
$ > pip3 install py_json_config
```

## Simple tutorial

*We are going to create some `Config` to add and get admins*

#### Create `config.json` file in the root directory with content like this
```json
{
    "admins": []
}
```

#### Import the module into your main .py file
```python
import py_json_config
```

#### Then you need to create some class with extend by the module
```python 
class Config(py_json_config.JSONConfig):
    def get_admins(self):
        return self.get_value('admins') 

    def add_admin(self, admin):
        admins = self.get_admins()
        admins.append(admin)
        self.set_value('admins', admins)
```

#### That\`s it! Now let`s test it

```python
config = Config('.config.json')

config.get_admins() # []

config.add_admin(123)

config.get_admins() # [123]
```

#### Now you can create own functions but you don`t know a main feature

##### To get or update values you need to point the `path`, but if u have a complex structure you can use the "dot" operator like this:

```python

# the structure 
# 
# {
#     "main": {
#         "sub_main": {
#             "admins": []
#         }
#     }
# }

class Config(py_json_config.JSONConfig):
    def get_admins(self):
        return self.get_value('main.sub_main.admins') 

    def add_admin(self, admin):
        admins = self.get_admins()
        admins.append(admin)
        self.set_value('main.sub_main.admins', admins)
```

## Ther are also others functions here:

### `self._get_scheme`
get data as dict of .json config

### `self._save_scheme`
save data into .json config

### `self.set_value`
update value of .json config

### `self.get_value`
get value of .json config
inpt 0.0.5
To help you make inputs of different types in a more convenient manner
Requires Python: >=3.5

### What is this package for?

This package is to simplify the user to use the input function with different data types. For example, we can simplify this:

```
x = int(input("please insert a number"))
```

to

```
x = inpt.i(int,"please insert a number")
```

### How to install it?

You can type this in the terminal or command prompt to install this package:

```
pip install inpt
```

### Minumum requirement
python 3.5

### Current version

0.0.5
### How to use this version

To use this version, you will first need to import it like this:

```
from inpt import inpt
```

The format for the library and parameters is like this:

```
inpt.i(data_type, text for input)
```

Let's say we want to have a string input that wants the user to input their name. We can do it like this:

```
from inpt import inpt
c = inpt.i(str,"What is your name?")
```

The output will be:


What is your name?<br>
&lt;Insert a string here and press enter&gt;

### This version has to offer:

Automatic one line space after the input text