package create

Creates a Python package as a zip file that can be uploaded to a stage and imported for a Snowpark Python app.

Syntax

snow snowpark package create
  <name>
  --connection <connection>
  --account <account>
  --user <user>
  --password <password>
  --authenticator <authenticator>
  --private-key-path <private_key_path>
  --database <database>
  --schema <schema>
  --role <role>
  --warehouse <warehouse>
  --temporary-connection
  --mfa-passcode <mfa_passcode>
  --format <format>
  --verbose
  --debug
  --silent
Copy

Arguments

name NAME

Name of the package to create.

Options

--connection, -c, --environment TEXT

Name of the connection, as defined in your config.toml. Default: default.

--account, --accountname TEXT

Name assigned to your Snowflake account. Overrides the value specified for the connection.

--user, --username TEXT

Username to connect to Snowflake. Overrides the value specified for the connection.

--password TEXT

Snowflake password. Overrides the value specified for the connection.

--authenticator TEXT

Snowflake authenticator. Overrides the value specified for the connection.

--private-key-path TEXT

Snowflake private key path. Overrides the value specified for the connection.

--database, --dbname TEXT

Database to use. Overrides the value specified for the connection.

--schema, --schemaname TEXT

Database schema to use. Overrides the value specified for the connection.

--role, --rolename TEXT

Role to use. Overrides the value specified for the connection.

--warehouse TEXT

Warehouse to use. Overrides the value specified for the connection.

--temporary-connection, -x

Uses connection defined with command line parameters, instead of one defined in config.

--mfa-passcode TEXT

Token to use for multi-factor authentication (MFA).

--format [TABLE|JSON]

Specifies the output format.

--verbose, -v

Displays log entries for log levels info and higher.

--debug

Displays log entries for log levels debug and higher; debug logs contains additional information.

--silent

Turns off intermediate output to console.

--help

Displays the help text for this command.

Usage notes

The snowpark package crate command, does the following:

  • Creates an artifact ready to upload to a stage.

  • Checks for native libraries and asks if you want to continue. If the native libraries are present in the downloaded packages, this command works the same as the snowpark package build command.

This command does not currently support download packages available on Conda.

Examples

  • When a package is not available in the Conda channel:

    snow snowpark package create PyGame
    
    Copy
    Nothing found for PyGame. Most probably, package is not avaiable on Snowflake Anaconda channel.
    Please check the package name or try again with --pypi-download option.
    
  • When a package is not available in the Conda channel and contains native libraries:

    snow snowpark package create PyGame --pypi-download
    
    Copy
    WARNING! Some packages appear to have native libraries!
    Continue with package installation? [y/N]: y
    Package PyGame.zip created. You can now upload it to a stage (`snow snowpark package upload -f PyGame.zip -s <stage-name>`) and reference it in your procedure or function.
    
  • When a package is available in the Conda channel:

    snow snowpark package create numpy
    
    Copy
    Package numpy is available on the Snowflake Anaconda channel.