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

#79 - Move python2 code to separate folder with python package structure #80

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@ botan.shortenUrl(uid, url, function (err, res, body) {
```

## <a name="py"></a>Python example
You need to install requests library to use python botan lib.
You can do it with
You need to install botanio 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
Expand Down
Empty file added python/__init__.py
Empty file.
Empty file added python/botanio/__init__.py
Empty file.
5 changes: 1 addition & 4 deletions botan.py → python/botanio/botan.py
Original file line number Diff line number Diff line change
@@ -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')

Expand Down
3 changes: 2 additions & 1 deletion test.py → python/botanio/test.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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')
14 changes: 14 additions & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
@@ -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)