Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

🔖 Shell Script added to update pacakge #29

Merged
merged 1 commit into from
Oct 17, 2022
Merged
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
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,24 @@ This project is currently in development. Any contributions are welcome.

## Changelog

**V2.0.1**

- [x] Mobi file support
- [x] Epub file support
- [x] User can now save the audiobook for future
- [x] User library added

**V2.0.0**

- [x] Save Audio Book locally
- [x] Listen to the book
- [x] Speech-speed control
- [x] Read password-protected PDF
- [x] Create JSON file for the book
- [ ] Change the voice of the narrator

** Upcoming changes**

- [ ] Change the voice of the narrator
- [ ] Support more extensions


Expand Down
5 changes: 0 additions & 5 deletions audiobook/article_web_scraper.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import requests

from bs4 import BeautifulSoup

html_text_formattings = ["p", "a", "b", "strong", "i", "em", "mark", "small", "del", "ins", "sub", "sup"]

class ArticleWebScraper:
"""
ArticleWebScraper class
Expand All @@ -28,7 +25,6 @@ def get_title_from_article (self):

def get_page_data(self):
""" returns a json from a non-empty <article> tag """
json_book = {}
response = requests.get(self.article_url)

if response.status_code != 200:
Expand All @@ -37,5 +33,4 @@ def get_page_data(self):
soup = BeautifulSoup(response.content, "html.parser")

text_data = soup.getText().replace("\n","")

return text_data
1 change: 0 additions & 1 deletion audiobook/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,3 @@ def mobi_to_json(input_book_path):
json_book[str(page_num)] = book_data[i:i + 2000]

return json_book, len(json_book)

2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ pyttsx3==2.90
PyPDF2==2.11.1
ebooklib==0.17.1
beautifulsoup4==4.11.1
html2text==2020.1.16
mobi==0.3.3
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="audiobook",
version="2.0.0",
version="2.0.1",
author="CodePerfectPlus",
author_email="deepak008@live.com",
description="Listen to your favourite audiobook",
Expand Down
53 changes: 53 additions & 0 deletions update_packge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

# Update package on pypi server

# check for flake8 and twine and install if not present
if ! [ -x "$(command -v flake8)" ]; then
echo 'Error: flake8 is not installed.' >&2
echo 'Installing flake8...'
pip install flake8
fi

if ! [ -x "$(command -v twine)" ]; then
echo 'Error: twine is not installed.' >&2
echo 'Installing twine...'
pip install twine
fi

# check for setup.py
if ! [ -f "setup.py" ]; then
echo 'Error: setup.py is not found.' >&2
exit 1
fi


# run sdists and wheels
python3 setup.py sdist bdist_wheel

# check for dist folder
if ! [ -d "dist" ]; then
echo 'Error: dist folder is not found.' >&2
exit 1
fi


read -p "Do you want to upload to pypi? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
python3 -m twine upload dist/*
fi


# remove dist folder
rm -rf dist

# remove build folder
rm -rf build

# remove .egg-info folder
rm -rf *.egg-info

# remove .pyc files
find . -name "*.pyc" -exec rm -rf {} \;