# projects **Warning: Deprecated**: As of 15 July 2024, Gradient API endpoints are deprecated and no longer available for Paperspace users. ## create Create new project #### Examples ## CLI ```bash gradient projects create \ --name "New Project" ``` ## cURL ```bash curl -X POST 'https://api.paperspace.io/projects' \ -H 'x-api-key: d44808a2785d6a...' \ -H 'Content-Type: application/json' \ --data-raw '{ "name": "New Project" }' ``` ## Python ```python from gradient import ProjectsClient api_key='d44808a2785d6a...' projects_client = ProjectsClient(api_key) print(projects_client.create( name='New Project' )) ``` #### Options | Name | Type | Attributes | Description | |---|---|---|---| | `--name` | string | required | Project name | | `--repositoryName` | string | optional | Name of the repository | | `--repositoryUrl` | string | optional | URL to the repository | | `--tag` | string | optional | One or many tags that you want to add | | `--tags` | string | optional | Tags separated by comma | | `--apiKey` | string | optional | API key to use this time only | | `--optionsFile` | string | optional | Path to YAML with predefined options | | `--createOptionsFile` | string | optional | Generate template options file | #### Response ## CLI ```text Project created with ID: prmximcci https://console.paperspace.com/paperspace-docs-team/projects/prmximcci ``` ## cURL ```json { "name": "New Project", "handle": "prmximcci", "dtCreated": "2022-03-22T06:34:52.360Z", "dtDeleted": null, "lastJobSeqNum": 0, "repoNodeId": null, "repoName": null, "repoUrl": null } ``` ## Python ```text prmximcci ``` ## details Show details of a project #### Examples ## CLI ```bash gradient projects details \ --id "prmximcci" ``` ## cURL ```bash curl -g -X GET 'https://api.paperspace.io/projects/?filter={"where":{"handle":"prmximcci"}}' \ -H 'x-api-key: d44808a2785d6a...' ``` ## Python ```python from gradient import ProjectsClient api_key='d44808a2785d6a...' projects_client = ProjectsClient(api_key) print(projects_client.get( project_id='prmximcci' )) ``` #### Options | Name | Type | Attributes | Description | |---|---|---|---| | `--id` | string | required | Project ID | | `--apiKey` | string | optional | API key to use this time only | | `--optionsFile` | string | optional | Path to YAML with predefined options | | `--createOptionsFile` | string | optional | Generate template options file | #### Response ## CLI ```text +-----------------+-------------+ | Name | New Project | +-----------------+-------------+ | ID | prmximcci | | Repository name | None | | Repository url | None | | Tags | | +-----------------+-------------+ ``` ## cURL ```json { "data": [ { "name": "New Project", "handle": "prmximcci", "dtCreated": "2022-03-22T06:34:52.360Z", "dtDeleted": null, "accessorHandles": ["ubx9ce8k"], "lastJobSeqNum": 0, "repoNodeId": null, "repoName": null, "repoUrl": null, "tags": null, ... } ], "meta": { "where": { "handle": "prmximcci" }, "limit": 100, "totalItems": 1 }, "tagFilter": [] } ``` ## Python ```js Project( (id = "prmximcci"), (name = "New Project"), (repository_name = None), (repository_url = None), (created = datetime.datetime( 2022, 3, 22, 6, 34, 52, 360000, (tzinfo = tzutc()) )), (tags = []) ); ``` ## list Show details of a project #### Examples ## CLI ```bash gradient projects list ``` ## cURL ```bash curl -X GET 'https://api.paperspace.io/projects' \ -H 'x-api-key: d44808a2785d6a...' ``` ## Python ```python from gradient import ProjectsClient api_key='d44808a2785d6a...' projects_client = ProjectsClient(api_key) print(projects_client.list()) ``` #### Options | Name | Type | Attributes | Description | |---|---|---|---| | `--tag` | string | optional | Filter by tags | | `--apiKey` | string | optional | API key to use this time only | | `--optionsFile` | string | optional | Path to YAML with predefined options | | `--createOptionsFile` | string | optional | Generate template options file | #### Response ## CLI ```text +-----------+----------------+------------+----------------------------+ | ID | Name | Repository | Created | +-----------+----------------+------------+----------------------------+ | prmximcci | New Project | None | 2022-03-22 06:34:52.360000 | +-----------+----------------+------------+----------------------------+ ``` ## cURL ```json { "data": [ { "name": "New Project", "handle": "prmximcci", "dtCreated": "2022-03-22T06:34:52.360Z", "dtDeleted": null, "accessorHandles": ["ubx9ce8k"], "lastJobSeqNum": 0, "repoNodeId": null, "repoName": null, "repoUrl": null, "tags": null, ... } ], "meta": { "totalItems": 1 }, "tagFilter": [] } ``` ## Python ```js [ Project( (id = "prmximcci"), (name = "New Project"), (repository_name = None), (repository_url = None), (created = datetime.datetime( 2022, 3, 22, 6, 34, 52, 360000, (tzinfo = tzutc()) )), (tags = []) ), ]; ``` ## delete Delete project #### Examples ## CLI ```bash gradient projects delete \ --id "prmximcci" ``` ## cURL ```bash curl -X POST 'https://api.paperspace.io/projects/prmximcci/deleteProject' \ -H 'x-api-key: d44808a2785d6a...' ``` ## Python ```python from gradient import ProjectsClient api_key='d44808a2785d6a...' projects_client = ProjectsClient(api_key) print(projects_client.delete( project_id='prmximcci' )) ``` #### Options | Name | Type | Attributes | Description | |---|---|---|---| | `--id` | string | required | Project ID | | `--apiKey` | string | optional | API key to use this time only | | `--optionsFile` | string | optional | Path to YAML with predefined options | | `--createOptionsFile` | string | optional | Generate template options file | #### Response ## CLI ```text Project deleted ``` ## cURL ``` ``` ## Python ```text None ``` ## tags add Add tags to project #### Examples ## CLI ```bash gradient projects tags add \ --id "prmximcci" \ --tag "PyTorch" ``` ## cURL ```bash curl -X PUT 'https://api.paperspace.io/entityTags/updateTags' \ -H 'x-api-key: d44808a2785d6a...' \ -H 'Content-Type: application/json' \ --data-raw '{ "entity": "project", "entityId": "prmximcci", "tags": [ "PyTorch" ] }' ``` ## Python ```python from gradient import ProjectsClient api_key='d44808a2785d6a...' projects_client = ProjectsClient(api_key) print(projects_client.add_tags( entity_id='prmximcci', tags=['PyTorch'] )) ``` #### Options | Name | Type | Attributes | Description | |---|---|---|---| | `--id` | string | required | Project ID | | `--tag` | string | optional | One or many tags you want to add to project | | `--tags` | string | optional | Separated by comma tags that you want to add to project | | `--apiKey` | string | optional | API key to use this time only | | `--optionsFile` | string | optional | Path to YAML with predefined options | | `--createOptionsFile` | string | optional | Generate template options file | #### Response ## CLI ```text Tags added to project ``` ## cURL ```json [ { "tagId": 47, "entity": "project", "entityId": 272292, "dtCreated": "2022-03-22T07:03:30.564Z", "dtDeleted": null, "userId": 750386, "id": 7555, "entity_id": 272292, "tag": { "name": "PyTorch", "dtCreated": "2020-02-13T18:16:58.406Z", "id": 47 } } ] ``` ## Python ```text None ``` ## tags remove Remove tags from project #### Examples ## CLI ```bash gradient projects tags remove \ --id "prmximcci" \ --tag "PyTorch" ``` ## cURL ```bash curl -X PUT 'https://api.paperspace.io/entityTags/updateTags' \ -H 'x-api-key: d44808a2785d6a...' \ -H 'Content-Type: application/json' \ --data-raw '{ "entity": "project", "entityId": "prmximcci", "tags": [] }' ``` ## Python ```python from gradient import ProjectsClient api_key='d44808a2785d6a...' projects_client = ProjectsClient(api_key) print(projects_client.remove_tags( entity_id='prmximcci', tags=['PyTorch'] )) ``` #### Options | Name | Type | Attributes | Description | |---|---|---|---| | `--id` | string | required | Project ID | | `--tag` | string | optional | One or many tags you want to add to project | | `--tags` | string | optional | Separated by comma tags that you want to add to project | | `--apiKey` | string | optional | API key to use this time only | | `--optionsFile` | string | optional | Path to YAML with predefined options | | `--createOptionsFile` | string | optional | Generate template options file | #### Response ## CLI ```text Tags removed from project ``` ## cURL ```json [] ``` ## Python ```text None ```