Metadata-Version: 2.1
Name: box-sdk-gen
Version: 0.1.1
Summary: [Box Platform](https://box.dev) provides functionality to provide access to content stored within [Box](https://box.com). It provides endpoints for basic manipulation of files and folders, management of users within an enterprise, as well as more complex topics such as legal holds and retention policies.
Home-page: https://github.com/box/box-python-sdk-gen.git
Author: Box
Author-email: oss@box.com
License: Apache-2.0, http://www.apache.org/licenses/LICENSE-2.0
Keywords: box,sdk,api,rest,boxsdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: requests-toolbelt
Requires-Dist: urllib3 (<2)
Provides-Extra: dev
Requires-Dist: tox ; extra == 'dev'
Provides-Extra: jwt
Requires-Dist: pyjwt (>=1.7.0) ; extra == 'jwt'
Requires-Dist: cryptography (>=3) ; extra == 'jwt'
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-timeout ; extra == 'test'
Requires-Dist: pytest-cov ; extra == 'test'
Requires-Dist: pyjwt (>=1.7.0) ; extra == 'test'
Requires-Dist: cryptography (>=3) ; extra == 'test'

# Box Python SDK GENERATED

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Installing](#installing)
- [Getting Started](#getting-started)
- [Integration Tests](#integration-tests)
  - [Running integration tests locally](#running-integration-tests-locally)
    - [Create Custom Application](#create-custom-application)
    - [Export configuration](#export-configuration)
    - [Running tests](#running-tests)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Installing

```console
pip install box-sdk-gen
```

Use your GitHub account login and GitHub Personal access token as a password when prompt.
Guide how to obtain GitHub Personal access token can be found [here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token).

This is autogenerated Box SDK Beta version. The engine used for generating this SDK can be found [here](https://github.com/box/box-codegen).
Supported Python versions are Python 3.8 and above.

To install also extra dependencies required for JWT authentication, use command:

```console
pip install box-sdk-gen[jwt]
```

# Getting Started

To get started with the SDK, get a Developer Token from the Configuration page of your app in the [Box Developer
Console](https://app.box.com/developers/console). You can use this token to make test calls for your own Box account.

The SDK provides an `DeveloperTokenAuth` class, which allows you to authenticate using your Developer Token.
Use instance of `DeveloperTokenAuth` to initialize `Client` object.
Using `Client` object you can access managers, which allow you to perform some operations on your Box account.

The example below demonstrates how to authenticate with Developer Token and print names of all items inside a root folder.

```python
from box_sdk_gen.developer_token_auth import DeveloperTokenAuth
from box_sdk_gen.client import Client


def main(token: str):
    auth: DeveloperTokenAuth = DeveloperTokenAuth(token=token)
    client: Client = Client(auth=auth)
    for item in client.folders.get_folder_items('0').entries:
        print(item.name)


if __name__ == '__main__':
    main('INSERT YOUR DEVELOPER TOKEN HERE')
```

# Integration Tests

## Running integration tests locally

### Create Custom Application

To run integration tests locally you will need a `Custom App` created at https://cloud.app.box.com/developers/console
with `Server Authentication (with JWT)` selected as authentication method.
Once created you can edit properties of the application:

- In section `App Access Level` select `App + Enterprise Access`. You can enable all `Application Scopes`.
- In section `Advanced Features` enable `Make API calls using the as-user header` and `Generate user access tokens`.

Now select `Authorization` and submit application to be reviewed by account admin.

### Export configuration

1. Select `Configuration` tab and in the bottom in the section `App Settings`
   download your app configuration settings as JSON.
2. Encode configuration file to Base64, e.g. using command: `base64 -i path_to_json_file`
3. Set environment variable: `JWT_CONFIG_BASE_64` with base64 encoded jwt configuration file

### Running tests

To run integration tests locally:

1. `pip install -r requirements-test.txt`
2. `pytest`

# Questions, Bugs, and Feature Requests?

Need to contact us directly? [Browse the issues
tickets](https://github.com/box/box-python-sdk-generated/issues)! Or, if that
doesn't work, [file a new
one](https://github.com/box/box-python-sdk-generated/issues/new) and we will get
back to you. If you have general questions about the Box API, you can
post to the [Box Developer
Forum](https://community.box.com/t5/Developer-Forum/bd-p/DeveloperForum).

## Copyright and License

Copyright 2023 Box, Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
