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
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 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
Metadata
Release files for box-oauth 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| box_oauth-0.3.1.tar.gz | 4.0 kB | Without provenance | Details for box_oauth-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| box_oauth-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for box_oauth-0.3.1-py3-none-any.whl |
Total release size: 9.6 kB
Release files / box_oauth-0.3.1.tar.gz
| Download URL | box_oauth-0.3.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15c8c783878ff179943fdbe5a25d7c34c6be14027e5103fd5ea476ba2068f7ce
|
|
BLAKE2b-256 checksum How to use checksums |
564a3054d0ffe2532b125606062c4489ea9ea1d65e6128ab019a68d2d89e8d32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Release files / box_oauth-0.3.1-py3-none-any.whl
| Download URL | box_oauth-0.3.1-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0fe5578ce27aad33122286d4ac88441a5a30316e7dc1b15bae36d3fa34ef2861
|
|
BLAKE2b-256 checksum How to use checksums |
640f31af4180678b4f891f7dc5c3ed7ceab4f3fa48262f33a4c704b27b0f0a73
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
|
Security for box-oauth 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.