Skip to main content

Fast creation and reading of files on Python with configurations.

Project description

PyFastConfig

Fast creation and reading of files on Python with configurations.


Usage example:
import PyFastConfig as fc

Save

#Declare any values
min_t = 25
max_t = 35
arr = [45, 'hello', 81.5]

Quick save:

array = [min_t, max_t, arr]
fc.save(array)

# or just:
# fc.save([any values])

Result file (Config.txt):

min_t = int(25)
max_t = int(35)
arr = list([45, 'hello', 81.5])

Optional options:

Name Accepts values Default
array Dataset Required
file File name "config.txt"
mode Write modes:
"w" - rewrite
"a" - append
"w"
save_types True/False True
save_names True/False True
fc.save(array, file="config.txt", mode="w", save_types=True, save_names=True)


Load

Quick load:

#import values (only if run_mode is not False)
#With copy namespace
exec(fc.load("config.txt"))

Optional options:

Name Explanation Default
file File name Required
run_mode Allows you to run (copy namespace) values
from the library and continue working
with them in the executable.
True
return_only_names True/False False
return_only_values True/False False
fc.load(file, run_mode=True, return_only_names=False, return_only_values=False)

If you changed the parameters for saving additional information (save_types and save_names) in the SAVE function, you must disable run_mode when reading such a file.

#Returns an array (use if you have disabled any of the following options: save_types or save_names)
print(fc.load("config.txt", run_mode=False))

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

PyFastConfig-1.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

PyFastConfig-1.1-py3-none-any.whl (3.3 kB view hashes)

Uploaded 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