Skip to main content

SimpleFileEdit

SimpleFileEdit is a Python package designed to simplify file and folder operations. With this package, you can create, edit, and rename files and folders effortlessly.

Installation

To install the package (once published), use pip:

pip install SimpleFileEdit

Features

1. NewFile

Create a new file with a specified name, type, and location.

Arguments:

  • filename (str): The name of the file (without extension).
  • path (str, optional): The directory path to create the file in. Defaults to the current working directory.
  • filetype (str, optional): The file extension/type. Defaults to "txt".

Example:

from SimpleFileEdit import NewFile
NewFile("hello world", filetype="json")
# Creates "hello world.json" in the current working directory.

2. EditFile

Edit an existing file by adding new content or overwriting it.

Arguments:

  • filename (str): The name of the file to edit (without extension).
  • content (str, optional): The content to write to the file. Defaults to a template message.
  • filetype (str, optional): The file extension/type. Defaults to "txt".
  • path (str, optional): The directory path of the file. Defaults to the current working directory.
  • mode (str, optional): The editing mode. Options are "add-to-end" or "overwrite". Defaults to "add-to-end".

Example:

from SimpleFileEdit import EditFile
EditFile("hello world", "Hello, World!", filetype="txt", path="/helloWorldFolder", mode="overwrite")
# Overwrites the content of "hello world.txt" in "/helloWorldFolder" with "Hello, World!".

3. EditFileName

Rename a file and optionally change its file type.

Arguments:

  • filename (str): The current name of the file (without extension).
  • filetype (str, optional): The current file type. Defaults to "txt".
  • newname (str): The new name for the file (without extension).
  • newfiletype (str, optional): The new file type. Defaults to the current file type.
  • path (str, optional): The directory path of the file. Defaults to the current working directory.

Example:

from SimpleFileEdit import EditFileName
EditFileName("hello world", "txt", "HELLO-WORLD", newfiletype="md", path="/helloWorldFolder")
# Renames "hello world.txt" to "HELLO-WORLD.md" in "/helloWorldFolder".

4. NewFolder

Create a new folder in the specified location.

Arguments:

  • foldername (str): The name of the folder to create.
  • path (str, optional): The directory path to create the folder in. Defaults to the current working directory.

Example:

from SimpleFileEdit import NewFolder
NewFolder("helloWorldFolder")
# Creates a folder named "helloWorldFolder" in the current working directory.

5. EditFolder

Rename an existing folder.

Arguments:

  • foldername (str): The current name of the folder.
  • newfoldername (str): The new name for the folder.
  • path (str, optional): The directory path of the folder. Defaults to the current working directory.

Example:

from SimpleFileEdit import EditFolder
EditFolder("helloWorldFolder", "helloworldFOLDER")
# Renames "helloWorldFolder" to "helloworldFOLDER" in the current working directory.

Example Usage

Here’s a complete example of how to use SimpleFileEdit:

from SimpleFileEdit import NewFile, EditFile, EditFileName, NewFolder, EditFolder

# Create a new folder
NewFolder("exampleFolder")

# Create a new file in the folder
NewFile("example", path="./exampleFolder", filetype="txt")

# Edit the file's content
EditFile("example", "This is new content.", filetype="txt", path="./exampleFolder", mode="overwrite")

# Rename the file
EditFileName("example", "txt", "new_example", path="./exampleFolder")

# Rename the folder
EditFolder("exampleFolder", "newExampleFolder")

Future Features (Planned)

  • File deletion functionality.
  • Folder deletion functionality.
  • Copying files and folders.
  • Enhanced error handling and logging.

Contributing

Contributions are welcome! To contribute:

  1. Fork this repository.
  2. Create a new branch (e.g., feature-new-functionality).
  3. Submit a pull request with a detailed description of your changes.

License

This project is licensed under the MIT License.


Author

Developed by BravestCheetah. For questions, feedback, or feature requests, feel free to reach out.

Metadata

Release files for SimpleFileEdit 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SimpleFileEdit 0.3.0
File Size Uploaded Provenance Actions
SimpleFileEdit-0.3.0.tar.gz 4.0 kB Without provenance Details for SimpleFileEdit-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for SimpleFileEdit 0.3.0
File Interpreter ABI Platform Actions
SimpleFileEdit-0.3.0-py3-none-any.whl Python 3 none any Details for SimpleFileEdit-0.3.0-py3-none-any.whl

Total release size: 8.4 kB

Release files / SimpleFileEdit-0.3.0.tar.gz

Download URL SimpleFileEdit-0.3.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
36926c8bb5e0a235c90be3ca07ad1424e0c2dbc4e9b17bf8770c8cfa5f3abb5a
BLAKE2b-256 checksum
How to use checksums
f33b29d6f685452eeef61b19e8a3b2966a6921556075a6533ce9c0c47b6c7203
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.4

Release files / SimpleFileEdit-0.3.0-py3-none-any.whl

Download URL SimpleFileEdit-0.3.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
144046aeb7c2dc5b7d28bcc19b5ca72013b51f660c69fb3882dc0cc60c97d617
BLAKE2b-256 checksum
How to use checksums
fe054488529bd353027dd23a6d562d3e20fd7e2e71ade9b5acd04619ea594dcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.4

Security for SimpleFileEdit 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page