Skip to content

CantCode023/filelibrary

Repository files navigation

How to use filelibrary

  1. Install filelibrary package
pip install filelibrary
  1. You're done! Now all there is to do is read the documentation.

Documentation

  1. Load Package
from filelibrary import filelibrary

fileLibrary = filelibrary("path")
  1. Get files in path
files = fileLibrary.getFileList()
print(files) # prints every files in the specified path
  1. Get directories in path
dirs = fileLibrary.getDirList()
print(dirs) # prints every directories in the specified path
  1. Print all (prints files and directories)
fileLibrary.printAll()
  1. Read file
fileLibrary.openFile("fileName.extension")
# fileLibrary.openFile("test.txt")
  1. Write file
fileLibrary.writeFile("fileName.extension", "just a text here")
# fileLibrary.writeFile("test.txt", "just a text here")
  1. Read file as JSON
fileLibrary.openFileAsJson("fileName.extension")
# fileLibrary.openFileAsJson("test.json")
  1. Write file as JSON
fileLibrary.writeFileAsJson("fileName.extension", {"data": "here"})
# fileLibrary.writeFileAsJson("test.json", {"name": "John", "age": "30"})

Congratulations! You've finished the documentation. Explore the package and create awesome projects!

About

A python package for file handling.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages