
Research
/Security News
Intercom’s npm Package Compromised in Ongoing Mini Shai-Hulud Worm Attack
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.
folder-manager
Advanced tools
A simple folder management library designed to manage folders and files. It provides functionalities to create, list, count, and delete files and folders, making it a versatile tool for file management. The package is designed to be OS-independent, ensuring compatibility with both Windows and Unix-based systems.
folder_manager is a Python package designed to manage folders and files. It provides functionalities to create, list, count, and delete files and folders, making it a versatile tool for file management. The package is designed to be OS-independent, ensuring compatibility with both Windows and Unix-based systems.
Install the package via PyPI using pip:
pip install folder_manager
To use the folder_manager package, import it into your Python script:
from folder_manager import Folder
To create an instance of the Folder class, provide the path to the folder you want to manage.
folder = Folder("/path/to/folder")
Create a Folder:
folder = Folder("/path/to/folder")
try:
result = folder.create_folder()
print(result) # Returns True if the folder was created successfully
except FolderError as e:
print(e)
List Files in a Folder:
folder = Folder("/path/to/folder")
try:
files = folder.list_files()
print(files) # Returns a list of filenames in the folder
except FolderError as e:
print(e)
Count Files in a Folder:
folder = Folder("/path/to/folder")
try:
file_count = folder.count_files()
print(f"Number of files: {file_count}") # Returns the number of files in the folder
except FolderError as e:
print(e)
List Files with Specific Extension in a Folder:
folder = Folder("/path/to/folder")
extension = "txt"
try:
files_with_extension = folder.list_files_with_extension(extension)
print(f"Files with extension .{extension}: {files_with_extension}") # Returns a list of filenames with the specified extension
except FolderError as e:
print(e)
Count Files with Specific Extension in a Folder:
folder = Folder("/path/to/folder")
extension = "txt"
try:
file_count_with_extension = folder.count_files_with_extension(extension)
print(f"Number of files with extension .{extension}: {file_count_with_extension}") # Returns the number of files with the specified extension
except FolderError as e:
print(e)
Create a File:
folder = Folder("/path/to/folder")
try:
result = folder.create_file("file.txt", "Hello, World!")
print(result) # Returns True if the file was created successfully
except FolderError as e:
print(e)
Delete a File:
folder = Folder("/path/to/folder")
try:
result = folder.delete_file("file.txt")
print(result) # Returns True if the file was deleted successfully
except FolderError as e:
print(e)
Delete a Folder:
folder = Folder("/path/to/folder")
try:
result = folder.delete_folder()
print(result) # Returns True if the folder was deleted successfully
except FolderError as e:
print(e)
Check if a Folder Exists:
folder = Folder("/path/to/folder")
if folder.folder_exists():
print("Folder exists.")
else:
print("Folder does not exist.")
Check if a File Exists:
folder = Folder("/path/to/folder")
if folder.file_exists("file.txt"):
print("File exists.")
else:
print("File does not exist.")
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
FAQs
A simple folder management library designed to manage folders and files. It provides functionalities to create, list, count, and delete files and folders, making it a versatile tool for file management. The package is designed to be OS-independent, ensuring compatibility with both Windows and Unix-based systems.
We found that folder-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.

Research
Socket detected a malicious supply chain attack on PyPI package lightning versions 2.6.2 and 2.6.3, which execute credential-stealing malware on import.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.