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)
Result file (Config.txt):
min_t = int(25)
max_t = int(35)
arr = list([45, 'hello', 81.5])
Optional options:
file: File name can be specified
mode: "w" - write, "a" - append
save_types: default - True
save_names: default - 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:
run_mode: default - True
Allows you to run (copy namespace) values from the library and continue working with them in the executable.
return_only_names: default - False
return_only_values: default - 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
Built Distribution
File details
Details for the file PyFastConfig-1.0.tar.gz
.
File metadata
- Download URL: PyFastConfig-1.0.tar.gz
- Upload date:
- Size: 2.8 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 | 81b11164f57f85de301a5bd2c818b9b9f2e408a7b868f090d61477ae8c6a07c7 |
|
MD5 | 011c8299021e412dd6699531741e6646 |
|
BLAKE2b-256 | eb6c2a0260c652aacb6b87f3d8c5c4c8025b50b4f1eabbbd9b97d4baf7dfabd9 |
File details
Details for the file PyFastConfig-1.0-py3-none-any.whl
.
File metadata
- Download URL: PyFastConfig-1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 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 | 5fe4ea66b839af6928938104235c61c4eee2072525b21f40c85190510e9c97d5 |
|
MD5 | c0ca0a91afdfcd83d913f19eca4c82df |
|
BLAKE2b-256 | 3944cb30fd6d850eb8b388d0c9c9e455ac76a0e2beaf2b11184d2c384d75b940 |