Skip to content

Commit

Permalink
Setting up for PyPi
Browse files Browse the repository at this point in the history
  • Loading branch information
nwithan8 committed Dec 7, 2020
1 parent 56bc9b4 commit 744050c
Show file tree
Hide file tree
Showing 8 changed files with 761 additions and 1 deletion.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pocketcasts/__init__.py

This file was deleted.

1 change: 1 addition & 0 deletions pycketcasts/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from pycketcasts.pocketcasts import PocketCast
7 changes: 7 additions & 0 deletions pycketcasts/_info.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
__version__ = '1.0.0'

__title__ = "pycketcasts"
__author__ = 'Nate Harris'
__author_email__ = '[email protected]'
__copyright__ = "Copyright © 2020 - Nate Harris"
__license__ = 'GNU General Public License v3 (GPLv3)'
28 changes: 28 additions & 0 deletions pocketcasts/pocketcasts.py → pycketcasts/pocketcasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'subscribe': 'user/podcast/subscribe',
'unsubscribe': 'user/podcast/unsubscribe',
'episode_archive': 'sync/update_episode_archive',
'episode_star': 'synce/update_episode_star',
'up_next': 'up_next/list',
'play_status': 'sync/update_episode',
'play_next': 'up_next/play_next',
Expand Down Expand Up @@ -94,6 +95,33 @@ def mark_unplayed(self) -> bool:
return True
return False

def add_star(self) -> bool:
endpoint = _get_endpoint("episode_star")
url = _make_url(base=self._api._api_base, endpoint=endpoint)
if self._api._post(url=url,
data={'episodes': [
{'uuid': self.uuid,
'podcast': self.podcast.uuid
}
],
'star': True}):
return True
return False

def remove_star(self) -> bool:
endpoint = _get_endpoint("episode_star")
url = _make_url(base=self._api._api_base,
endpoint=endpoint)
if self._api._post(url=url,
data={'episodes': [
{'uuid': self.uuid,
'podcast': self.podcast.uuid
}
],
'star': False}):
return True
return False

def archive(self) -> bool:
endpoint = _get_endpoint("episode_archive")
url = _make_url(base=self._api._api_base, endpoint=endpoint)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requests
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
48 changes: 48 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import setuptools
import pycketcasts._info as package_info

with open("README.md", "r") as fh:
long_description = fh.read()

with open("requirements.txt", 'r') as fh:
requirements = fh.read().splitlines()

setuptools.setup(
name=package_info.__title__, # How you named your package folder (MyLib)
packages=[package_info.__title__], # Choose the same as "name"
version=package_info.__version__, # Start with a small number and increase it with every change you make
license=package_info.__license__,
description="Interact with PocketCast's unofficial API", # Give a short description about your library
long_description=long_description,
long_description_content_type="text/markdown",
author=package_info.__author__, # Type in your name
author_email=package_info.__author_email__, # Type in your E-Mail
url=f'https://github.com/nwithan8/{package_info.__title__}', # Provide either the link to your github or to your website
download_url=f'https://github.com/nwithan8/{package_info.__title__}/archive/{package_info.__version__}.tar.gz',
keywords=[
'PocketCasts',
'podcast',
'podcasts',
'API',
'Home Assistant',
'library'
], # Keywords that define your package best
install_requires=requirements,
classifiers=[
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Development Status :: 4 - Beta',
# Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
'Intended Audience :: Developers', # Define that your audience are developers
'Topic :: Software Development :: Build Tools',
'Programming Language :: Python :: 3', # Specify which python versions that you want to support
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Multimedia :: Video',
'Topic :: Multimedia',
'Topic :: Internet :: WWW/HTTP',
'Operating System :: OS Independent'
],
python_requires='>=3.6'
)

0 comments on commit 744050c

Please sign in to comment.