:doc:`CodeArtifact <../../codeartifact>` / Client / describe_package

****************
describe_package
****************



.. py:method:: CodeArtifact.Client.describe_package(**kwargs)

  

  Returns a `PackageDescription <https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageDescription.html>`__ object that contains information about the requested package.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codeartifact-2018-09-22/DescribePackage>`_  


  **Request Syntax**
  ::

    response = client.describe_package(
        domain='string',
        domainOwner='string',
        repository='string',
        format='npm'|'pypi'|'maven'|'nuget'|'generic'|'ruby'|'swift'|'cargo',
        namespace='string',
        package='string'
    )
    
  :type domain: string
  :param domain: **[REQUIRED]** 

    The name of the domain that contains the repository that contains the package.

    

  
  :type domainOwner: string
  :param domainOwner: 

    The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.

    

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

    The name of the repository that contains the requested package.

    

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

    A format that specifies the type of the requested package.

    

  
  :type namespace: string
  :param namespace: 

    The namespace of the requested package. The package component that specifies its namespace depends on its type. For example:

     

    .. note::

      

      The namespace is required when requesting packages of the following formats:

       

      
      * Maven
       
      * Swift
       
      * generic
      

      

     

    
    * The namespace of a Maven package version is its ``groupId``.
     
    * The namespace of an npm or Swift package version is its ``scope``.
     
    * The namespace of a generic package is its ``namespace``.
     
    * Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.
    

    

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

    The name of the requested package.

    

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

    
    ::

      {
          'package': {
              'format': 'npm'|'pypi'|'maven'|'nuget'|'generic'|'ruby'|'swift'|'cargo',
              'namespace': 'string',
              'name': 'string',
              'originConfiguration': {
                  'restrictions': {
                      'publish': 'ALLOW'|'BLOCK',
                      'upstream': 'ALLOW'|'BLOCK'
                  }
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **package** *(dict) --* 

        A `PackageDescription <https://docs.aws.amazon.com/codeartifact/latest/APIReference/API_PackageDescription.html>`__ object that contains information about the requested package.

        
        

        - **format** *(string) --* 

          A format that specifies the type of the package.

          
        

        - **namespace** *(string) --* 

          The namespace of the package. The package component that specifies its namespace depends on its type. For example:

           

          
          * The namespace of a Maven package version is its ``groupId``.
           
          * The namespace of an npm or Swift package version is its ``scope``.
           
          * The namespace of a generic package is its ``namespace``.
           
          * Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.
          

          
        

        - **name** *(string) --* 

          The name of the package.

          
        

        - **originConfiguration** *(dict) --* 

          The package origin configuration for the package.

          
          

          - **restrictions** *(dict) --* 

            A ``PackageOriginRestrictions`` object that contains information about the upstream and publish package origin configuration for the package.

            
            

            - **publish** *(string) --* 

              The package origin configuration that determines if new versions of the package can be published directly to the repository.

              
            

            - **upstream** *(string) --* 

              The package origin configuration that determines if new versions of the package can be added to the repository from an external connection or upstream source.

              
        
      
    
  
  **Exceptions**
  
  *   :py:class:`CodeArtifact.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`CodeArtifact.Client.exceptions.InternalServerException`

  
  *   :py:class:`CodeArtifact.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`CodeArtifact.Client.exceptions.ThrottlingException`

  
  *   :py:class:`CodeArtifact.Client.exceptions.ValidationException`

  