Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename to media_hosts, add README, license and packaging stuff
- Loading branch information
Showing
12 changed files
with
175 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
python-media-hosts gets media info from sites like Youtube and Soundcloud. | ||
|
||
Installation | ||
============ | ||
|
||
pip install media-hosts | ||
|
||
media-hosts is compatible with python 2 and 3. | ||
|
||
Dependencies: | ||
|
||
- miss | ||
|
||
Optional dependencies: | ||
|
||
- python-dateutil: to parse dates returned by various APIs | ||
- gdata: for some Youtube data | ||
- jsonpickle: for __main__.py | ||
|
||
Usage | ||
===== | ||
|
||
From python:: | ||
|
||
from media_hosts import MediaHosts, MediaHostException | ||
media_hosts = MediaHosts(_=_, settings=settings) | ||
media_hosts.get_info_by_url(url) | ||
|
||
From the command line:: | ||
|
||
$ python -m media_hosts 'https://www.youtube.com/watch?v=Gn3QXjNQNsk' | ||
|
||
License | ||
======= | ||
|
||
LGPLv3+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from os.path import join, dirname | ||
|
||
from setuptools import setup, find_packages | ||
|
||
from version import get_version | ||
|
||
setup( | ||
name='media-hosts', | ||
version=get_version(), | ||
description='Gets media info from sites like Youtube and Soundcloud', | ||
author='Changaco', | ||
author_email='changaco ατ changaco δοτ net', | ||
url='https://github.com/Changaco/python-media-hosts', | ||
license='LGPLv3+', | ||
packages=find_packages(), | ||
long_description=open(join(dirname(__file__), 'README.rst')).read(), | ||
install_requires = [ | ||
'miss>=0.2', | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This program is placed into the public domain. | ||
|
||
__all__ = ('get_version') | ||
|
||
from os.path import dirname, isdir, join | ||
import re | ||
from subprocess import CalledProcessError, check_output | ||
|
||
version_re = re.compile('^Version: (.+)$', re.M) | ||
|
||
def get_version(): | ||
d = dirname(__file__) | ||
|
||
if isdir(join(d, '.git')): | ||
# Get the version using "git describe". | ||
cmd = 'git describe --tags --match [0-9]*'.split() | ||
try: | ||
version = check_output(cmd).decode().strip() | ||
except CalledProcessError: | ||
print('Unable to get version number from git tags') | ||
exit(1) | ||
|
||
# PEP 386 compatibility | ||
if '-' in version: | ||
version = '.post'.join(version.split('-')[:2]) | ||
|
||
else: | ||
# Extract the version from the PKG-INFO file. | ||
with open(join(d, 'PKG-INFO')) as f: | ||
version = version_re.search(f.read()).group(1) | ||
|
||
return version | ||
|
||
|
||
if __name__ == '__main__': | ||
print(get_version()) |