Skip to main content

Easytexts: Simplified text management for quick projects

Project description

EasyText: A Simple File Handler for Python

Install EasyText using pip:

pip install easytext

Usage:

Import the EasyText module:

from easytext import *

Explore the available functions: Writing and Appending:

append(location_and_name, text, log=False, newline=True): Appends text to a file, optionally adding a newline and logging the action. rewrite(location_and_name, text, log=False): Overwrites the entire content of a file with new text, optionally logging the action. create_if_doesnt_exist(location_and_name, text, log=False): Creates a new file and writes text to it, handling existing files gracefully, optionally logging the action. Reading:

read(location_and_name, log=False): Reads the entire content of a file and returns it as a string, optionally logging the action. Clearing and Checking:

clear(location_and_name, log=False): Empties the content of a file, optionally logging the action. is_clear(location_and_name, log=False): Checks if a file is empty, returning True if empty, False otherwise, optionally logging the result. Deleting:

delete(location_and_name): Deletes a file. Checking Existence:

does_exist(location_and_name): Checks if a file exists, returning True if exists, False otherwise. Examples

See the following examples for how to use EasyText:

[Write and append to a file][example_write_append] [Rewrite the content of a file][example_rewrite] [Create a new file][example_create] [Read the contents of a file][example_read] [Clear a file][example_clear] [Check if a file is empty][example_is_clear] [Delete a file][example_delete] [Check if a file exists][example_does_exist]

Disclaimer

While EasyText handles common errors and is suitable for learning and small projects, it’s not intended for critical or demanding projects due to its limited scope and testing.

Additional Notes

The log parameter allows you to control if certain actions are logged for debugging or tracking purposes. The newline parameter in append allows you to control whether a newline character is added before the appended text.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easytexts-0.2.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

easytexts-0.2.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file easytexts-0.2.0.tar.gz.

File metadata

  • Download URL: easytexts-0.2.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for easytexts-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8474f757ff275ec049c02145296f09d057e2ac284ffccd7d52bf200c47d0b391
MD5 bd83f4df0d9333b68e3883ae07daee25
BLAKE2b-256 c2b6fec381965fde39e6a0e206fbc6757c1abaac09e0339c5c141a597426b287

See more details on using hashes here.

File details

Details for the file easytexts-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: easytexts-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for easytexts-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afd8b68b8f3b9b61333530d87b14cf4f3d3ea3a53e18076d10bd8c58b62d2188
MD5 a3cd52b137e5ddae0294a924c52c1b29
BLAKE2b-256 995d88254427d7fd586d33c3a92e2625042636cf1c80b0b503365620a622c94e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page