From 76c609d81553b96b3f6b16b0faad613d7d29c24e Mon Sep 17 00:00:00 2001 From: mpotane <1000100ten@gmail.com> Date: Thu, 10 Nov 2022 23:34:52 +0800 Subject: [PATCH 01/10] =?UTF-8?q?Refactor=20code=20for=20csv-to-json=20?= =?UTF-8?q?=F0=9F=8E=8D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- csv-to-json/script.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/csv-to-json/script.py b/csv-to-json/script.py index 9976cd6..55be48a 100644 --- a/csv-to-json/script.py +++ b/csv-to-json/script.py @@ -1,5 +1,12 @@ import pandas as pd # Reading the csv file and converting it to a json file. -df = pd.read_csv('sample.csv') -df.to_json('sample.json') \ No newline at end of file + + +def main(): + df = pd.read_csv('sample.csv') + df.to_json('sample.json') + + +if __name__ == '__main__': + main() From 51666891ece6315dc52ad3dc2ab20c170807d967 Mon Sep 17 00:00:00 2001 From: Mark Edzel Potane <1000100ten@gmail.com> Date: Sun, 29 Jan 2023 23:21:31 +0800 Subject: [PATCH 02/10] add space before horizontal line. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a54146f..e3edf90 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ - [Text To Tagalog](https://github.com/mpotane/PythonScriptPH/tree/main/text-to-tagalog) - [Usd To Peso](https://github.com/mpotane/PythonScriptPH/tree/main/usd-to-peso) - [Youtube Video Downloader](https://github.com/mpotane/PythonScriptPH/tree/main/youtube-video-downloader) + --- ### 🎯 Contribute From 57ea57c38ba70f6ca3aaeced3c3ecac15ba0416a Mon Sep 17 00:00:00 2001 From: mpotane <1000100ten@gmail.com> Date: Sun, 29 Jan 2023 23:50:44 +0800 Subject: [PATCH 03/10] Add for the badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e3edf90..e8fcf41 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ [![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors-) +![LOVE](https://forthebadge.com/images/badges/built-with-love.svg) ![yes](https://forthebadge.com/images/badges/check-it-out.svg) + [![](https://img.shields.io/static/v1?label=python&message=3.10.7&color=f7df28&style=for-the-badge&logo=python)](https://www.python.org/) [![](https://img.shields.io/static/v1?label=LICENSE&message=GPLv3&color=brightgreen&style=for-the-badge&logo=gnu)](https://www.gnu.org/licenses/gpl-3.0.en.html) --- From 099cb0c7f273657b9754f6e0070519a498da6d69 Mon Sep 17 00:00:00 2001 From: mpotane <1000100ten@gmail.com> Date: Wed, 8 Feb 2023 19:55:01 +0800 Subject: [PATCH 04/10] Add 2 new scripts. --- README.md | 2 ++ compress-photo/requirements.txt | 2 ++ compress-photo/script.py | 8 ++++++++ proof-reader/requirements.txt | 1 + proof-reader/script.py | 10 ++++++++++ 5 files changed, 23 insertions(+) create mode 100644 compress-photo/requirements.txt create mode 100644 compress-photo/script.py create mode 100644 proof-reader/requirements.txt create mode 100644 proof-reader/script.py diff --git a/README.md b/README.md index e8fcf41..68bc2b2 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ - [Searching](https://github.com/mpotane/PythonScriptPH/tree/main/Algorithms/Searching) - [Sorting](https://github.com/mpotane/PythonScriptPH/tree/main/Algorithms/Sorting) - [Btc To Php](https://github.com/mpotane/PythonScriptPH/tree/main/btc-to-php) +- [Compress Photo](https://github.com/mpotane/PythonScriptPH/tree/main/compress-photo) - [Csv To Excel](https://github.com/mpotane/PythonScriptPH/tree/main/csv-to-excel) - [Csv To Json](https://github.com/mpotane/PythonScriptPH/tree/main/csv-to-json) - [Detect Language](https://github.com/mpotane/PythonScriptPH/tree/main/detect-language) @@ -23,6 +24,7 @@ - [Json To YAML](https://github.com/mpotane/PythonScriptPH/tree/main/json-to-yaml) - [Pdf to docx](https://github.com/mpotane/PythonScriptPH/tree/main/pdf-to-docx) - [Philippine Flag](https://github.com/mpotane/PythonScriptPH/tree/main/Philippine-flag) +- [Proof Reader](https://github.com/mpotane/PythonScriptPH/tree/main/proof-reader) - [Qrcode](https://github.com/mpotane/PythonScriptPH/tree/main/qrcode) - [Remove Background Image](https://github.com/mpotane/PythonScriptPH/tree/main/remove-background-image) - [Speed Test](https://github.com/mpotane/PythonScriptPH/tree/main/speed-test) diff --git a/compress-photo/requirements.txt b/compress-photo/requirements.txt new file mode 100644 index 0000000..dc7fba5 --- /dev/null +++ b/compress-photo/requirements.txt @@ -0,0 +1,2 @@ +tkinter +Pillow \ No newline at end of file diff --git a/compress-photo/script.py b/compress-photo/script.py new file mode 100644 index 0000000..8ed543b --- /dev/null +++ b/compress-photo/script.py @@ -0,0 +1,8 @@ +import PIL +from PIL import Image +from tkinter.filedialog import * + + +fl=askopenfilenames() +img = Image.open(fl[0]) +img.save("output.jpg", "JPEG", optimize = True, quality = 10) \ No newline at end of file diff --git a/proof-reader/requirements.txt b/proof-reader/requirements.txt new file mode 100644 index 0000000..39941b8 --- /dev/null +++ b/proof-reader/requirements.txt @@ -0,0 +1 @@ +lmproof \ No newline at end of file diff --git a/proof-reader/script.py b/proof-reader/script.py new file mode 100644 index 0000000..1797492 --- /dev/null +++ b/proof-reader/script.py @@ -0,0 +1,10 @@ +import lmproof + + +def proofread(text): + proofread = lmproof.load("en") + correction = proofread.proofread(text) + print("Original: {}".format(text)) + print("Correction: {}".format(correction)) + +proofread("Your Text") \ No newline at end of file From 220bf01a07ca94c886e9b9fc9f0504a4d4bcbe66 Mon Sep 17 00:00:00 2001 From: mpotane <1000100ten@gmail.com> Date: Mon, 13 Feb 2023 18:46:26 +0800 Subject: [PATCH 05/10] Bump python version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68bc2b2..ab9e082 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ![LOVE](https://forthebadge.com/images/badges/built-with-love.svg) ![yes](https://forthebadge.com/images/badges/check-it-out.svg) -[![](https://img.shields.io/static/v1?label=python&message=3.10.7&color=f7df28&style=for-the-badge&logo=python)](https://www.python.org/) [![](https://img.shields.io/static/v1?label=LICENSE&message=GPLv3&color=brightgreen&style=for-the-badge&logo=gnu)](https://www.gnu.org/licenses/gpl-3.0.en.html) +[![](https://img.shields.io/static/v1?label=python&message=3.10.9&color=f7df28&style=for-the-badge&logo=python)](https://www.python.org/) [![](https://img.shields.io/static/v1?label=LICENSE&message=GPLv3&color=brightgreen&style=for-the-badge&logo=gnu)](https://www.gnu.org/licenses/gpl-3.0.en.html) --- From 714a1970d1fec9e6c23ce0ab37d0e4436906aff6 Mon Sep 17 00:00:00 2001 From: Mark Edzel Potane <1000100ten@gmail.com> Date: Fri, 2 Jun 2023 00:19:06 +0800 Subject: [PATCH 06/10] Create main.yml --- .github/workflows/main.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..11925d6 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,19 @@ +name: Learning GitHub Script + +on: + issues: + types: [opened] + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v6 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '👋 Thanks for reporting!' + }) From 8ac4381e4164be800660f946995e5d60f485001c Mon Sep 17 00:00:00 2001 From: Mark Edzel Potane <65337802+mpotane@users.noreply.github.com> Date: Tue, 11 Jul 2023 21:53:18 +0800 Subject: [PATCH 07/10] Update pyversion. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab9e082..b82422c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ![LOVE](https://forthebadge.com/images/badges/built-with-love.svg) ![yes](https://forthebadge.com/images/badges/check-it-out.svg) -[![](https://img.shields.io/static/v1?label=python&message=3.10.9&color=f7df28&style=for-the-badge&logo=python)](https://www.python.org/) [![](https://img.shields.io/static/v1?label=LICENSE&message=GPLv3&color=brightgreen&style=for-the-badge&logo=gnu)](https://www.gnu.org/licenses/gpl-3.0.en.html) +[![](https://img.shields.io/static/v1?label=python&message=3.11.4&color=f7df28&style=for-the-badge&logo=python)](https://www.python.org/) [![](https://img.shields.io/static/v1?label=LICENSE&message=GPLv3&color=brightgreen&style=for-the-badge&logo=gnu)](https://www.gnu.org/licenses/gpl-3.0.en.html) --- From fe4a5fd3350bcf95b7accbccdadaab5da6c7156b Mon Sep 17 00:00:00 2001 From: Mark Edzel Potane <65337802+mpotane@users.noreply.github.com> Date: Tue, 8 Aug 2023 11:21:18 +0800 Subject: [PATCH 08/10] Quickfix badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b82422c..689826e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors-) -![LOVE](https://forthebadge.com/images/badges/built-with-love.svg) ![yes](https://forthebadge.com/images/badges/check-it-out.svg) +![LOVE](https://github.com/BraveUX/for-the-badge/blob/master/src/images/badges/built-with-love.svg) ![yes](https://github.com/BraveUX/for-the-badge/blob/master/src/images/badges/check-it-out.svg) [![](https://img.shields.io/static/v1?label=python&message=3.11.4&color=f7df28&style=for-the-badge&logo=python)](https://www.python.org/) [![](https://img.shields.io/static/v1?label=LICENSE&message=GPLv3&color=brightgreen&style=for-the-badge&logo=gnu)](https://www.gnu.org/licenses/gpl-3.0.en.html) From 1e9aa972a6ca5bd092799f179362380fa3b92311 Mon Sep 17 00:00:00 2001 From: Mark Edzel Potane <65337802+mpotane@users.noreply.github.com> Date: Wed, 4 Oct 2023 09:27:38 +0800 Subject: [PATCH 09/10] Update ftb link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 689826e..b82422c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors-) -![LOVE](https://github.com/BraveUX/for-the-badge/blob/master/src/images/badges/built-with-love.svg) ![yes](https://github.com/BraveUX/for-the-badge/blob/master/src/images/badges/check-it-out.svg) +![LOVE](https://forthebadge.com/images/badges/built-with-love.svg) ![yes](https://forthebadge.com/images/badges/check-it-out.svg) [![](https://img.shields.io/static/v1?label=python&message=3.11.4&color=f7df28&style=for-the-badge&logo=python)](https://www.python.org/) [![](https://img.shields.io/static/v1?label=LICENSE&message=GPLv3&color=brightgreen&style=for-the-badge&logo=gnu)](https://www.gnu.org/licenses/gpl-3.0.en.html) From a5cc7e696a0e5fdf0405b87cd050bc0b1045e3ce Mon Sep 17 00:00:00 2001 From: mpotane <65337802+mpotane@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:21:57 +0800 Subject: [PATCH 10/10] =?UTF-8?q?Add=20soundrecorder=20=F0=9F=94=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soundrecorder/script.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 soundrecorder/script.py diff --git a/soundrecorder/script.py b/soundrecorder/script.py new file mode 100644 index 0000000..5c7a153 --- /dev/null +++ b/soundrecorder/script.py @@ -0,0 +1,14 @@ +import sounddevice +from scipy.io.wavfile import write + + +def main(): + fs = 44100 # Sample rate + seconds = 10 # Duration of recording + + myrecording = sounddevice.rec(int(seconds * fs), samplerate=fs, channels=2) + sounddevice.wait() # Wait until recording is finished + write("output.wav", fs, myrecording) # Save as WAV file + +if __name__ == "__main__": + main() \ No newline at end of file