semvec/pypi-packages huggingface dataset:
config-bat 0.4.1
A package to share config accross modules

# Introduction

config_bat is a package helps developers easily config the app using config.json file.

# Getting Started

1. Installation process:

```
pip install config_bat
```

2. Usage:

Getting config: if there is no config in config.json, return default_value

```python
from config_bat import config
your_config = config.get("config_key",default_value)

# Get nested config data
# You can get nested dict data for cases that you have many value spread out for the same master key
# Example dict: two mongodb master key config, but only username is different from dev and prod
# The "common" key is readed by default.
# If the config apears both in "common" and other stages, the stage config will be used.

nestedConfig = {
  "common":{
    "mongodb":{
      "host":"localhost"
    },
    "development":{
      "mongodb":{
        "username":"test"
      }
    }
  }
}

host = config.get("mongodb",default_value)["host"] # Return KeyError
host = config.get("mongodb.host",default_value) # Return "test"

```

The default_value is optional, if default_value is not provided, the function will return None.

3. API references:

**Environment variables:**

The package behavior can be overrided by export these environment variables:

CONFIG_PATH: the path to config file. Default: "/config/config.json".

APP_STAGE: define in config.json.

**config.json file:**

The first level key is the stage of the app. You can define the config nested in those keys.

The "common" key is readed by default. If the config apears both in "common" and other stages, the stage config will be used.

If you want to use environmen variables, place a "\$" character before you variable name.

Example of config.json:

```
{
  "common": {
    // Environmental variables
    "JWT_SECRET": "$SEC_KEY",
    "port": 8080
  },
  "development": {
   // Nested config
    "mongodb": {
      "host": "localhost",
      "user": "dev_user",
      "pass": "dev_pass"
    }
  },
  "production": {
    "mongodb": {
      "host": "your.domain",
      "user": "prod_user",
      "pass": "prod_pass"
    }
  }
}
```
s3manager 1.4
This packages helps to upload, download zip of multiple files, delete file from s3.

# Python Script to upload files to AWS

This script is a wrapper over boto3 which makes developer easy to upload files to AWS

## Getting Started

Steps to get started:-
1. pip install s3manager

Steps to Use:-


```
from s3manager import S3manager
s3_object_manager = S3manager(bucket_name="bucketname", access_key=<access_key>, access_secret=<access_secret>)
```
To upload file to s3
```
s3_object_manager.upload_file(file_name=<file_name>, filepath=<filepath>, acl='public-read')
```
In response result will have url to the file uploaded and the key name of file in bucket

to delete the object
```
s3_object_manager.delete_file(key)
```

to download the zip of multiple files
```python
s3_object_manager.download_files_in_zip(['fileobjkey1', 'fileobjkey2'],'nameofnewzip')
```
this will create a zip file in current directory and will return zip file name
### Prerequisites

boto3 should be installed



## Built With

* [python3]
* [boto3]




## Authors

* **Anshul Gupta** - *Initial work* - [AwsS3Manager]


## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details