diff --git a/.gitignore b/.gitignore index 7bfcd7a0..3c1868de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ __pycache__/ -*.pyc \ No newline at end of file +*.pyc +.vscode/ \ No newline at end of file diff --git a/README.md b/README.md index 2c56437f..df74cef1 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,14 @@ # TextUtils -A tool for analyzing text data in Django backend +- A tool for analyzing text data in Django backend +- It is a simple django project or website in which we can Analyze text. -It is a simple django project or website in which we can Analyze text. +## What Can We do from Textutils ? +1. Remove Punctuations
+1. UPPERCASE
+1. New Line Remove
+1. Extra Spaces Remover
+1. Numbers Remover -

What Can We do from Textutils ?

-1)Remove Punctuations
-2)UPPERCASE
-3)New Line Remove
-4)Extra Spaces Remover
-5)Numbers Remover - -

Requirments

-python3
-django
+## Requirments +1. python3 +1. django diff --git a/templates/about.html b/templates/about.html index fe320a7d..89568f25 100644 --- a/templates/about.html +++ b/templates/about.html @@ -1,68 +1,80 @@ - - - - - - + + + + - Text Utils-Results - - - - - - -
-

THIS PAGE IS STILL IN DEVELOPEMENT STAGE

+ Text Utils-Results + + + + + +
- © 2019 Textutils.in +

THIS PAGE IS STILL IN DEVELOPEMENT STAGE

- - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/templates/analyze.html b/templates/analyze.html index 4bb031ff..ec7328f5 100644 --- a/templates/analyze.html +++ b/templates/analyze.html @@ -1,114 +1,123 @@ - - - - - - - - - Text Utils-Results - - - - - - + + + + + + + - + Text Utils-Results + + + + + + + -

Your Analyzed Text - {{ purpose }}

-
-

- -

{{ analyzed_text }}

-

-
- - - - - - - - - - + + + + - - + + } + + + + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 10f597d1..35bf9179 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,159 +1,170 @@ - - - - - - - - - - - Text Utils - - - - - - - +
+
{% csrf_token %} -
- {% csrf_token %} +
+

+ -
-

+ +

+ 0 Characters + +

+
- exampleFormControlTextarea1.addEventListener("keyup",function(){ - var characters = exampleFormControlTextarea1.value.split(''); - wordCount.innerText = characters.length; - }); - -

-
+
+ + +
-
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
+
+ + +
+ +
+ + +
+ +
+ + +
- +
+ + +
+ + -
- -
- + +
+
+ + var typed = new Typed('#typed', { + strings: ["You can do anything with your text here!", "Enter your text here and let Text Utils do the magic!"], + backSpeed: 15, + smartBackspace: true, + backDelay: 1200, + startDelay: 1000, + typeSpeed: 25, + loop: false, + + }); + - - - - - - - - + + + - + + } + + + \ No newline at end of file diff --git a/textutils/urls.py b/textutils/urls.py index 920f07ad..b5791fad 100644 --- a/textutils/urls.py +++ b/textutils/urls.py @@ -18,9 +18,8 @@ from . import views urlpatterns = [ - path('admin/', admin.site.urls), - path('', views.index, name='index'), - path('analyze', views.analyze, name='analyze'), - path('about', views.about, name='about') - + path("admin/", admin.site.urls), + path("", views.index, name="index"), + path("analyze", views.analyze, name="analyze"), + path("about", views.about, name="about"), ] diff --git a/textutils/views.py b/textutils/views.py index 40cad6dd..2c4b9d0d 100644 --- a/textutils/views.py +++ b/textutils/views.py @@ -4,77 +4,83 @@ def index(request): - return render(request, 'index.html') + return render(request, "index.html") def analyze(request): - #Get the text - djtext = request.POST.get('text', 'default') + # Get the text + djtext = request.POST.get("text", "default") # Check checkbox values - removepunc = request.POST.get('removepunc', 'off') - fullcaps = request.POST.get('fullcaps', 'off') - newlineremover = request.POST.get('newlineremover', 'off') - extraspaceremover = request.POST.get('extraspaceremover', 'off') - numberremover = request.POST.get('numberremover','off') + removepunc = request.POST.get("removepunc", "off") + fullcaps = request.POST.get("fullcaps", "off") + newlineremover = request.POST.get("newlineremover", "off") + extraspaceremover = request.POST.get("extraspaceremover", "off") + numberremover = request.POST.get("numberremover", "off") - #Check which checkbox is on + # Check which checkbox is on if removepunc == "on": - punctuations = '''!()-[]{};:'"\,<>./?@#$%^&*_~''' + punctuations = """!()-[]{};:'"\,<>./?@#$%^&*_~""" analyzed = "" for char in djtext: if char not in punctuations: analyzed = analyzed + char - params = {'purpose':'Removed Punctuations', 'analyzed_text': analyzed} + params = {"purpose": "Removed Punctuations", "analyzed_text": analyzed} djtext = analyzed - if(fullcaps=="on"): + if fullcaps == "on": analyzed = "" for char in djtext: analyzed = analyzed + char.upper() - params = {'purpose': 'Changed to Uppercase', 'analyzed_text': analyzed} + params = {"purpose": "Changed to Uppercase", "analyzed_text": analyzed} djtext = analyzed - if(extraspaceremover=="on"): + if extraspaceremover == "on": analyzed = "" for index, char in enumerate(djtext): # It is for if a extraspace is in the last of the string if char == djtext[-1]: - if not(djtext[index] == " "): - analyzed = analyzed + char + if not (djtext[index] == " "): + analyzed = analyzed + char - elif not(djtext[index] == " " and djtext[index+1]==" "): + elif not (djtext[index] == " " and djtext[index + 1] == " "): analyzed = analyzed + char - params = {'purpose': 'Removed NewLines', 'analyzed_text': analyzed} + params = {"purpose": "Removed NewLines", "analyzed_text": analyzed} djtext = analyzed - if (newlineremover == "on"): + if newlineremover == "on": analyzed = "" for char in djtext: - if char != "\n" and char!="\r": + if char != "\n" and char != "\r": analyzed = analyzed + char - params = {'purpose': 'Removed NewLines', 'analyzed_text': analyzed} - - if (numberremover == "on"): + params = {"purpose": "Removed NewLines", "analyzed_text": analyzed} + + if numberremover == "on": analyzed = "" - numbers = '0123456789' + numbers = "0123456789" for char in djtext: if char not in numbers: analyzed = analyzed + char - - params = {'purpose': 'Removed NewLines', 'analyzed_text': analyzed} + + params = {"purpose": "Removed NewLines", "analyzed_text": analyzed} djtext = analyzed - - if(removepunc != "on" and newlineremover!="on" and extraspaceremover!="on" and fullcaps!="on" and numberremover != "on"): + if ( + removepunc != "on" + and newlineremover != "on" + and extraspaceremover != "on" + and fullcaps != "on" + and numberremover != "on" + ): return HttpResponse("please select any operation and try again") - return render(request, 'analyze.html', params) + return render(request, "analyze.html", params) + def about(request): - return render(request, 'about.html') \ No newline at end of file + return render(request, "about.html")