Gradient Docs
Gradient HomeHelp DeskCommunitySign up free
Gradient Next
Gradient Next
  • About Gradient
  • Get Started
    • Quick Start
      • Install the Gradient CLI
    • Core Concepts
    • Organizing Projects
      • Secrets
      • Storing an API key as a Secret
    • Tutorials
      • Gradient Notebooks Tutorial
      • Gradient Workflows Tutorial
      • Gradient Deployments Tutorial
    • FAQ
    • Common Errors
  • Gradient Platform
    • Gradient Notebooks
      • Runtimes
      • Files and storage
      • Machines
      • Terminal
      • Shortcuts
      • Sharing
      • TensorBoard
      • Run on Gradient
    • Gradient Workflows
      • Basic operations
      • Understanding Inputs & Outputs
      • Workflow Spec
      • Gradient Actions
      • Environment Variables
      • Using YAML for Data Science
    • Gradient Deployments
      • Basic operations
      • Deployment Spec
  • Artifacts
    • Container Management
      • Custom Containers
    • Data
      • Versioned Data
        • Public Datasets Repository
        • Storage Providers
      • Persistent Storage
    • Models
      • Managing Models
        • Model Types & Metadata
        • Public Models
    • Code
    • Metrics
      • Push Metrics
      • View & Query Metrics
  • Gradient Cluster
    • Overview
      • Setup
        • Managed Private Clusters
        • Self-Hosted Clusters
          • Pre-installation steps
          • Gradient Installer CLI
          • Terraform
            • Pre-installation steps
            • Install on AWS
            • Install on bare metal / VMs
            • Install on NVIDIA DGX
          • Let's Encrypt DNS Providers
          • Updating your cluster
      • Usage
  • More
    • SDK
      • Projects Client
      • Models Client
      • Deployments Client
      • Workflows Client
      • SDK Examples
      • Full SDK Reference
    • Machine Types
      • Machine Tiers
      • Free Machines (Free Tier)
    • Your Account
      • Teams
        • Creating a Team
        • Upgrading to a Team Plan
      • Hotkeys
      • Billing & Subscriptions
        • Storage Billing
      • Public Profiles
    • Release notes
    • Roadmap
Powered by GitBook
On this page
  • Importing
  • Creating Projects
  • Listing Projects
  • Projects Object
  • Getting Help
  1. More
  2. SDK

Projects Client

Importing

from gradient import ProjectsClient
api_key='YOUR_API_KEY'

projects_client = ProjectsClient(api_key)

Creating Projects

project_id = projects_client.create('your-project-name')
print("project_id: "+project_id)
project_id: prg8149k1

This returns the project ID of the newly created project. Saving this is useful to pass in as input or filter for other queries you make.

Listing Projects

projects_list = projects_client.list()
for project in project_list:
       print("project_id: "+project.id +" project_name: "+ project.name)   
project_id: prg8149k1 project_name: 'your-project-name'

Projects Object

class Project(builtins.object)
 |  Project class
 |  
 |  :param str id:
 |  :param str name:
 |  :param str repository_name:
 |  :param str repository_url:
 |  :param datetime created:

Getting Help

If you are ever stuck, you can call help on any ProjectsClient object or function

help(ProjectsClient.list)

Help on function list in module gradient.api_sdk.clients.project_client:

list(self)
    Get list of your projects
    
    *EXAMPLE*::
    
        gradient projects list
    
    *EXAMPLE RETURN*::
    
        +-----------+------------------+------------+----------------------------+
        | ID        | Name             | Repository | Created                    |
        +-----------+------------------+------------+----------------------------+
        | project-id| <name-of-project>| None       | 2019-06-28 10:38:57.874000 |
        | project-id| <name-of-project>| None       | 2019-07-17 13:17:34.493000 |
        | project-id| <name-of-project>| None       | 2019-07-17 13:21:12.770000 |
        | project-id| <name-of-project>| None       | 2019-07-29 09:26:49.105000 |
        +-----------+------------------+------------+----------------------------+
    
    in sdk::
    
        from gradient.api_sdk.clients import ProjectsClient
    
        api_key = 'your-api-key'
        projects_client = ProjectsClient(api_key)
    
        projects_list = projects_client.list()
    
        for project in project_list:
            print(project)
PreviousSDKNextModels Client

Last updated 3 years ago