Description of image

projects

Note
A new Paperspace API is now available. The Gradient and Core API endpoints will become unavailable on 15 July, 2024. For more information, see the release notes.

create

Create new project

Examples

gradient projects create \
  --name "New Project"
curl -X POST 'https://api.paperspace.io/projects' \
-H 'x-api-key: d44808a2785d6a...' \
-H 'Content-Type: application/json' \
--data-raw '{
    "name": "New Project"
}'
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

Project created with ID: prmximcci
https://console.paperspace.com/paperspace-docs-team/projects/prmximcci
{
  "name": "New Project",
  "handle": "prmximcci",
  "dtCreated": "2022-03-22T06:34:52.360Z",
  "dtDeleted": null,
  "lastJobSeqNum": 0,
  "repoNodeId": null,
  "repoName": null,
  "repoUrl": null
}
prmximcci

details

Show details of a project

Examples

gradient projects details \
  --id "prmximcci"
curl -g -X GET 'https://api.paperspace.io/projects/?filter={"where":{"handle":"prmximcci"}}' \
-H 'x-api-key: d44808a2785d6a...'
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

+-----------------+-------------+
| Name            | New Project |
+-----------------+-------------+
| ID              | prmximcci   |
| Repository name | None        |
| Repository url  | None        |
| Tags            |             |
+-----------------+-------------+
{
  "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": []
}
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

gradient projects list
curl -X GET 'https://api.paperspace.io/projects' \
-H 'x-api-key: d44808a2785d6a...'
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

+-----------+----------------+------------+----------------------------+
| ID        | Name           | Repository | Created                    |
+-----------+----------------+------------+----------------------------+
| prmximcci | New Project    | None       | 2022-03-22 06:34:52.360000 |
+-----------+----------------+------------+----------------------------+
{
  "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": []
}
[
  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

gradient projects delete \
  --id "prmximcci"
curl -X POST 'https://api.paperspace.io/projects/prmximcci/deleteProject' \
-H 'x-api-key: d44808a2785d6a...'
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

Project deleted
None

tags add

Add tags to project

Examples

gradient projects tags add \
  --id "prmximcci" \
  --tag "PyTorch"
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"
    ]
}'
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

Tags added to project
[
  {
    "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
    }
  }
]
None

tags remove

Remove tags from project

Examples

gradient projects tags remove \
  --id "prmximcci" \
  --tag "PyTorch"
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": []
}'
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

Tags removed from project
[]
None