hailtheking-reader-realpython 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ include reader/*.txt
@@ -0,0 +1,82 @@
1
+ Metadata-Version: 2.4
2
+ Name: hailtheking-reader-realpython
3
+ Version: 1.1.0
4
+ Summary: A easy and quick way to get help from realpythons latest articles onto your terminal
5
+ Home-page: https://github.com/HailtheKing2024/Python/tree/main/pythonreader
6
+ Author: Abhinav B
7
+ Author-email: bijishabhinav@gmail.com
8
+ License: MIT
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.7
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: feedparser
14
+ Requires-Dist: html2text
15
+ Dynamic: author
16
+ Dynamic: author-email
17
+ Dynamic: classifier
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: license
22
+ Dynamic: requires-dist
23
+ Dynamic: summary
24
+
25
+ Real Python Feed Reader
26
+ The Real Python Feed Reader is a basic web feed reader that can download the latest Real Python tutorials from the Real Python feed,allowing the convience of have the latest advice right at your fingertips while working.
27
+
28
+ For more information see the tutorial How to Publish an Open-Source Python Package to PyPI on Real Python.
29
+
30
+ Installation
31
+ You can install the Real Python Feed Reader from PyPI:
32
+
33
+ python -m pip install realpython-reader
34
+ The reader is supported on Python 3.7 and above. Older versions of Python, including Python 2.7, are supported by version 1.0.0 of the reader.
35
+
36
+ How to use
37
+ The Real Python Feed Reader is a command line application, named realpython. To see a list of the latest Real Python tutorials, call the program without any arguments:
38
+
39
+ $ realpython
40
+ The latest tutorials from Real Python (https://realpython.com/)
41
+ 0 How to Publish an Open-Source Python Package to PyPI
42
+ 1 Python "while" Loops (Indefinite Iteration)
43
+ 2 Writing Comments in Python (Guide)
44
+ 3 Setting Up Python for Machine Learning on Windows
45
+ 4 Python Community Interview With Michael Kennedy
46
+ 5 Practical Text Classification With Python and Keras
47
+ 6 Getting Started With Testing in Python
48
+ 7 Python, Boto3, and AWS S3: Demystified
49
+ 8 Python's range() Function (Guide)
50
+ 9 Python Community Interview With Mike Grouchy
51
+ 10 How to Round Numbers in Python
52
+ 11 Building and Documenting Python REST APIs With Flask and Connexion – Part 2
53
+ 12 Splitting, Concatenating, and Joining Strings in Python
54
+ 13 Image Segmentation Using Color Spaces in OpenCV + Python
55
+ 14 Python Community Interview With Mahdi Yusuf
56
+ 15 Absolute vs Relative Imports in Python
57
+ 16 Top 10 Must-Watch PyCon Talks
58
+ 17 Logging in Python
59
+ 18 The Best Python Books
60
+ 19 Conditional Statements in Python
61
+ To read one particular tutorial, call the program with the numerical ID of the tutorial as a parameter:
62
+
63
+ $ realpython 0
64
+ # How to Publish an Open-Source Python Package to PyPI
65
+
66
+ Python is famous for coming with batteries included. Sophisticated
67
+ capabilities are available in the standard library. You can find modules for
68
+ working with sockets, parsing CSV, JSON, and XML files, and working with
69
+ files and file paths.
70
+
71
+ However great the packages included with Python are, there are many
72
+ fantastic projects available outside the standard library. These are most
73
+ often hosted at the Python Packaging Index (PyPI), historically known as the
74
+ Cheese Shop. At PyPI, you can find everything from Hello World to advanced
75
+ deep learning libraries.
76
+
77
+ [... The full text of the article ...]
78
+ You can also call the Real Python Feed Reader in your own Python code, by importing from the reader package:
79
+
80
+ >>> from reader import feed
81
+ >>> feed.get_titles()
82
+ ['How to Publish an Open-Source Python Package to PyPI', ...]
@@ -0,0 +1,58 @@
1
+ Real Python Feed Reader
2
+ The Real Python Feed Reader is a basic web feed reader that can download the latest Real Python tutorials from the Real Python feed,allowing the convience of have the latest advice right at your fingertips while working.
3
+
4
+ For more information see the tutorial How to Publish an Open-Source Python Package to PyPI on Real Python.
5
+
6
+ Installation
7
+ You can install the Real Python Feed Reader from PyPI:
8
+
9
+ python -m pip install realpython-reader
10
+ The reader is supported on Python 3.7 and above. Older versions of Python, including Python 2.7, are supported by version 1.0.0 of the reader.
11
+
12
+ How to use
13
+ The Real Python Feed Reader is a command line application, named realpython. To see a list of the latest Real Python tutorials, call the program without any arguments:
14
+
15
+ $ realpython
16
+ The latest tutorials from Real Python (https://realpython.com/)
17
+ 0 How to Publish an Open-Source Python Package to PyPI
18
+ 1 Python "while" Loops (Indefinite Iteration)
19
+ 2 Writing Comments in Python (Guide)
20
+ 3 Setting Up Python for Machine Learning on Windows
21
+ 4 Python Community Interview With Michael Kennedy
22
+ 5 Practical Text Classification With Python and Keras
23
+ 6 Getting Started With Testing in Python
24
+ 7 Python, Boto3, and AWS S3: Demystified
25
+ 8 Python's range() Function (Guide)
26
+ 9 Python Community Interview With Mike Grouchy
27
+ 10 How to Round Numbers in Python
28
+ 11 Building and Documenting Python REST APIs With Flask and Connexion – Part 2
29
+ 12 Splitting, Concatenating, and Joining Strings in Python
30
+ 13 Image Segmentation Using Color Spaces in OpenCV + Python
31
+ 14 Python Community Interview With Mahdi Yusuf
32
+ 15 Absolute vs Relative Imports in Python
33
+ 16 Top 10 Must-Watch PyCon Talks
34
+ 17 Logging in Python
35
+ 18 The Best Python Books
36
+ 19 Conditional Statements in Python
37
+ To read one particular tutorial, call the program with the numerical ID of the tutorial as a parameter:
38
+
39
+ $ realpython 0
40
+ # How to Publish an Open-Source Python Package to PyPI
41
+
42
+ Python is famous for coming with batteries included. Sophisticated
43
+ capabilities are available in the standard library. You can find modules for
44
+ working with sockets, parsing CSV, JSON, and XML files, and working with
45
+ files and file paths.
46
+
47
+ However great the packages included with Python are, there are many
48
+ fantastic projects available outside the standard library. These are most
49
+ often hosted at the Python Packaging Index (PyPI), historically known as the
50
+ Cheese Shop. At PyPI, you can find everything from Hello World to advanced
51
+ deep learning libraries.
52
+
53
+ [... The full text of the article ...]
54
+ You can also call the Real Python Feed Reader in your own Python code, by importing from the reader package:
55
+
56
+ >>> from reader import feed
57
+ >>> feed.get_titles()
58
+ ['How to Publish an Open-Source Python Package to PyPI', ...]
@@ -0,0 +1,82 @@
1
+ Metadata-Version: 2.4
2
+ Name: hailtheking-reader-realpython
3
+ Version: 1.1.0
4
+ Summary: A easy and quick way to get help from realpythons latest articles onto your terminal
5
+ Home-page: https://github.com/HailtheKing2024/Python/tree/main/pythonreader
6
+ Author: Abhinav B
7
+ Author-email: bijishabhinav@gmail.com
8
+ License: MIT
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.7
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: feedparser
14
+ Requires-Dist: html2text
15
+ Dynamic: author
16
+ Dynamic: author-email
17
+ Dynamic: classifier
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: license
22
+ Dynamic: requires-dist
23
+ Dynamic: summary
24
+
25
+ Real Python Feed Reader
26
+ The Real Python Feed Reader is a basic web feed reader that can download the latest Real Python tutorials from the Real Python feed,allowing the convience of have the latest advice right at your fingertips while working.
27
+
28
+ For more information see the tutorial How to Publish an Open-Source Python Package to PyPI on Real Python.
29
+
30
+ Installation
31
+ You can install the Real Python Feed Reader from PyPI:
32
+
33
+ python -m pip install realpython-reader
34
+ The reader is supported on Python 3.7 and above. Older versions of Python, including Python 2.7, are supported by version 1.0.0 of the reader.
35
+
36
+ How to use
37
+ The Real Python Feed Reader is a command line application, named realpython. To see a list of the latest Real Python tutorials, call the program without any arguments:
38
+
39
+ $ realpython
40
+ The latest tutorials from Real Python (https://realpython.com/)
41
+ 0 How to Publish an Open-Source Python Package to PyPI
42
+ 1 Python "while" Loops (Indefinite Iteration)
43
+ 2 Writing Comments in Python (Guide)
44
+ 3 Setting Up Python for Machine Learning on Windows
45
+ 4 Python Community Interview With Michael Kennedy
46
+ 5 Practical Text Classification With Python and Keras
47
+ 6 Getting Started With Testing in Python
48
+ 7 Python, Boto3, and AWS S3: Demystified
49
+ 8 Python's range() Function (Guide)
50
+ 9 Python Community Interview With Mike Grouchy
51
+ 10 How to Round Numbers in Python
52
+ 11 Building and Documenting Python REST APIs With Flask and Connexion – Part 2
53
+ 12 Splitting, Concatenating, and Joining Strings in Python
54
+ 13 Image Segmentation Using Color Spaces in OpenCV + Python
55
+ 14 Python Community Interview With Mahdi Yusuf
56
+ 15 Absolute vs Relative Imports in Python
57
+ 16 Top 10 Must-Watch PyCon Talks
58
+ 17 Logging in Python
59
+ 18 The Best Python Books
60
+ 19 Conditional Statements in Python
61
+ To read one particular tutorial, call the program with the numerical ID of the tutorial as a parameter:
62
+
63
+ $ realpython 0
64
+ # How to Publish an Open-Source Python Package to PyPI
65
+
66
+ Python is famous for coming with batteries included. Sophisticated
67
+ capabilities are available in the standard library. You can find modules for
68
+ working with sockets, parsing CSV, JSON, and XML files, and working with
69
+ files and file paths.
70
+
71
+ However great the packages included with Python are, there are many
72
+ fantastic projects available outside the standard library. These are most
73
+ often hosted at the Python Packaging Index (PyPI), historically known as the
74
+ Cheese Shop. At PyPI, you can find everything from Hello World to advanced
75
+ deep learning libraries.
76
+
77
+ [... The full text of the article ...]
78
+ You can also call the Real Python Feed Reader in your own Python code, by importing from the reader package:
79
+
80
+ >>> from reader import feed
81
+ >>> feed.get_titles()
82
+ ['How to Publish an Open-Source Python Package to PyPI', ...]
@@ -0,0 +1,14 @@
1
+ MANIFEST.in
2
+ README.md
3
+ setup.py
4
+ hailtheking_reader_realpython.egg-info/PKG-INFO
5
+ hailtheking_reader_realpython.egg-info/SOURCES.txt
6
+ hailtheking_reader_realpython.egg-info/dependency_links.txt
7
+ hailtheking_reader_realpython.egg-info/entry_points.txt
8
+ hailtheking_reader_realpython.egg-info/requires.txt
9
+ hailtheking_reader_realpython.egg-info/top_level.txt
10
+ reader/__init__.py
11
+ reader/__main__.py
12
+ reader/config.txt
13
+ reader/feed.py
14
+ reader/viewer.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ realpython = reader.__main__:main
@@ -0,0 +1,4 @@
1
+ # __init__.py
2
+
3
+ # Version of the realpython-reader package
4
+ __version__ = "1.1.0"
@@ -0,0 +1,29 @@
1
+ # __main__.py
2
+
3
+ from configparser import ConfigParser
4
+ from importlib import resources # Python 3.7+
5
+ import sys
6
+
7
+ from reader import feed
8
+ from reader import viewer
9
+
10
+ def main():
11
+ """Read the Real Python article feed"""
12
+ # Read URL of the Real Python feed from config file
13
+ cfg = ConfigParser()
14
+ cfg.read_string(resources.read_text("reader", "config.txt"))
15
+ url = cfg.get("feed", "url")
16
+
17
+ # If an article ID is given, show the article
18
+ if len(sys.argv) > 1:
19
+ article = feed.get_article(url, sys.argv[1])
20
+ viewer.show(article)
21
+
22
+ # If no ID is given, show a list of all articles
23
+ else:
24
+ site = feed.get_site(url)
25
+ titles = feed.get_titles(url)
26
+ viewer.show_list(site, titles)
27
+
28
+ if __name__ == "__main__":
29
+ main()
@@ -0,0 +1,4 @@
1
+ # config.txt
2
+
3
+ [feed]
4
+ url = https://realpython.com/atom.xml
@@ -0,0 +1,25 @@
1
+ # feed.py
2
+
3
+ import feedparser
4
+ import html2text
5
+
6
+ _CACHED_FEEDS = dict()
7
+
8
+ def _feed(url):
9
+ """Only read a feed once, by caching its contents"""
10
+ if url not in _CACHED_FEEDS:
11
+ _CACHED_FEEDS[url] = feedparser.parse(url)
12
+ return _CACHED_FEEDS[url]
13
+
14
+ def get_site(url):
15
+ """Get name and link to web site of the feed"""
16
+ info = _feed(url).feed
17
+ return f"{info.title} ({info.link})"
18
+
19
+ def get_article(url, article_id):
20
+ """Get article from feed with the given ID"""
21
+ articles = _feed(url).entries
22
+ article = articles[int(article_id)]
23
+ html = article.content[0].value
24
+ text = html2text.html2text(html)
25
+ return f"# {article.title}\n\n{text}"
@@ -0,0 +1,11 @@
1
+ # viewer.py
2
+
3
+ def show(article):
4
+ """Show one article"""
5
+ print(article)
6
+
7
+ def show_list(site, titles):
8
+ """Show list of articles"""
9
+ print(f"The latest tutorials from {site}. To read an article run the same command and put the id number.")
10
+ for article_id, title in enumerate(titles):
11
+ print(f"{article_id:>3} {title}")
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,34 @@
1
+ import pathlib
2
+ from setuptools import setup
3
+
4
+ # The directory containing this file
5
+ HERE = pathlib.Path(__file__).parent
6
+
7
+ # The text of the README file
8
+ README = (HERE / "README.md").read_text()
9
+
10
+ # This call to setup() does all the work
11
+ setup(
12
+ name="hailtheking-reader-realpython",
13
+ version="1.1.0",
14
+ description="A easy and quick way to get help from realpythons latest articles onto your terminal",
15
+ long_description=README,
16
+ long_description_content_type="text/markdown",
17
+ url="https://github.com/HailtheKing2024/Python/tree/main/pythonreader",
18
+ author="Abhinav B",
19
+ author_email="bijishabhinav@gmail.com",
20
+ license="MIT",
21
+ classifiers=[
22
+ "License :: OSI Approved :: MIT License",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.7",
25
+ ],
26
+ packages=["reader"],
27
+ include_package_data=True,
28
+ install_requires=["feedparser", "html2text"],
29
+ entry_points={
30
+ "console_scripts": [
31
+ "realpython=reader.__main__:main",
32
+ ]
33
+ },
34
+ )