simpleml.utils.configuration

Module to set a reference for the SimpleML home directory

Defaults to user’s home directory if no environment variable is set

example config file:

```

[path] home_directory = ~/.simpleml <– This details where all binaries are stored on the local disk. Only necessary if different than the default

[libcloud] <– This section is used for any persistable that specifies an apache-libcloud persistence location section = gcp-read-only <– The name of the heading for the cloud credentials.

In this example this line is the only value that needs to be changed to move from saving in GCP to, say, S3. No code would have to change whatsoever because the save location is “cloud” which does a lookup in the config

[onedrive] <— This section outlines an example authorization scheme with onedrive personal client_secret = aaaaaabbbbbbbbbcccccc <— Put your client secret here root_id = xxxxxyyyyyyzzzzzzzz <— Put the item id of the root filestore bucket here client_id = abcdefg-hijk-lmno-pqrs-tuvwxyz <— Put your client_id here scopes = onedrive.readwrite <— Mark the scopes here (reference the onedrive api for examples) redirect_uri = http://localhost:8000/example/callback <— Put the callback url here to return the auth token

[gcp-read-write] <— This section outlines an example for a read/write iam in GCP driver = GOOGLE_STORAGE <— Apache-libcloud driver used (can be any of the supported ones) connection_params = key,secret <— Which parameters in this section to pass to apache-libcloud key = read-write@iam.gserviceaccount.com <— The gcp iam account secret = ./gcp-read-write.json <— The token for that gcp account container = simpleml <— The gcp container (or “bucket”) that houses the files

[gcp-read-only] <— Duplicate example with a read only IAM – recommended practice to train with the

cloud section = gcp-read-write and deploy in production with read only access

driver = GOOGLE_STORAGE connection_params = key,secret key = read-only@iam.gserviceaccount.com secret = ./gcp-read-only.json container = simpleml

[s3] param = value –> normal key:value syntax. match these to however they are referenced later, examples: key = abc123 secret = superSecure region = us-east-1 something_specific_to_s3 = s3_parameter — Below are internally referenced SimpleML params — driver = S3 –> this must be the Apache Libcloud provider (https://github.com/apache/libcloud/blob/trunk/libcloud/storage/types.py) connection_params = key,secret,region,something_specific_to_s3 –> this determines the key: value params passed to the constructor (it can be different for each provider) path = simpleml/specific/root –> similar to disk based home directory, cloud home directory will start relative to here container = simpleml –> the cloud bucket or container name

[simpleml-database] <— Database credentials for the simpleml models

(used by specifying Database(configuration_section=’simpleml-database’))

database=SimpleML username=simpleml password=simpleml drivername=postgresql host=localhost port=5432

[app-database] <— Database credentials for application logs (used by

specifying Database(configuration_section=’app-database’))

database=APPLICATION_DB username=simpleml password=simpleml drivername=postgresql host=localhost port=5432

```

Module Contents

Functions

safe_makedirs(dir)

Attributes

CONFIG

CONFIGURATION_FILE

CONFIGURATION_FILE

CSV_DIRECTORY

FILESTORE_DIRECTORY

HDF5_DIRECTORY

JSON_DIRECTORY

LIBCLOUD_CONFIG_SECTION

LIBCLOUD_SECTION

LOGGER

ORC_DIRECTORY

PARQUET_DIRECTORY

PATH_SECTION

PICKLE_DIRECTORY

SIMPLEML_DIRECTORY

SYSTEM_TEMP_DIRECTORY

TENSORFLOW_SAVED_MODEL_DIRECTORY

__author__

simpleml.utils.configuration.CONFIG[source]
simpleml.utils.configuration.CONFIGURATION_FILE[source]
simpleml.utils.configuration.CONFIGURATION_FILE[source]
simpleml.utils.configuration.CSV_DIRECTORY = csv/[source]
simpleml.utils.configuration.FILESTORE_DIRECTORY[source]
simpleml.utils.configuration.HDF5_DIRECTORY = HDF5/[source]
simpleml.utils.configuration.JSON_DIRECTORY = json/[source]
simpleml.utils.configuration.LIBCLOUD_CONFIG_SECTION[source]
simpleml.utils.configuration.LIBCLOUD_SECTION = libcloud[source]
simpleml.utils.configuration.LOGGER[source]
simpleml.utils.configuration.ORC_DIRECTORY = orc/[source]
simpleml.utils.configuration.PARQUET_DIRECTORY = parquet/[source]
simpleml.utils.configuration.PATH_SECTION = path[source]
simpleml.utils.configuration.PICKLE_DIRECTORY = pickle/[source]
simpleml.utils.configuration.SIMPLEML_DIRECTORY[source]
simpleml.utils.configuration.SYSTEM_TEMP_DIRECTORY[source]
simpleml.utils.configuration.TENSORFLOW_SAVED_MODEL_DIRECTORY = saved_model/[source]
simpleml.utils.configuration.__author__ = Elisha Yadgaran[source]
simpleml.utils.configuration.safe_makedirs(dir)[source]