Skip to content

The file_manager package is meant to edit and modify the user's local computer files. This includes creating directories and files.

Notifications You must be signed in to change notification settings

vrabb-gh/file_manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

File Manager

file_manager. A Python package built by ImhimLM.

Table of Contents

The file_manager package is meant to edit and modify the user's local computer files. This includes creating directories and files. The package is very simple to use and understand as it has basic functions.

How to Import and Use

Download the folder and place it into your Python project, then use the following:

from file_manager import file_manager as files

Then use files. before calling any function, here's an example:

from file_manager import file_manager as files

files.createFile(path)

Features

  • Creating, renaming, removing, cloning and moving files and directories
  • Find the file size of files and directories
  • Reading and writing in files

Functions

Files

  • createFile(path), Creates a file in a specified directory. path is replaced with the desired path
  • removeFile(path), Removes a file (Warning: Files skip the trash bin!). path is replaced with the desired path
  • renameFile(path, name), Renames a file. path is replaced with the desired path, name is replaced with the desired name
  • copyFile(path, destination), Copies a file to another directory. path is replaced with the desired path, destination is replaced with the desired destination
  • moveFile(path, destination), Moves a file to another directory. path is replaced with the desired path, destination is replaced with the desired destination
  • writeFile(path, text, line = None, writeType = 'add'), Writes in a text file. path is replaced with the desired path, text is replaced with any string, line (optional) defines where the text is written, writeType defines the way it writes (add adds text at the bottom, insert inserts text in the specified line, replace replaces the specified line with text)
  • readFile(path, line = None), Reads a text file. path is replaced with the desired path, line (optional) defines what line should be read
  • clearLine(path, line), Clears a line in the specified text file. path is replaced with the desired path, line defines what line should be erased
  • clearFileContent(path), Clears a text file's content. path is replaced with the desired path
  • getFileSize(path, formatted = False), Gives the file size of the specified file. path is replaced with the desired path, formatted (optional) formats the result (if formatted is set to True)
  • findFile(path), Says if a file exists or not, path is replaced with the desired path
  • getDirectory(), Says the path of the current file (That ran the function)

Folders

  • createDirectory(path), Creates a directory. path is replaced with the desired path
  • removeDirectory(path), Removes a directory and its contents (Warning: The directory will skip the trash bin!). path is replaced with the desired path
  • renameDirectory(path, name), Renames a directory. path is replaced with the desired path, name is replaced with the desired name
  • copyDirectory(path, destination), Copies a directory to another directory. path is replaced with the desired path, destination is replaced with the desired destination
  • copyDirectoryContent(path, destination), Copies a directory's content to another directory. path is replaced with the desired path, destination is replaced with the desired destination
  • getDirectoryContent(path), Reads the content of a directory. path is replaced with the desired path
  • clearDirectoryContent(path, limit = 1000000), Clears the content of a directory. path is replaced with the desired path, limit (optional) defines the maximum amount of files that can be deleted
  • countFiles(file, path = '/'), Counts the amount of files (with a specific name) in a directory. file is replaced with the file name, path (optional) defines the path for where to look
  • countAllFiles(), Counts the total amount of files in the user's computer

Disk Image

  • diskStorageUsed(formatted = False), Says the amount of storage used on the user's computer. formatted (optional) formats the result (if formatted is set to True)
  • diskStorageFree(formatted = False), Says the amount of free storage on the user's computer. formatted (optional) formats the result (if formatted is set to True)
  • diskStorageTotal(formatted = False), Says the total storage on the user's computer. formatted (optional) formats the result (if formatted is set to True)

Credits

Made by ImhimLM.

About

The file_manager package is meant to edit and modify the user's local computer files. This includes creating directories and files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages