Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Org_Automation/Compare_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ def file_read():
for i in list:
k=i.split("_")
list2.append(k[0])
#v1 / v300
#print(list2)
v1 / v300
print(list2)
else:
print("list is empty")
list2=['V1', 'V2', 'V300', 'V300', 'V301','V301']
list2=['V1', 'V2', 'V300', 'V300', 'V301','V3021']
for i in range(len(list2)):
for j in range(i+1,len(list2)):
if(list2[i]==list2[j]):
print("SAME")





15 changes: 15 additions & 0 deletions Org_Automation/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Use an official Python runtime as a parent image
FROM python:3.8

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install any needed packages specified in requirements.txt
#RUN pip install -r requirements.txt

# Define the command to run your script when the container starts
CMD ["python", "Compare_list.py"]

2 changes: 1 addition & 1 deletion Org_Automation/Endpoint_Hit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def hit_endpoint(url):
data2 = requests.get(link['Link'],timeout=10)
if (data2.status_code==200):
list.append(link['Link'])
print(list)
print('The output', list)
else:
print("Status Code is not 200")
except requests.exceptions.Timeout:
Expand Down
2 changes: 1 addition & 1 deletion Org_Automation/Endpoint_hit2.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ def space_data(url):


print("Total number of persons in ISS" + str(len(person_ISS)))
print("Total number of persons in ISS" + str(len(person_Tiangong)))
print("Total number of persons in Tiangong" + str(len(person_Tiangong)))

space_data("http://api.open-notify.org/astros.json")
15 changes: 15 additions & 0 deletions Org_Automation/url_checker1/url_checker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Use an official Python runtime as a parent image
FROM python:3.8

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Install any needed packages specified in requirements.txt
#RUN pip install -r requirements.txt

# Define the command to run your script when the container starts
CMD ["python", "Endpoint_Hit.py"]

20 changes: 20 additions & 0 deletions Org_Automation/url_checker1/url_checker/Endpoint_hit2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import json
import requests
person_ISS=[]
person_Tiangong=[]
def space_data(url):
data = requests.get(url)
# print(data.json())
dump = data.json()
for person in dump["people"]:
print(person["craft"])
if (person["craft"] == "ISS"):
person_ISS.append(person["name"])
else:
person_Tiangong.append(person["name"])


print("Total number of persons in ISS" + str(len(person_ISS)))
print("Total number of persons in ISS" + str(len(person_Tiangong)))

space_data("http://api.open-notify.org/astros.json")
58 changes: 17 additions & 41 deletions Python-Speech/SPEECH.py
Original file line number Diff line number Diff line change
@@ -1,49 +1,25 @@
#yPDF2 is a free and open-source pure-python
# pip install PyPDF2
# PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files


#pyttsx3 is a text-to-speech conversion library in Python


#pip install pyttsx3


import PyPDF2

import pyttsx3

pdfReader = PyPDF2.PdfFileReader(open('dummypdf.pdf', 'rb'))
try:
pdfReader = PyPDF2.PdfReader(open('dummypdf.pdf', 'rb'))

#######CASE 1 PDF READ
# Initialize the Pyttsx3 engine
# Initialize the Pyttsx3 engine
speaker = pyttsx3.init()

speaker = pyttsx3.init()
# Initialize the 'text' variable to accumulate text from all pages
text = ""

for page_num in range(pdfReader.numPages):
text = pdfReader.getPage(page_num).extractText()
speaker.say(text)
speaker.runAndWait()
speaker.stop()



speaker.save_to_file(text, 'audio.mp3')



####CASE 2 READ A STRING ###########
# Create a string
string = "Lorem Ipsum is simply dummy text " \
+ "of the printing and typesetting industry."

# Initialize the Pyttsx3 engine
engine = pyttsx3.init()

# We can use file extension as mp3 and wav, both will work
engine.save_to_file(string, 'speech.mp3')

# Wait until above command is not finished.
engine.runAndWait()
for page_num in range(len(pdfReader.pages)):
page = pdfReader.pages[page_num]
text += page.extract_text()
speaker.say(page.extract_text())
speaker.runAndWait()
speaker.stop()

# Save the accumulated text to an audio file
speaker.save_to_file(text, 'audio.mp3')
speaker.runAndWait()

except Exception as e:
print("An error occurred:", str(e))