> 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-new-data-schema-using-the-rhino-sdk.md).

# Creating a New Data Schema using the Rhino SDK

This article explains how to create a new data schema or data schema version using the Rhino SDK.

{% hint style="info" %}
NOTE: If you want to learn how to use the UI to create the new data schema, see [Creating a New Data Schema or Data Schema Version](/data-schemas/creating-a-new-data-schema-or-data-schema-version.md).
{% endhint %}

### Creating a New Data *Schema* using the Rhino SDK

#### Prerequisites

Before starting this process, you should have already created a Project using the Rhino SDK or UI.

#### Import your Python Dependencies

```auto
import rhino_health as rh
from rhino_health.lib.endpoints.data_schema.data_schema_dataclass import (
  DataSchemaCreateInput,
  SchemaVariables
)
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.

```auto
print("Logging In")

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

#### Get Supporting FCP Information Needed to Create Your Dataset

At this point, you will need the name of your Project, any dataset's name you would like to use as input, and your previously created Code Object's name. You can also retrieve each object's UUID by following the instructions here: [Frequently Asked Questions (FAQs)](/frequently-asked-questions/frequently-asked-questions-faqs.md)

```auto
# CHANGE_ME: YOUR_FCP_PROJECT_NAME
project = session.project.get_project_by_name('YOUR_FCP_PROJECT_NAME')

workgroup = session.project.get_collaborating_workgroups(project.uid)[0]
```

#### \[Option 1] Create Your *Schema* From a File

To create your Data S *chema* you will need to change several different pieces of information in the code block below. The paths for **file\_path** will be a local path in your development environment.

```auto
schema_params = DataSchemaCreateInput(

  # CHANGE_ME: SCHEMA_NAME
  name = "SCHEMA_NAME",

  # CHANGE_ME: SCHEMA_DESCRIPTION
  description = "SCHEMA_DESCRIPTION",

  primary_workgroup_uid = workgroup.uid,

  # CHANGE_ME: FILE_PATH
  file_path = "FILE_PATH"
)

schema = session.dataset.create_data_schema(schema_params)
print(f"Created new dataset '{schema.name}' with uid '{schema.uid}'")
```
