:doc:`Athena <../../athena>` / Client / import_notebook

***************
import_notebook
***************



.. py:method:: Athena.Client.import_notebook(**kwargs)

  

  Imports a single ``ipynb`` file to a Spark enabled workgroup. To import the notebook, the request must specify a value for either ``Payload`` or ``NoteBookS3LocationUri``. If neither is specified or both are specified, an ``InvalidRequestException`` occurs. The maximum file size that can be imported is 10 megabytes. If an ``ipynb`` file with the same name already exists in the workgroup, throws an error.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/athena-2017-05-18/ImportNotebook>`_  


  **Request Syntax**
  ::

    response = client.import_notebook(
        WorkGroup='string',
        Name='string',
        Payload='string',
        Type='IPYNB',
        NotebookS3LocationUri='string',
        ClientRequestToken='string'
    )
    
  :type WorkGroup: string
  :param WorkGroup: **[REQUIRED]** 

    The name of the Spark enabled workgroup to import the notebook to.

    

  
  :type Name: string
  :param Name: **[REQUIRED]** 

    The name of the notebook to import.

    

  
  :type Payload: string
  :param Payload: 

    The notebook content to be imported. The payload must be in ``ipynb`` format.

    

  
  :type Type: string
  :param Type: **[REQUIRED]** 

    The notebook content type. Currently, the only valid type is ``IPYNB``.

    

  
  :type NotebookS3LocationUri: string
  :param NotebookS3LocationUri: 

    A URI that specifies the Amazon S3 location of a notebook file in ``ipynb`` format.

    

  
  :type ClientRequestToken: string
  :param ClientRequestToken: 

    A unique case-sensitive string used to ensure the request to import the notebook is idempotent (executes only once).

     

    .. warning::

       

      This token is listed as not required because Amazon Web Services SDKs (for example the Amazon Web Services SDK for Java) auto-generate the token for you. If you are not using the Amazon Web Services SDK or the Amazon Web Services CLI, you must provide this token or the action will fail.

      

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'NotebookId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **NotebookId** *(string) --* 

        The ID assigned to the imported notebook.

        
  
  **Exceptions**
  
  *   :py:class:`Athena.Client.exceptions.InternalServerException`

  
  *   :py:class:`Athena.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`Athena.Client.exceptions.TooManyRequestsException`

  