Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tokland committed Apr 17, 2016
1 parent f4d4898 commit dbbc923
Show file tree
Hide file tree
Showing 7 changed files with 519 additions and 259 deletions.
59 changes: 59 additions & 0 deletions .gitignore
@@ -0,0 +1,59 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/
7 changes: 4 additions & 3 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
# Change Log
# ChangeLog

## [Unreleased]
## [0.1.0]

* Get auth code from youtube-upload.
* Provides infrastructure for Oauth2 authentication (console and browser).
* Exposes all services supported by the Python Gooogle API.
96 changes: 96 additions & 0 deletions README.md
@@ -0,0 +1,96 @@
Introduction
============

_shoogle_ is a tool to use the Google API from the command line. *shoogle* does not know about the details of each API, instead, it uses the Google Discovery API . It works on any platform -GNU/Linux, BSD, OS X, Windows, ...- that runs Python.

Dependencies
============

* [Python 3.x](http://www.python.org).
* Packages: [google-api-python-client](https://developers.google.com/api-client-library/python).

```
$ sudo pip install google-api-python-client
```

Install
=======

```
$ wget https://github.com/tokland/shoogle/archive/master.zip
$ unzip master.zip
$ cd shoogle-master
$ sudo python setup.py install
```

* Or run directly from sources:

```
$ bin/shoogle ...
```

Features
========

* Provides infrastructure for Oauth2 authentication (console and browser).
* Exposes all services supported by the Python Gooogle API.

Examples
========

* Expand a short URL:

```
$ cat > get-longurl.json << EOF
{
"key": "MY_API_SECRET_KEY", // You can add comments
"shortUrl": "http://goo.gl/Du5PSN"
}
EOF
$ shoogle run -c client_id.json urlshortener:v1.url.get get-longurl.json
{
"part": "snippet",
"body": {
"snippet": {"title": "My great video"}
}
}
```

* Upload a video:

```
$ cat > get-longurl.json << EOF
{
"part": "snippet",
"body": {
"snippet": {"title": "My great video"}
}
}
EOF
$ shoogle run youtube:v3.videos.insert upload-video.json -f video.mp4
{
"snippet": {
"channelId": "UCn_xs2hBuoziv_X_4EIeO9Q",
"categoryId": "22",
"localized": {
"title": "My great video",
"description": ""
},
"kind": "youtube#video",
"id": "OaL345345J0",
...
}
```

More
====

* License: [GNU/GPLv3](http://www.gnu.org/licenses/gpl.html).

Feedback
========

* [Donations](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=pyarnau%40gmail%2ecom&lc=US&item_name=youtube%2dupload&no_note=0&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest).
12 changes: 12 additions & 0 deletions bin/shoogle
@@ -0,0 +1,12 @@
#!/usr/bin/env python

def add_parent_directory_to_sys_path():
current_directory = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(current_directory, os.pardir))

import os.path
import sys

add_parent_directory_to_sys_path()
import shoogle
sys.exit(shoogle.main(sys.argv[1:]))
37 changes: 14 additions & 23 deletions setup.py
@@ -1,58 +1,49 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


try:
from setuptools import setup
except ImportError:
from distutils.core import setup


with open('README.rst') as readme_file:
readme = readme_file.read()

with open('HISTORY.rst') as history_file:
history = history_file.read()

requirements = [
# TODO: put package requirements here
"google-api-python-client",
"jsmin",
"httplib2",
]

test_requirements = [
# TODO: put package test requirements here
]
test_requirements = []

setup(
name='shoogle',
version='0.1.0',
description="Google API from the command line",
long_description=readme + '\n\n' + history,
author="Arnau Sanchez",
author_email='pyarnau@gmail.com',
url='https://github.com/tokland/shoogle',
packages=[
'shoogle',
"shoogle/auth"
],
package_dir={'shoogle':
'shoogle'},
package_dir={'shoogle': 'shoogle'},
scripts=["bin/shoogle"],
include_package_data=True,
install_requires=requirements,
license="ISCL",
zip_safe=False,
keywords='shoogle',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: ISC License (ISCL)',
'Development Status :: 4 - Beta',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Topic :: Internet :: WWW/HTTP',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
test_suite='tests',
tests_require=test_requirements
#tests_require=test_requirements,
)
2 changes: 1 addition & 1 deletion shoogle/__init__.py
Expand Up @@ -2,4 +2,4 @@
__email__ = 'pyarnau@gmail.com'
__version__ = '0.1.0'

from shoogle import *
from .shoogle import *

0 comments on commit dbbc923

Please sign in to comment.