Skip to content

BeereMgM/ezWrite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ezWrite

  • What is ezWrite? ezWrite is an package for Python, that lets you write, read and delete files with just some simple code!
  • For what do you need ezWrite? With ezWrite you can improve your coding speed very easily.
  • What will come in the future? ezWrite will get Multiple updates such as an ezEncrypt and ezDecrypt.

Stay Tuned!

Changelogs:

  • added ezJson
  • fixed some bugs with init file

Installation

pip install ezWrite

Examples of ezWrite

Write to a file:

from ezWrite import write_file
#Syntax: write_file(filename, content, path)
write_file('hello.txt', 'Hello World!')

Adding a path:

from ezWrite import write_file
#Syntax: write_file(filename, content, path)
write_file('hello.txt', 'Hello World', 'C:\\Users\\User\\Desktop')

Append to a file:

from ezWrite import append_file
#Syntax: append_file(filename, content, path)
append_file('hello.txt', 'Hello World')

Read file:

from ezWrite import read_file
#Syntax: read_file(filename, path, line)
output = read_file('hello.txt', 'C:\\Users\\User\\Desktop')
print(output)

Read specific line of file:

from ezWrite import read_file
#Syntax: read_file(filename, path, line)
output = read_file('hello.txt', 'C:\\Users\\User\\Desktop', 1)
print(output)

Read multiple lines:

from ezWrite import read_lines
#Syntax: read_lines(filename, path, fromLine, toLine)
output = read_lines('hello.txt', 'C:\\Users\\User\\Desktop', 1, 5)
print(output)

Delete a File:

from ezWrite import deleteFile
#Syntax: deleteFile(filename, path)
deleteFile('hello.txt', 'C:\\Users\\User\\Desktop')

Examples of ezJson

Write to a file:

from ezWrite import write_json
#Syntax: write_json(filename: str, content: str, path: str, sort_keys: bool)
write_json('hello', '{"hello": "world!"}', sort_keys=False)

Read from a json file:

from ezWrite import read_data
#Syntax: read_data(filename: str, key: str, path: str)
output = read_data('hello', 'hello')
print(output) #>>> world!
from ezWrite import read_dataset
#Syntax: read_dataset(filename: str, dataset: str, path: str)
output = read_dataset('hello', 'hello')
print(output) #>>> {"hello": "world!", "how": "are you?"}!
from ezWrite import read_whole_file
#Syntax: read_whole_file(filename: str, path: str)
output = read_whole_file('hello')
print(output) #>>> ["helloworld":{"hello": "world!", "how": "are you?"}]!

Delete from json file:

from ezWrite import delete_data
#Syntax: delete_data(filename: str, key: str, path: str)
delete_data('hello', 'hello')

If you face some bugs or problems feel free to open an issue or join my discord!

Connect with me:

website website

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages