Skip to content

Commit d2c89fb

Browse files
authored
Merge pull request #2 from feedly/api-specs
Api specs
2 parents 3cb8880 + cd575bd commit d2c89fb

3 files changed

Lines changed: 139 additions & 6 deletions

File tree

feedly/session.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
from requests.adapters import HTTPAdapter
1111
from requests.exceptions import HTTPError
1212

13-
from future.backports import urllib
14-
from requests import Session, Response
13+
from requests import Session
1514
import urllib
1615

17-
from feedly.data import FeedlyData, FeedlyUser
18-
from feedly.protocol import RateLimiter, RateLimitedAPIError, BadRequestAPIError, UnauthorizedAPIError, ServerAPIError, APIClient, WrappedHTTPError
19-
from feedly.stream import UserStreamId, STREAM_SOURCE_USER, StreamOptions, EnterpriseStreamId
16+
from feedly.data import FeedlyUser
17+
from feedly.protocol import RateLimitedAPIError, BadRequestAPIError, UnauthorizedAPIError, ServerAPIError, APIClient, WrappedHTTPError
18+
from feedly.stream import EnterpriseStreamId
2019

2120

2221
class FeedlySession(APIClient):
@@ -158,7 +157,7 @@ def do_api_request(self, relative_url:str, method:str=None, data:Dict=None,
158157
token = (Path.home() / 'access.token').read_text().strip()
159158
# print(sess.user['fullName'])
160159

161-
uid = 'd4be7934-074a-4af6-bce0-03aec43271d2'
160+
uid = 'uid'
162161
sess = FeedlySession(auth_token=token, user_id=uid)
163162

164163
# sess.user.get_enterprise_tags()

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
requests>=2.19.1

setup.py

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
# Note: To use the 'upload' functionality of this file, you must:
5+
# $ pip install twine
6+
7+
import io
8+
import os
9+
import sys
10+
from shutil import rmtree
11+
12+
from setuptools import find_packages, setup, Command
13+
14+
# Package meta-data.
15+
NAME = 'feedly-client'
16+
DESCRIPTION = 'A lightweight client for the feedly api (https://developers.feedly.com).'
17+
URL = 'https://github.com/feedly/python-api-client'
18+
EMAIL = 'kireet@feedly.com'
19+
AUTHOR = 'Kireet'
20+
REQUIRES_PYTHON = '>=3.6.0'
21+
VERSION = 0.1
22+
23+
# What packages are required for this module to be executed?
24+
#REQUIRED = [
25+
# 'requests', 'maya', 'records',
26+
#]
27+
with open('requirements.txt') as f:
28+
REQUIRED = f.read().splitlines()
29+
30+
31+
# What packages are optional?
32+
EXTRAS = {
33+
# 'fancy feature': ['django'],
34+
}
35+
36+
# The rest you shouldn't have to touch too much :)
37+
# ------------------------------------------------
38+
# Except, perhaps the License and Trove Classifiers!
39+
# If you do change the License, remember to change the Trove Classifier for that!
40+
41+
here = os.path.abspath(os.path.dirname(__file__))
42+
43+
# Import the README and use it as the long-description.
44+
# Note: this will only work if 'README.md' is present in your MANIFEST.in file!
45+
try:
46+
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
47+
long_description = '\n' + f.read()
48+
except FileNotFoundError:
49+
long_description = DESCRIPTION
50+
51+
# Load the package's __version__.py module as a dictionary.
52+
about = {}
53+
if not VERSION:
54+
with open(os.path.join(here, NAME, '__version__.py')) as f:
55+
exec(f.read(), about)
56+
else:
57+
about['__version__'] = VERSION
58+
59+
60+
class UploadCommand(Command):
61+
"""Support setup.py upload."""
62+
63+
description = 'Build and publish the package.'
64+
user_options = []
65+
66+
@staticmethod
67+
def status(s):
68+
"""Prints things in bold."""
69+
print('\033[1m{0}\033[0m'.format(s))
70+
71+
def initialize_options(self):
72+
pass
73+
74+
def finalize_options(self):
75+
pass
76+
77+
def run(self):
78+
try:
79+
self.status('Removing previous builds…')
80+
rmtree(os.path.join(here, 'dist'))
81+
except OSError:
82+
pass
83+
84+
self.status('Building Source and Wheel (universal) distribution…')
85+
os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))
86+
87+
self.status('Uploading the package to PyPI via Twine…')
88+
os.system('twine upload dist/*')
89+
90+
self.status('Pushing git tags…')
91+
os.system('git tag v{0}'.format(about['__version__']))
92+
os.system('git push --tags')
93+
94+
sys.exit()
95+
96+
97+
# Where the magic happens:
98+
setup(
99+
name=NAME,
100+
version=about['__version__'],
101+
description=DESCRIPTION,
102+
long_description=long_description,
103+
long_description_content_type='text/markdown',
104+
author=AUTHOR,
105+
author_email=EMAIL,
106+
python_requires=REQUIRES_PYTHON,
107+
url=URL,
108+
packages=find_packages(exclude=('tests',)),
109+
# If your package is a single module, use this instead of 'packages':
110+
# py_modules=['mypackage'],
111+
112+
# entry_points={
113+
# 'console_scripts': ['mycli=mymodule:cli'],
114+
# },
115+
install_requires=REQUIRED,
116+
extras_require=EXTRAS,
117+
include_package_data=True,
118+
license='MIT',
119+
classifiers=[
120+
# Trove classifiers
121+
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
122+
'License :: OSI Approved :: MIT License',
123+
'Programming Language :: Python',
124+
'Programming Language :: Python :: 3',
125+
'Programming Language :: Python :: 3.6',
126+
'Programming Language :: Python :: Implementation :: CPython',
127+
'Programming Language :: Python :: Implementation :: PyPy'
128+
],
129+
# $ setup.py publish support.
130+
cmdclass={
131+
'upload': UploadCommand,
132+
},
133+
)

0 commit comments

Comments
 (0)