From 705d2b94f6fd3093ec0721cb5344a4b6b1c535ba Mon Sep 17 00:00:00 2001 From: listyantidewi1 Date: Sat, 18 Apr 2026 23:13:51 +0700 Subject: [PATCH] feature updates --- README.md | 46 +++++- requirements.txt | 6 +- routes/convert_tools.py | 27 ++++ templates/tools/case_converter.html | 91 +++++++++++ templates/tools/hash_generator.html | 153 ++++++++++++++++++ templates/tools/json_yaml.html | 190 +++++++++++++++++++++++ templates/tools/lorem_ipsum.html | 92 +++++++++++ templates/tools/number_base.html | 65 ++++++++ templates/tools/password_generator.html | 85 ++++++++++ templates/tools/pomodoro.html | 134 ++++++++++++++++ templates/tools/regex_tester.html | 115 ++++++++++++++ templates/tools/slug_generator.html | 48 ++++++ templates/tools/text_diff.html | 98 ++++++++++++ templates/tools/timestamp_converter.html | 97 ++++++++++++ 14 files changed, 1239 insertions(+), 8 deletions(-) create mode 100644 templates/tools/case_converter.html create mode 100644 templates/tools/hash_generator.html create mode 100644 templates/tools/json_yaml.html create mode 100644 templates/tools/lorem_ipsum.html create mode 100644 templates/tools/number_base.html create mode 100644 templates/tools/password_generator.html create mode 100644 templates/tools/pomodoro.html create mode 100644 templates/tools/regex_tester.html create mode 100644 templates/tools/slug_generator.html create mode 100644 templates/tools/text_diff.html create mode 100644 templates/tools/timestamp_converter.html diff --git a/README.md b/README.md index f72789c..e6c5143 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Your Everyday Tools -A lightweight, self-hosted web app that bundles 33 everyday utilities into a single interface. Built with Python + Flask, zero JavaScript frameworks, and minimal CSS — no bloat, just tools. +A lightweight, self-hosted web app that bundles 48 everyday utilities into a single interface. Built with Python + Flask, zero JavaScript frameworks, and minimal CSS — no bloat, just tools. ![Python](https://img.shields.io/badge/Python-3.10+-blue) ![Flask](https://img.shields.io/badge/Flask-3.x-green) @@ -17,6 +17,7 @@ A lightweight, self-hosted web app that bundles 33 everyday utilities into a sin | **PDF to Word** | Convert PDF documents to `.docx` format | | **PDF to Images** | Export each PDF page as PNG or JPG (configurable DPI) | | **PDF to Text** | Extract all text content from a PDF | +| **HTML to PDF** | Convert HTML content to a PDF document | ### PDF Tools | Tool | Description | @@ -41,6 +42,9 @@ A lightweight, self-hosted web app that bundles 33 everyday utilities into a sin | **Crop Image** | Crop by aspect ratio (1:1, 4:3, 16:9, etc.) or custom coordinates | | **Rotate / Flip** | Rotate 90/180/270 degrees, flip horizontal or vertical | | **Add Watermark** | Add text watermark with configurable position, opacity, size, and tiled mode | +| **EXIF Viewer** | View or strip image metadata (EXIF data) for privacy | +| **Favicon Generator** | Create .ico favicons from any image with multiple size options | +| **Image to Text (OCR)** | Extract text from images using optical character recognition | ### Text & Data (client-side, no upload needed) | Tool | Description | @@ -51,6 +55,12 @@ A lightweight, self-hosted web app that bundles 33 everyday utilities into a sin | **URL Encode** | Encode and decode URL components | | **Word Counter** | Count words, characters, sentences, paragraphs, and estimate reading time | | **Markdown Preview** | Live Markdown-to-HTML preview | +| **Case Converter** | Convert between UPPER, lower, Title, camelCase, snake_case, kebab-case, PascalCase | +| **Text Diff** | Compare two texts side by side with highlighted additions and deletions | +| **Regex Tester** | Test regular expressions with live match highlighting and group extraction | +| **Slug Generator** | Create URL-friendly slugs from any text | +| **JSON / YAML** | Convert between JSON and YAML formats | +| **Lorem Ipsum** | Generate placeholder text by paragraphs, sentences, or words | ### Calculators (client-side) | Tool | Description | @@ -60,6 +70,9 @@ A lightweight, self-hosted web app that bundles 33 everyday utilities into a sin | **Color Converter** | Convert between HEX, RGB, and HSL with live preview and color picker | | **Percentage Calc** | Four common percentage calculations in one page | | **Date Calculator** | Date difference, add/subtract days, day-of-week lookup | +| **Timestamp Converter** | Convert between Unix timestamps and human-readable dates (local, UTC, ISO 8601) | +| **Number Base Converter** | Convert between decimal, binary, octal, and hexadecimal | +| **Pomodoro Timer** | Focus timer with configurable work/break intervals and session tracking | ### QR Code | Tool | Description | @@ -67,6 +80,12 @@ A lightweight, self-hosted web app that bundles 33 everyday utilities into a sin | **Generate QR** | Create QR codes from text/URLs with custom size, border, and color | | **Read QR** | Decode QR codes from uploaded images | +### Security +| Tool | Description | +|------|-------------| +| **Password Generator** | Generate strong random passwords with configurable length, character types, and entropy display | +| **Hash Generator** | Generate MD5, SHA-1, SHA-256, and SHA-512 hashes from text | + --- ## Quick Start @@ -110,11 +129,12 @@ The core app works out of the box with the main dependencies. Some features requ | `rembg` | Remove Background | Installs ONNX Runtime (~500 MB). The app works without it and shows a helpful message if missing. | | `pyzbar` | Read QR Code | Requires the [ZBar](https://github.com/NaturalHistoryMuseum/pyzbar#installation) shared library on your system. | | `pdf2docx` | PDF to Word | Pure Python, but conversion quality depends on PDF complexity. | +| `pytesseract` | Image to Text (OCR) | Requires the [Tesseract](https://github.com/tesseract-ocr/tesseract) binary installed on your system. | If you only need the core tools, install the minimal set: ```bash -pip install Flask Pillow PyMuPDF "qrcode[pil]" markdown reportlab img2pdf +pip install Flask Pillow PyMuPDF "qrcode[pil]" markdown reportlab img2pdf python-docx ``` --- @@ -133,7 +153,8 @@ your-everyday-tools/ │ ├── image_tools.py # Image processing endpoints │ ├── text_tools.py # Text & data tool page routes │ ├── calculator_tools.py # Calculator page routes -│ └── qr_tools.py # QR code endpoints +│ ├── qr_tools.py # QR code endpoints +│ └── security_tools.py # Security tool page routes ├── templates/ │ ├── base.html # Main layout (sidebar + content area) │ ├── index.html # Home page with tool cards @@ -144,12 +165,23 @@ your-everyday-tools/ │ ├── color_converter.html │ ├── percentage_calc.html │ ├── date_calc.html +│ ├── timestamp_converter.html +│ ├── number_base.html +│ ├── pomodoro.html │ ├── json_formatter.html │ ├── csv_json.html +│ ├── json_yaml.html │ ├── base64.html │ ├── url_encode.html │ ├── word_counter.html -│ └── markdown_preview.html +│ ├── markdown_preview.html +│ ├── case_converter.html +│ ├── text_diff.html +│ ├── regex_tester.html +│ ├── slug_generator.html +│ ├── lorem_ipsum.html +│ ├── password_generator.html +│ └── hash_generator.html └── static/ ├── css/style.css # All styles (~400 lines, no framework) └── js/main.js # File upload, AJAX, sidebar, shared logic @@ -157,11 +189,11 @@ your-everyday-tools/ ### Architecture Notes -- **One universal template** — `upload_tool.html` powers all 20+ server-side tools. Each route passes title, description, accepted file types, and form options as template variables. No per-tool template duplication. -- **Client-side tools** (text utilities, calculators) run entirely in the browser with vanilla JavaScript — zero server round-trips. +- **One universal template** — `upload_tool.html` powers all 25+ server-side tools. Each route passes title, description, accepted file types, and form options as template variables. No per-tool template duplication. +- **Client-side tools** (text utilities, calculators, security tools) run entirely in the browser with vanilla JavaScript — zero server round-trips. - **In-memory processing** — all file operations use `BytesIO`. No temporary files are written to disk. - **No CSS framework** — custom CSS with CSS Grid, Flexbox, and CSS custom properties. The only external resource is Bootstrap Icons via CDN (~100 KB) for the icon set. -- **Graceful degradation** — heavy optional packages (`rembg`, `pyzbar`, `pdf2docx`) are checked at import time. If missing, the affected tool shows a clear install instruction instead of crashing. +- **Graceful degradation** — heavy optional packages (`rembg`, `pyzbar`, `pdf2docx`, `pytesseract`) are checked at import time. If missing, the affected tool shows a clear install instruction instead of crashing. --- diff --git a/requirements.txt b/requirements.txt index 324f93e..ae389ee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +# Core Flask Pillow PyMuPDF @@ -5,7 +6,10 @@ qrcode[pil] markdown reportlab img2pdf +python-docx + +# Optional (app works without these, shows install message if missing) rembg pyzbar pdf2docx -python-docx +pytesseract diff --git a/routes/convert_tools.py b/routes/convert_tools.py index a4fdf45..563029d 100644 --- a/routes/convert_tools.py +++ b/routes/convert_tools.py @@ -330,3 +330,30 @@ def pdf_to_text(): doc.close() return jsonify(text="\n".join(text_parts)) + + +@bp.route("/html-to-pdf", methods=["POST"]) +def html_to_pdf(): + html = request.form.get("text", "").strip() + if not html: + return jsonify(error="Please enter some HTML content."), 400 + + doc = fitz.open() + page = doc.new_page(width=595, height=842) # A4 + + # Wrap in basic structure if no tag present + if "{html}" + + try: + page.insert_htmlbox(fitz.Rect(50, 50, 545, 792), html) + except Exception as e: + return jsonify(error=f"HTML rendering failed: {str(e)}"), 400 + + output = io.BytesIO() + doc.save(output) + doc.close() + output.seek(0) + + return send_file(output, mimetype="application/pdf", + as_attachment=True, download_name="converted.pdf") diff --git a/templates/tools/case_converter.html b/templates/tools/case_converter.html new file mode 100644 index 0000000..0f3967b --- /dev/null +++ b/templates/tools/case_converter.html @@ -0,0 +1,91 @@ +{% extends "base.html" %} +{% block title %}Case Converter - EveryTools{% endblock %} +{% block top_title %}Case Converter{% endblock %} + +{% block content %} +
+
+

Case Converter

+

Convert text between different cases

+
+
+ + +
+
+
+
UPPERCASE + +
+
+
+
+
lowercase + +
+
+
+
+
Title Case + +
+
+
+
+
Sentence case + +
+
+
+
+
camelCase + +
+
+
+
+
snake_case + +
+
+
+
+
kebab-case + +
+
+
+
+
PascalCase + +
+
+
+
+
+{% endblock %} + +{% block scripts %} + +{% endblock %} diff --git a/templates/tools/hash_generator.html b/templates/tools/hash_generator.html new file mode 100644 index 0000000..06c744d --- /dev/null +++ b/templates/tools/hash_generator.html @@ -0,0 +1,153 @@ +{% extends "base.html" %} +{% block title %}Hash Generator - EveryTools{% endblock %} +{% block top_title %}Hash Generator{% endblock %} + +{% block content %} +
+
+

Hash Generator

+

Generate MD5, SHA-1, SHA-256, and SHA-512 hashes from text

+
+ +
+ + +
+ +
+
+
+ MD5 + +
+ - +
+
+
+ SHA-1 + +
+ - +
+
+
+ SHA-256 + +
+ - +
+
+
+ SHA-512 + +
+ - +
+
+
+{% endblock %} + +{% block scripts %} + +{% endblock %} diff --git a/templates/tools/json_yaml.html b/templates/tools/json_yaml.html new file mode 100644 index 0000000..aef20e6 --- /dev/null +++ b/templates/tools/json_yaml.html @@ -0,0 +1,190 @@ +{% extends "base.html" %} +{% block title %}JSON / YAML Converter - EveryTools{% endblock %} +{% block top_title %}JSON / YAML{% endblock %} + +{% block content %} +
+
+

JSON / YAML Converter

+

Convert between JSON and YAML formats

+
+
+ + +
+
+
+
JSON Input
+
+ +
+
+
+
+ YAML Output + +
+
+

+            
+
+
+ +
+
+{% endblock %} + +{% block scripts %} + +{% endblock %} diff --git a/templates/tools/lorem_ipsum.html b/templates/tools/lorem_ipsum.html new file mode 100644 index 0000000..3174e45 --- /dev/null +++ b/templates/tools/lorem_ipsum.html @@ -0,0 +1,92 @@ +{% extends "base.html" %} +{% block title %}Lorem Ipsum Generator - EveryTools{% endblock %} +{% block top_title %}Lorem Ipsum{% endblock %} + +{% block content %} +
+
+

Lorem Ipsum Generator

+

Generate placeholder text for your designs and layouts

+
+
+
+ + +
+
+ + +
+ +
+
+
+ Generated Text + +
+
+
+
+
+
+{% endblock %} + +{% block scripts %} + +{% endblock %} diff --git a/templates/tools/number_base.html b/templates/tools/number_base.html new file mode 100644 index 0000000..a6c11c4 --- /dev/null +++ b/templates/tools/number_base.html @@ -0,0 +1,65 @@ +{% extends "base.html" %} +{% block title %}Number Base Converter - EveryTools{% endblock %} +{% block top_title %}Number Base Converter{% endblock %} + +{% block content %} +
+
+

Number Base Converter

+

Convert between decimal, binary, octal, and hexadecimal

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+{% endblock %} + +{% block scripts %} + +{% endblock %} diff --git a/templates/tools/password_generator.html b/templates/tools/password_generator.html new file mode 100644 index 0000000..d9b37df --- /dev/null +++ b/templates/tools/password_generator.html @@ -0,0 +1,85 @@ +{% extends "base.html" %} +{% block title %}Password Generator - EveryTools{% endblock %} +{% block top_title %}Password Generator{% endblock %} + +{% block content %} +
+
+

Password Generator

+

Generate strong, random passwords

+
+ +
+
+
Click to copy
+
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ + + + +
+ +
+
+{% endblock %} + +{% block scripts %} + + +{% endblock %} diff --git a/templates/tools/pomodoro.html b/templates/tools/pomodoro.html new file mode 100644 index 0000000..e05a573 --- /dev/null +++ b/templates/tools/pomodoro.html @@ -0,0 +1,134 @@ +{% extends "base.html" %} +{% block title %}Pomodoro Timer - EveryTools{% endblock %} +{% block top_title %}Pomodoro Timer{% endblock %} + +{% block content %} +
+
+

Pomodoro Timer

+

Stay focused with timed work and break intervals

+
+ +
+ + + +
+ +
+
25:00
+
Work Session
+
+ +
+ + +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ Sessions completed: + 0 +
+
+{% endblock %} + +{% block scripts %} + +{% endblock %} diff --git a/templates/tools/regex_tester.html b/templates/tools/regex_tester.html new file mode 100644 index 0000000..e38f62b --- /dev/null +++ b/templates/tools/regex_tester.html @@ -0,0 +1,115 @@ +{% extends "base.html" %} +{% block title %}Regex Tester - EveryTools{% endblock %} +{% block top_title %}Regex Tester{% endblock %} + +{% block content %} +
+
+

Regex Tester

+

Test regular expressions with live match highlighting

+
+
+
+ + +
+
+ + +
+
+
+ + +
+
+
+
Highlighted Matches0 matches
+
+
+
+
+
+
Match Details
+
+
+
+
+
+{% endblock %} + +{% block scripts %} + + +{% endblock %} diff --git a/templates/tools/slug_generator.html b/templates/tools/slug_generator.html new file mode 100644 index 0000000..154329c --- /dev/null +++ b/templates/tools/slug_generator.html @@ -0,0 +1,48 @@ +{% extends "base.html" %} +{% block title %}Slug Generator - EveryTools{% endblock %} +{% block top_title %}Slug Generator{% endblock %} + +{% block content %} +
+
+

Slug Generator

+

Create URL-friendly slugs from any text

+
+
+ + +
+
+ +
+ + +
+
+
+
+ Slug + +
+
+

+        
+
+
+{% endblock %} + +{% block scripts %} + +{% endblock %} diff --git a/templates/tools/text_diff.html b/templates/tools/text_diff.html new file mode 100644 index 0000000..776a374 --- /dev/null +++ b/templates/tools/text_diff.html @@ -0,0 +1,98 @@ +{% extends "base.html" %} +{% block title %}Text Diff - EveryTools{% endblock %} +{% block top_title %}Text Diff{% endblock %} + +{% block content %} +
+
+

Text Diff

+

Compare two texts and see the differences

+
+
+
+
Original
+
+ +
+
+
+
Modified
+
+ +
+
+
+ +
+
+{% endblock %} + +{% block scripts %} + + +{% endblock %} diff --git a/templates/tools/timestamp_converter.html b/templates/tools/timestamp_converter.html new file mode 100644 index 0000000..a6cfc6f --- /dev/null +++ b/templates/tools/timestamp_converter.html @@ -0,0 +1,97 @@ +{% extends "base.html" %} +{% block title %}Timestamp Converter - EveryTools{% endblock %} +{% block top_title %}Timestamp Converter{% endblock %} + +{% block content %} +
+
+

Timestamp Converter

+

Convert between Unix timestamps and human-readable dates

+
+ +
+

Current Time

+
+
+
+ +
+

Unix Timestamp → Date

+
+ + +
+
+
+ +
+

Date → Unix Timestamp

+
+ +
+
+
+
Seconds
+
+
+
+
Milliseconds
+
+
+
+ +
+
+{% endblock %} + +{% block scripts %} + +{% endblock %}