Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Develop #1

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
61d82bf
Initial commit for python egg for library of api requester
shripadtheneo Oct 2, 2019
c724551
Adding the functionalities to mlsearch package.
saihtaungkham Jan 18, 2020
0340e74
Remove botocore as it seems to be removed by 2020/03.
saihtaungkham Jan 18, 2020
cf9aa10
Remove old readme file.
saihtaungkham Jan 18, 2020
59085f7
Fix rheza review comment.
saihtaungkham Jan 22, 2020
1835db9
Adding the POST request attributes.
saihtaungkham Feb 1, 2020
0c34b44
Removing the IP_address attribute.
saihtaungkham Feb 2, 2020
c2f2970
Updating the readme.
saihtaungkham Feb 2, 2020
89a3fd4
Adding and fixing the POST Attr missing.
saihtaungkham Feb 13, 2020
22eafc6
Adding the last_page flag.
saihtaungkham Feb 21, 2020
d1a020d
Fixing the response format.
saihtaungkham Feb 21, 2020
704d579
Adding Youtube API.
saihtaungkham Mar 8, 2020
7f9cf74
Fix html escape and code formatting.
saihtaungkham May 6, 2020
38de12c
Fix int error on html unescape.
saihtaungkham May 6, 2020
8e1bb98
Fix feedback bug and add features.
saihtaungkham May 6, 2020
46bf6f6
Fix ambiguous youtube query order keyword.
saihtaungkham May 6, 2020
9abf08f
Add usage to README file.
saihtaungkham May 6, 2020
569a8dc
Fix YouTube response result and Exceptions.
saihtaungkham May 16, 2020
9c52cf5
Check Auth Error on YouTube before happening.
saihtaungkham May 24, 2020
82bb9a1
Improve Github Pagnition Logic.
saihtaungkham May 24, 2020
e0270f4
Fix YouTube response result and Exceptions.
saihtaungkham May 25, 2020
5a90bc6
Merge pull request #5 from Machine-Learning-Tokyo/fix/user_feedback
saihtaungkham May 25, 2020
0652bd6
Fix YouTube response result and Exceptions.
saihtaungkham May 25, 2020
e68a8d9
Fix variable name and code formatting.
saihtaungkham May 31, 2020
d468d98
Merge pull request #6 from Machine-Learning-Tokyo/fix/github_pagination
saihtaungkham Jun 14, 2020
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
9 changes: 9 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build
*.pyc
target
*.ipynb
.ipynb_checkpoints
.DS_Store
sync-config.json
data
.vscode
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/src/main/python/mlsearch/__pycache__
*/unittest/python/__pycache__
/target
__pycache__
.coverage
.DS_Store
.vscode
63 changes: 61 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,61 @@
# search-api-requester
API requester for recommendation system
# MLSearch Libraries

The mlsearch libraries are a collection of library that facilite as a wrapper over other repositories for fetching the data required for MLSearch Engine.

The package could be install by `python setup.py`.

<hr>
<b>Standalone usage</b>

`mlsearch -q query -i start_index -c number_of_result -s source`

For example
`mlsearch -q "cnn" -i 0 -c 3 -s "github"`

Available Parameters:
```
-h, --help show this help message and exit

Required Parameters:

-q QUERY, --query QUERY
Keyword for searching.
-i INIT_IDX, --init_idx INIT_IDX
Initial index for pagination.
-c COUNT, --count COUNT
Total number of results to be fetched.
-s SOURCE, --source SOURCE
Source API to be looking for.
-ck COOKIES, --cookies COOKIES
Cookies of current user.
-tm TIMESTAMP, --timestamp TIMESTAMP
Timestamp of requesting API.
Optional Parameters:

-pu PWC_USER, --pwc_user PWC_USER
Paper with code repository user name.
-pp PWC_PASSWORD, --pwc_password PWC_PASSWORD
Paper with code repository password.
-gt GITHUB_ACC_TOKEN, --github_acc_token GITHUB_ACC_TOKEN
Github access token.
-yk YOUTUBE_DEV_KEY, --youtube_dev_key YOUTUBE_DEV_KEY
Youtube developer key.
-ynpt NEXT_PAGE_TOKEN, --y_next_page_token NEXT_PAGE_TOKEN
Next page token for Youtube API.
-yo Y_QUERY_ORDER, --y_query_order Y_QUERY_ORDER
Youtube Query Order.
```

<hr>
<b>Using as an API<b>
<br>

```python
from mlsearch.api_requester import APIRequest

api_request = APIRequest(source, query,
init_idx, count)
api_request.pwc_auth_info = ('user_name', 'password')
api_request.github_acc_token = 'token'
api_request.youtube_developer_key = 'your_key'
```
21 changes: 21 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from pybuilder.core import use_plugin, init

use_plugin("python.core")
use_plugin("python.unittest")
use_plugin("python.install_dependencies")
use_plugin("python.flake8")
use_plugin("python.coverage")
use_plugin("python.distutils")


name = "mlsearch"
default_task = ["install_dependencies", "publish"]


@init
def set_properties(project):
project.set_property("coverage_break_build", False)
project.build_depends_on("mock")
project.build_depends_on("requests")
project.build_depends_on("pygithub")
project.build_depends_on("google-api-python-client")
Empty file added docs/.gitkeep
Empty file.
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PyGithub==1.43.8
pybuilder
requests
google-api-python-client
48 changes: 48 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env python

from setuptools import setup
from setuptools.command.install import install as _install

class install(_install):
def pre_install_script(self):
pass

def post_install_script(self):
pass

def run(self):
self.pre_install_script()

_install.run(self)

self.post_install_script()

if __name__ == '__main__':
setup(
name = 'mlsearch',
version = '1.0.dev0',
description = '',
long_description = '',
author = '',
author_email = '',
license = '',
url = '',
scripts = ['scripts/mlsearch'],
packages = ['mlsearch'],
namespace_packages = [],
py_modules = [],
classifiers = [
'Development Status :: 3 - Alpha',
'Programming Language :: Python'
],
entry_points = {},
data_files = [],
package_data = {},
install_requires = [],
dependency_links = [],
zip_safe = True,
cmdclass = {'install': install},
keywords = '',
python_requires = '',
obsoletes = [],
)
2 changes: 2 additions & 0 deletions src/main/python/mlsearch/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def greet(filelike):
filelike.write("Hello world!\n")
Loading