-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
129 lines (101 loc) · 3.63 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# -*- coding: utf-8 -*-
import re
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
long_description = """
# YooKassa API Python Client Library
[![Build Status](https://travis-ci.org/yoomoney/yookassa-sdk-python.svg?branch=master)](https://travis-ci.org/yoomoney/yookassa-sdk-python)
[![Latest Stable Version](https://img.shields.io/pypi/v/yookassa.svg)](https://pypi.org/project/yookassa/)
[![Total Downloads](https://img.shields.io/pypi/dm/yookassa.svg)](https://pypi.org/project/yookassa/)
[![License](https://img.shields.io/pypi/l/yookassa.svg)](https://github.com/yoomoney/yookassa-sdk-python)
[Russian](https://github.com/yoomoney/yookassa-sdk-python/blob/master/README.md) | English
This product is used for managing payments under [The YooKassa API](https://yookassa.ru/en/developers/api)
For usage by those who implemented YooKassa using the API method.
## Requirements
1. Python 2.7 or Python 3.x
2. pip
## Installation
### Under console using pip
1. Install pip.
2. In the console, run the following command:
```bash
pip install --upgrade yookassa
```
### Under console using easy_install
1. Install easy_install.
2. In the console, run the following command:
```bash
easy_install --upgrade yookassa
```
### Manually
1. In the console, run the following command:
```bash
wget https://pypi.python.org/packages/5a/be/5eafdfb14aa6f32107e9feb6514ca1ad3fe56f8e5ee59d20693b32f7e79f/yookassa-1.0.0.tar.gz#md5=46595279b5578fd82a199bfd4cd51db2
tar zxf yookassa-1.0.0.tar.gz
cd yookassa-1.0.0
python setup.py install
```
## Commencing work
1. Import module
```python
import yookassa
```
2. Configure a Client
```python
from yookassa import Configuration
Configuration.configure('<Account Id>', '<Secret Key>')
```
or
```python
from yookassa import Configuration
Configuration.account_id = '<Account Id>'
Configuration.secret_key = '<Secret Key>'
```
or via oauth
```python
from yookassa import Configuration
Configuration.configure_auth_token('<Oauth Token>')
```
If you agree to participate in the development of the SDK, you can submit data about your framework, cms or module:
```python
from yookassa import Configuration
from yookassa.domain.common.user_agent import Version
Configuration.configure('<Account Id>', '<Secret Key>')
Configuration.configure_user_agent(
framework=Version('Django', '2.2.3'),
cms=Version('Wagtail', '2.6.2'),
module=Version('Y.CMS', '0.0.1')
)
```
3. Call the required API method. [More details in our documentation for the YooKassa API](https://yookassa.ru/en/developers/api)
"""
with open('src/yookassa/__init__.py') as fp:
version = re.search(r"__version__\s*=\s*'(.*)'", fp.read()).group(1)
setup(
name="yookassa",
author="YooMoney",
author_email="[email protected]",
version=version,
keywords="yoomoney, yookassa, payout, sdk, python",
description="YooKassa API SDK Python Library",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/yoomoney/yookassa-sdk-python",
package_dir={"": "src"},
packages=find_packages('src'),
install_requires=["requests", "urllib3", "netaddr", "distro", "deprecated"],
zip_safe=False,
license="MIT",
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9"
]
)