Skip to main content

Standalone Loader class for simplification of loading configurations from YAML, JSON, SQL or TXT files.

Project description

GitHub GitHub Workflow Status (with branch) Coverage PyPI - Downloads

Introduction

Standalone Loader class simplifies loading of content from files .yaml, .json, .sql, and .txt.

Quick Start

# import the Loader class
from surquest.utils.loader import Loader

# load a yaml file
config_yaml = Loader.load(path="./path/to/config.yaml")
# alternatively load of yaml file
config_yaml = Loader.load_yaml(path="./path/to/config.yaml")

# load a json file
config_json = Loader.load(path="./path/to/config.json")
# alternatively load of json file
config_json = Loader.load_json(path="./path/to/config.json")

# load a sql file
config_sql = Loader.load(path="./path/to/config.sql")
# alternatively load of sql file
config_sql = Loader.load_sql(path="./path/to/config.sql")

Local development

You are more than welcome to contribute to this project. To make your start easier we have prepared a docker image with all the necessary tools to run it as interpreter for Pycharm or to run tests.

Build docker image

docker build `
     --tag surquest/utils/loader `
     --file package.base.dockerfile `
     --target test .

Run tests

docker run --rm -it `
 -v "${pwd}:/opt/project" `
 -w "/opt/project/test" `
 surquest/utils/loader pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

surquest_utils_loader-0.0.1rc3.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

surquest_utils_loader-0.0.1rc3-py2.py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page