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
Release history Release notifications | RSS feed
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 details)
Built Distribution
File details
Details for the file PyFastConfig-1.1.tar.gz
.
File metadata
- Download URL: PyFastConfig-1.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c9e6b0d81a74c15ebbd5ef2eb7ae135a5a22ec073ad6214a233819dc1373f66 |
|
MD5 | 17650cf97ebb738c8d7e0a497abc4650 |
|
BLAKE2b-256 | ee6e3080df40fe5d39c74f4df74a3887177a57dc78341eae9755f264fc660599 |
File details
Details for the file PyFastConfig-1.1-py3-none-any.whl
.
File metadata
- Download URL: PyFastConfig-1.1-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be1ef241ea7e9edefed9f444b3927096ae933811d74361f67ec269e15243325a |
|
MD5 | 256f0dcf6abdd925bb758297617a8590 |
|
BLAKE2b-256 | d489d121509e55f7e38e6112e3ee89c2dbad3c0b507b4939a30262806a1e8003 |