box-oauth-0.3.1
توضیحات
Box headless OAuth2 client
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | box-oauth-0.3.1 |
| نام | box-oauth |
| نسخه کتابخانه | 0.3.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Gabriel Abud |
| ایمیل نویسنده | gabriel.jabud@gmail.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/box-oauth/ |
| مجوز | - |
# Python OAuth2 Headless Client for Box
Python package to help connect with a Box API in cases where you don't have access to get the JWT file (better long term solution). In cases where you want to connect to the Box API through OAuth2 in a headless manner (without a browser) this can help
# Dependencies
This package depends on keyring, selenium, and boxsdk. Since selenium runs in headless mode, you will need to make sure chromedriver is installed on your machine (this is done outside of pip unfortunately).
For instructions on how to do this, see [here](https://tecadmin.net/setup-selenium-chromedriver-on-ubuntu/)
# Usage
Login to Box through OAuth2
```
from box_auth.box_auth import BoxAuth
box = BoxAuth(
client_id, # From Box developer console
client_secret, # From box developer console
box_username,
box_password,
user_email # This is used by your keyring
)
box.login() # Login
print(box.get_current_user()) # Double check that it worked
```
To get the [boxsdk](https://github.com/box/box-python-sdk) client, just run:
```
Client = box.get_client()
```
Follow the boxsdk documentation for how to use the client to access box
# Testing
You need the following variables in a config_test.py file (root directory) for the tests to work
```
client_id = # You can find this in the developer console, under your app configuration
client_secret = # ""
box_username =
box_password
user_email # This is used by your keyring to store the access and refresh token
user # This is used by tests to check that you are the correct user
```
Then from the root directory, simply run
```
pytest
```
# Install
As a pip package
```
pip install box_oauth
```
or
```
python setup.py
```
نیازمندی
| مقدار | نام |
|---|---|
| ==0.1.0 | appnope |
| ==0.24.0 | asn1crypto |
| ==1.3.0 | atomicwrites |
| ==19.1.0 | attrs |
| ==1.4.3 | autopep8 |
| ==0.1.0 | backcall |
| ==3.1.0 | bleach |
| ==2.3.2 | boxsdk |
| ==2019.3.9 | certifi |
| ==1.12.2 | cffi |
| ==3.0.4 | chardet |
| ==2.6.1 | cryptography |
| ==4.4.0 | decorator |
| ==0.14 | docutils |
| ==0.3 | entrypoints |
| ==2.8 | idna |
| ==5.1.0 | ipykernel |
| ==7.4.0 | ipython |
| ==0.2.0 | ipython-genutils |
| ==0.13.3 | jedi |
| ==5.2.4 | jupyter-client |
| ==4.4.0 | jupyter-core |
| ==19.0.1 | keyring |
| ==3.1.1 | keyrings.alt |
| ==7.0.0 | more-itertools |
| ==0.4.0 | parso |
| ==4.7.0 | pexpect |
| ==0.7.5 | pickleshare |
| ==1.5.0.1 | pkginfo |
| ==0.9.0 | pluggy |
| ==2.0.9 | prompt-toolkit |
| ==0.6.0 | ptyprocess |
| ==1.8.0 | py |
| ==2.5.0 | pycodestyle |
| ==2.19 | pycparser |
| ==2.3.1 | Pygments |
| ==1.7.1 | PyJWT |
| ==4.4.0 | pytest |
| ==2.8.0 | python-dateutil |
| ==18.0.1 | pyzmq |
| ==24.0 | readme-renderer |
| ==2.21.0 | requests |
| ==0.9.1 | requests-toolbelt |
| ==3.141.0 | selenium |
| ==1.12.0 | six |
| ==6.0.2 | tornado |
| ==4.31.1 | tqdm |
| ==4.3.2 | traitlets |
| ==1.13.0 | twine |
| ==1.24.3 | urllib3 |
| ==0.1.7 | wcwidth |
| ==0.5.1 | webencodings |
| ==1.11.1 | wrapt |
نحوه نصب
نصب پکیج whl box-oauth-0.3.1:
pip install box-oauth-0.3.1.whl
نصب پکیج tar.gz box-oauth-0.3.1:
pip install box-oauth-0.3.1.tar.gz