Stop writing code for simple read and write functions in Python.
Wread simplifies common actions of pickle, txt, and csv, making life just a little easier for noobs like me and anyone else who wants to write a few lines less of code.
OS X & Linux:
Coming soon
pip install wread
Wread includes three types of function: pickle, txt, and csv. Import all with from wread import *.
from wread import *
----
# Append a line to a text file, creates if doesnt exist.
append_txt_line(input_file, content)
----
# Checks if file exists, if not, writes content to new text file.
write_2_txt(input_file, content)
from wread import *
----
# Saves variable as pickle file.
save_pickle(output_file, variable)
----
# Loads pickle file variable
read_pickle(input_file)
from wread import *
----
# Load csv and output row content as lists in list of rows.
csv_list_rows(input_file)
----
# Load csv and output individual row as list.
def get_csv_row(input_file, line_number)
----
# Appends items in list to new line of csv file. Makes file if does't exist.
csv_append(input_file, input_list)
All dependent modules are already included in the standard library 😄
- 0.0.1
- Initial release (still a work in progress)
NPM – email me
Distributed under the MIT license. See LICENSE for more information.
If you would like to contribute or have any suggestions on how to improve, just send me a private message!