Input/output functions.
Author: Parker Hicks Date: 2025-04
Last updated: 2026-04-10 by Parker Hicks
checkdir(path, is_file=False)
¶
Check if directory exists. If not, creates it.
| Parameters: |
|
|---|
| Returns: |
|
|---|
load_bson(file, **kwargs)
¶
Load dictionary from compressed BSON.
| Parameters: |
|
|---|
load_json(file, encoding='utf-8')
¶
Load dictionary from JSON.
| Parameters: |
|
|---|
load_txt(file, cols=1, delimiter=',', encoding='utf-8')
¶
Loads a .txt file.
| Parameters: |
|
|---|
Returns: An list of strings.
load_txt_sections(file, delimiter, encoding='utf-8')
¶
Load a .txt file in sections.
| Parameters: |
|
|---|
| Returns: |
|
|---|
load_yaml(file, encoding='utf-8')
¶
Load a YAML dictionary.
| Parameters: |
|
|---|
save_bson(data, file, **kwargs)
¶
Save dictionary to compressed BSON.
| Parameters: |
|
|---|
save_json(data, file, encoding='utf-8')
¶
Saves a dictionary to file in JSON format.
| Parameters: |
|
|---|
save_txt(data, file, delimiter=None, encoding='utf-8')
¶
Save an array or list to a .txt file.
| Parameters: |
|
|---|
save_plain_text(data, file, encoding='utf-8')
¶
Save a single string to a .txt file.
| Parameters: |
|
|---|