> For the complete documentation index, see [llms.txt](https://docs.rhinofcp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rhinofcp.com/rhino-sdk/creating-a-code-object-using-the-rhino-sdk.md).

# Creating a Code Object Using the Rhino SDK

This article explains how to use the Rhino SDK to create a code object.

**Note:** If you want background on code objects in the Rhino FCP UI, see [What is a Code Object?](/creating-and-running-code-objects/what-is-a-code-object.md)

#### Prerequisites

Before starting this process, you should have already:

* Created a Project using the Rhino SDK or UI
* Created an Input Data Schema using the Rhino SDK or UI
* \[Optional] Created an Output Data Schema using the Rhino SDK or UI. If you choose not to create an output Data Schema, the system will auto-generate the Data Schema of the output for your Code.

#### Import your Python Dependencies

```python
import rhino_health as rh
from rhino_health.lib.endpoints.code.code_objects_dataclass import (
    CodeObject,
    CodeObjectCreateInput,
    CodeTypes,
    CodeRunType
)
import getpass
```

**Note:** Remember to change all lines with `CHANGE_ME` comments above them in all the blocks below.

#### Log into the Rhino SDK Using Your FCP Credentials

Your username will be the email address you log into the Rhino FCP platform with.

```python
print("Logging In")

# CHANGE_ME: MY_USERNAME
my_username = "MY_USERNAME"

session = rh.login(username=my_username, password=getpass.getpass())
print("Logged In")
```

#### Complete the Creation of Your Code Object Based on the Code Object Type

Now, gather the name of your project and the names of your input and output Data Schemas. The additional information needed will depend on the Code Object type you're creating. For specific instructions using the SDK, refer to the relevant sections in these articles.

* [Creating a Python Code Object Using the Rhino SDK](/rhino-sdk/creating-a-python-code-object-using-the-rhino-sdk.md)
* [Creating a Generalized Compute Code Object Using the Rhino SDK](/rhino-sdk/running-a-generalized-compute-code-object-using-the-rhino-sdk/creating-a-generalized-compute-code-object-using-the-rhino-sdk.md)
* [Creating a New NVFlare Code Object using the Rhino SDK](/rhino-sdk/creating-a-new-nvflare-code-object-using-the-rhino-sdk.md)

If you encounter any errors or issues, contact <support@rhinohealth.com> for further help.
