You are on page 1of 9

P K TECHNICAL CAMPUS, CHAKAN

A MICRO-PROJECT REPORT
ON
“File Organization”

SUBMITTED BY
AVISHKAR KULKARNI

Class: Third Year Diploma Enrollment no:221660159

UNDER GUIDANCE
Prof. Tejashri Patil
P K TECHNICAL CAMPUS, CHAKAN
Department of Diploma computer Engineering
2023-2024

CERTIFICATE
Certified that the micro-project work entitled
“File Organization”
SUBMITTED BY
Avishkar Kulkarni
The report has been approved as it satisfies the academic
requirements in respect of micro-project work prescribed for
the course.

__________________ ________________
Prof. Tejashri Patil HOD
(under guidance)
INTRODCTION
In the ever-expanding digital landscape, the proliferation of data has presented
a formidable challenge: how to maintain order and accessibility within our
digital repositories. The File Organization Microproject addresses this challenge
head-on, offering a tailored solution in the form of a Python script designed to
transform the way we manage and navigate our digital assets.
In a world where documents, images, videos, and diverse file formats coalesce
into a digital mosaic, the need for efficient file organization becomes
increasingly apparent. Disorganization within our digital spaces not only
impedes our ability to retrieve information promptly but also poses risks to
data security. The File Organization Microproject is crafted with the goal of
simplifying and enhancing the file organization process, providing users with a
dynamic tool to navigate the complexities of digital data.
This microproject is grounded in the recognition that file organization is not
merely a practical concern but a fundamental pillar supporting productivity,
collaboration, and the preservation of data integrity. A well-organized file
system facilitates efficient information retrieval, reduces redundancy, and
safeguards crucial files. With these considerations in mind, the File
Organization Microproject strives to empower users by introducing a tool that
streamlines the management of digital assets, fostering a more structured and
efficient digital workflow.
The essence of this microproject lies in the development of a Python script.
This script is meticulously designed to automate the organization of files within
a designated directory, eliminating the need for manual intervention. By
categorizing files based on their types, such as images, documents, and videos,
the script aims to optimize the overall structure of directories, contributing to a
more intuitive and streamlined digital workspace.
User-friendliness is a paramount consideration in the design of the File
Organization Microproject. Through interactive prompts, the script engages
users by prompting them to input the directory path, ensuring accessibility for
users with varying technical backgrounds. Furthermore, the script provides
customization options, allowing users to tailor the tool to their unique needs.
This flexibility ensures that the microproject aligns seamlessly with the diverse
requirements of its users.
OBJECTIVE
1. Automation of File Organization:
Develop a Python script capable of automating the organization of
files within a specified directory. The script should minimize manual
intervention, streamlining the process of file categorization.
2. Categorization Based on File Types:
Implement an intelligent categorization system within the script. Files
will be sorted into distinct folders based on their types, such as
images, documents, and videos, contributing to a more organized
directory structure.
3. Enhancement of Directory Structure:
Optimize the overall structure of directories by introducing purpose-
specific subfolders. This enhancement aims to improve file retrieval
efficiency and foster a more intuitive digital workspace.
4. User-Friendly Interaction:
Prioritize a user-friendly experience by incorporating interactive
prompts into the script. Users should be prompted to input the
directory path, ensuring accessibility and ease of use for individuals
with varying technical backgrounds.

These objectives collectively define the core functionalities and goals


of the File Organization Microproject. Through the attainment of
these objectives, the project endeavors to provide users with an
efficient, customizable, and user-friendly tool for managing their
digital files.
OPREACTION
1. User Input Interaction:
The script engages users by prompting them to input the directory
path they wish to organize. This ensures a personalized and user-
friendly experience, allowing users to specify the target directory for
file organization.
2. File Categorization:
Leveraging the capabilities of Python, the script systematically
categorizes files within the specified directory. Each file is intelligently
sorted into designated subfolders based on its type, such as images,
documents, or videos.
3. Report Generation (Optional):
As an additional feature, the script may include an optional report
generation function. This function could produce a detailed report
summarizing the file organization process. The report may include
essential details such as the date and time of organization, along with
a log of moved files.
4. Customization Options:
The script provides customization options, allowing users to tailor the
tool according to their specific needs. Users can potentially modify
file type categories, add new categorization criteria, or adjust the
overall organization logic as required.
These operational aspects collectively define how the File
Organization Microproject interacts with users, categorizes files,
generates optional reports, and allows for customization. The goal is
to provide a flexible and adaptable tool that suits a variety of user
preferences and organizational requirements.
CODE

import os
import shutil

def organize_files(directory_path):
# Create directories if not exist
categories = {"Images": [".png", ".jpg", ".jpeg", ".gif"],
"Documents": [".pdf", ".docx", ".txt"],
"Videos": [".mp4", ".avi", ".mkv"]}

for category in categories:


category_path = os.path.join(directory_path, category)
os.makedirs(category_path, exist_ok=True)

files = os.listdir(directory_path)

for file in files:


file_path = os.path.join(directory_path, file)

for category, extensions in categories.items():


if any(file.lower().endswith(extension) for extension in extensions):
destination_path = os.path.join(directory_path, category, file)
shutil.move(file_path, destination_path)
print(f"Moved {file} to {category} folder.")

user_directory = input("Enter the path of the directory to organize: ")

organize_files(user_directory)
DIRECTORY BEFORE CODE RUNNING

OUTPUT
DIRECTORY AFTER CODE RUNNING
Conclusion
The File Organization Microproject encapsulates a commitment to addressing
the challenges inherent in managing the expanding landscape of digital files.
Through the development of a Python script, this project endeavors to
streamline and redefine the way users interact with their digital assets.
By combining automation, intelligent categorization, and user interaction, the
microproject aims to provide a versatile tool that not only enhances the
organization of files within a directory but also empowers users to navigate
their digital workspaces more efficiently.
In essence, the File Organization Microproject aspires to be more than a
solution; it is a testament to the continuous pursuit of innovative approaches
to simplify the complexities of digital file management. The project stands
ready to contribute to a more organized, efficient, and empowering digital
workflow for users of varying technical backgrounds.
As the digital landscape continues to evolve, the File Organization Microproject
represents a small yet impactful step towards fostering a structured and user-
centric approach to file organization. The journey does not end here but
extends an invitation for users to explore, customize, and optimize their digital
spaces with newfound ease and efficiency.

You might also like