From de76b979c4898713d5f66e41ddac0a33df800b5a Mon Sep 17 00:00:00 2001 From: dbf256 Date: Thu, 29 Sep 2016 23:15:12 +0300 Subject: [PATCH 1/2] #79 - Move python2 code to separate folder with python package structure --- README.md | 7 +++---- python/__init__.py | 0 python/botanio/__init__.py | 0 botan.py => python/botanio/botan.py | 5 +---- test.py => python/botanio/test.py | 3 ++- python/setup.py | 14 ++++++++++++++ 6 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 python/__init__.py create mode 100644 python/botanio/__init__.py rename botan.py => python/botanio/botan.py (91%) rename test.py => python/botanio/test.py (81%) mode change 100755 => 100644 create mode 100644 python/setup.py diff --git a/README.md b/README.md index 15f227c..e446ce4 100644 --- a/README.md +++ b/README.md @@ -50,14 +50,13 @@ botan.shortenUrl(uid, url, function (err, res, body) { ``` ## Python example -You need to install requests library to use python botan lib. -You can do it with +You need to install requests library using pip. - pip install requests + pip install botanio Code: ```python - import botan + from botanio import botan botan_token = '.........' # Token got from @botaniobot uid = message.from_user diff --git a/python/__init__.py b/python/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python/botanio/__init__.py b/python/botanio/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/botan.py b/python/botanio/botan.py similarity index 91% rename from botan.py rename to python/botanio/botan.py index 3c08ffc..98923cb 100644 --- a/botan.py +++ b/python/botanio/botan.py @@ -1,9 +1,6 @@ -# ---------------- -# dont forget 'pip install requests' first -# ---------------- # usage example: # -# import botan +# from botanio import botan # # print botan.track(1111, 1, {'text':2}, 'Search') diff --git a/test.py b/python/botanio/test.py old mode 100755 new mode 100644 similarity index 81% rename from test.py rename to python/botanio/test.py index 81d1785..23097e8 --- a/test.py +++ b/python/botanio/test.py @@ -1,5 +1,6 @@ #!/usr/bin/env python2 -import botan +from botanio import botan + print botan.track(1111, 1, {'text':2}, 'Search') print botan.track('ab', 1, {'text':2}, 'Search') diff --git a/python/setup.py b/python/setup.py new file mode 100644 index 0000000..5a003e8 --- /dev/null +++ b/python/setup.py @@ -0,0 +1,14 @@ +from setuptools import setup + +setup(name='botanio', + version='1.0.0', + description='Botan SDK: Advanced analytics for your Telegram bot', + url='https://github.com/botanio/sdk', + author='Botan.io team', + author_email='team@botan.io', + license='MIT', + packages=['botanio'], + install_requires=[ + 'requests', + ], + zip_safe=False) From 98e040c64258e898357cc9b7d7f726987d0d118c Mon Sep 17 00:00:00 2001 From: Alexey Date: Fri, 30 Sep 2016 23:37:49 +0300 Subject: [PATCH 2/2] Fix typi --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e446ce4..fffdbc8 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ botan.shortenUrl(uid, url, function (err, res, body) { ``` ## Python example -You need to install requests library using pip. +You need to install botanio library using pip. pip install botanio