Simple Python File Manager

Overview

Simple Python File Manager

This repository contains a Python script that lets you relocate files automatically.

How to use ?

Clone the repository:

Enter your desired folder and execute this command:
git clone https://github.com/aime-risson/pyFileManager.git

Install requirements:

Enter your pyFileManger folder and execute this command:
pip3 install watchdog

Set up the manager:

In the same directory create a new fille called manager.py
After that we will need to import our fileManager handler: MyHandler

from fileManager import MyHandler

handler = MyHandler()

Once imported we will need to create new events.
Events are used to listen to a specific folder and to relocate new files to a folder if their extensions match the desired ones.
For example:

listeningFolder = "Path/to/watched/folder" 
relocateFolder = "Path/to/desired/folder" 
extensionsToInclude = (".yourExtensionInLowerCase", ".jpg", ".png") #Tuple of strings !!!

handler.newEvent(listeningFolder, relocateFolder, extensionsToInclude)

You can use multiple events at the same time to "listen" to other folders, extensions ect...

Launch manager:

To launch manager juste add this to your code:

handler.start()

Full code:

from fileManager import MyHandler
handler = MyHandler()

listeningFolder = "Path/to/watched/folder" 
relocateFolder = "Path/to/desired/folder" 
extensionsToInclude = (".yourExtensionInLowerCase", ".jpg", ".png") #Tuple of strings !!!

handler.newEvent(listeningFolder, relocateFolder, extensionsToInclude)
handler.start()
You might also like...
PaddingZip - a tool that you can craft a zip file that contains the padding characters between the file content.
PaddingZip - a tool that you can craft a zip file that contains the padding characters between the file content.

PaddingZip - a tool that you can craft a zip file that contains the padding characters between the file content.

Extract longest transcript or longest CDS transcript from GTF annotation file or gencode transcripts fasta file.

Extract longest transcript or longest CDS transcript from GTF annotation file or gencode transcripts fasta file.

Two scripts help you to convert csv file to md file by template

Two scripts help you to convert csv file to md file by template. One help you generate multiple md files with different filenames from the first colume of csv file. Another can generate one md file with several blocks.

A simple file sharing tool written in python
A simple file sharing tool written in python

Share it A simple file sharing tool written in python Installation If you are using Windows os you can directly Run .exe file -- download If you are

This simple python script pcopy reads a list of file names and copies them to a separate folder

pCopy This simple python script pcopy reads a list of file names and copies them to a separate folder. Pre-requisites Python 3 (ver. 3.6) How to use

A simple bulk file renamer, written in python.

Python File Editor A simple bulk file renamer, written in python. There are two functions, the bulk rename and the bulk file extention change. Bulk Fi

A simple file module for creating, editing and saving files.

A simple file module for creating, editing and saving files.

Simple, convenient and cross-platform file date changing library. 📝📅

Simple, convenient and cross-platform file date changing library.

Python Fstab Generator is a small Python script to write and generate /etc/fstab files based on yaml file on Unix-like systems.

PyFstab Generator PyFstab Generator is a small Python script to write and generate /etc/fstab files based on yaml file on Unix-like systems. NOTE : Th

Comments
  • (Suggestion) Specify Dependencies in requirements.txt

    (Suggestion) Specify Dependencies in requirements.txt

    For any additional packages that are needed it is best to use a requirements.txt file or a setup.py file.

    At current state I would start with a requirements.txt that looks something like this:

    requirements.txt

    watchdog # Used to check for any changes in the folder
    

    Doing so gives you a few advantages:

    1. It is a standard in the python community (most people use one or the other)
    2. If you change any dependencies you just change it in the file, but the steps stay the same ( using pip install -r requirements.txt or sudo pip3 install -r requirements.txt (linux/macos))
    3. If at some point you ever get into CI/CD, these are the standards they will look for

    P.S don't forget to update your readme after the change

    If you decide to use a setup.py file you can check out this template I made.

    opened by Descent098 0
Owner
Aimé Risson
17 Years Old but having fun 😀
Aimé Risson
Extract an archive file (zip file or tar file) stored on AWS S3

S3 Extract Extract an archive file (zip file or tar file) stored on AWS S3. Details Downloads archive from S3 into memory, then extract and re-upload

Evan 1 Dec 14, 2021
A simple Python code that takes input from a csv file and makes it into a vcf file.

Contacts-Maker A simple Python code that takes input from a csv file and makes it into a vcf file. Imagine a college or a large community where each y

null 1 Feb 13, 2022
A python script to convert an ucompressed Gnucash XML file to a text file for Ledger and hledger.

README 1 gnucash2ledger gnucash2ledger is a Python script based on the Github Gist by nonducor (nonducor/gcash2ledger.py). This Python script will tak

Thomas Freeman 0 Jan 28, 2022
Python package to read and display segregated file names present in a directory based on type of the file

tpyfilestructure Python package to read and display segregated file names present in a directory based on type of the file. Installation You can insta

Tharun Kumar T 2 Nov 28, 2021
gitfs is a FUSE file system that fully integrates with git - Version controlled file system

gitfs is a FUSE file system that fully integrates with git. You can mount a remote repository's branch locally, and any subsequent changes made to the files will be automatically committed to the remote.

Presslabs 2.3k Jan 8, 2023
This is a file deletion program that asks you for an extension of a file (.mp3, .pdf, .docx, etc.) to delete all of the files in a dir that have that extension.

FileBulk This is a file deletion program that asks you for an extension of a file (.mp3, .pdf, .docx, etc.) to delete all of the files in a dir that h

Enoc Mena 1 Jun 26, 2022
Search for files under the specified directory. Extract the file name and file path and import them as data.

Search for files under the specified directory. Extract the file name and file path and import them as data. Based on that, search for the file, select it and open it.

G-jon FujiYama 2 Jan 10, 2022
Small-File-Explorer - I coded a small file explorer with several options

Petit explorateur de fichier / Small file explorer Pour la première option (création de répertoire) / For the first option (creation of a directory) e

Xerox 1 Jan 3, 2022
Pti-file-format - Reverse engineering the Polyend Tracker instrument file format

pti-file-format Reverse engineering the Polyend Tracker instrument file format.

Jaap Roes 14 Dec 30, 2022
Generates a clean .txt file of contents of a 3 lined csv file

Generates a clean .txt file of contents of a 3 lined csv file. File contents is the .gml file of some function which stores the contents of the csv as a map.

Alex Eckardt 1 Jan 9, 2022