ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Share Package

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Shares a package by uploading to ArcGIS online.

Legacy:

Signing in to ArcGIS Online or Portal for ArcGIS through ArcGIS for Desktop changed in the ArcGIS for Desktop 10.2 release. You must sign in to ArcGIS Online or Portal by clicking File > Sign In before launching the tool, if you see <Not signed into ArcGIS.com> in the Username parameter. See Signing in to ArcGIS Online in ArcGIS for Desktop applications for more information.

Usage

  • Supported package types include:
    • geoprocessing packages (.gpk)
    • layer packages (.lpk)
    • locator packages (.gcpk)
    • map packages (.mpk)
    • map tile packages (.tpk)
  • To share a package to ArcGIS online, your Esri Global Account needs to be registered as a member of ArcGIS online. To create an Esri Global Account and register it, go to arcgis.com/home/signup.html.
  • To share a package with ArcGIS online, a summary and one or more tags are required. The required summary and tags, along with optional package description and credits, will be used when searching for packages online.
  • If a package of the same name already exists on ArcGIS online, it will be overwritten.
  • Note:

    This tool may have limited use in a Python script outside of ArcGIS applications when sharing a package to a portal that uses OAUTH2 authentication. The ArcGIS.com Portal for example, uses this authentication method. To authenticate, you must connect directly to the Portal from the application. You will only be able to use this tool in a Python script if the application is open and connected to the Portal, or you're connecting to a Portal which uses traditional authentication mechanisms and allow the username and password to be passed in.

Syntax

SharePackage_management (in_package, username, password, summary, tags, {credits}, {public}, {groups})
ParameterExplanationData Type
in_package

Input layer (.lpk), map (.mpk), geoprocessing (.gpk), map tile (.tpk), or address locator (.gcpk) package file.

File
username

Esri Global Account user name. This parameter will have limited use from a Python script when sharing a package to a portal that uses OAUTH2 authentication. See the usage notes for more information.

String
password

Esri Global Account password. This parameter will have limited use from a Python script when sharing a package to a portal that uses OAUTH2 authentication. See the usage notes for more information.

Encrypted String
summary

Summary of package. The summary is displayed in the item information of the package on ArcGIS.com.

String
tags

Tags used to describe and identify the package. Individual tags are separated using either a comma or semicolon.

String
credits
(Optional)

Credits for the package. This is generally the name of the organization that is given credit for authoring and providing the content for the package.

String
public
(Optional)

Specifies whether input package will be shared and available to everybody.

  • EVERYBODY — Package will be shared with everybody.
  • MYGROUPS — Package will be shared with package owner and any selected group. This is the default.
Boolean
groups
[group_name,...]
(Optional)

List of groups to share package with.

String

Code sample

SharePackage example 1 (Python window)

Code sample that takes a layer package and shares it to ArcGIS Online.

import arcpy
arcpy.SharePackage_management(r"C:\states.lpk","username","password","this is a summary","tag1, tag2","Credits","MYGROUPS","My_Group")
SharePackage example 2 (stand-alone script)

Find all the map packages that reside in a specified folder and share them on ArcGIS online.

# Name: SharePackageExample.py
# Description:  Find all the map packages that reside in a specified folder and share them on ArcGIS online.

# import system modules
import os
import arcpy

# Set environment settings
arcpy.env.overwriteOutput = True
arcpy.env.workspace = "C:/data/my_packages" 

# Loop through the workspace, find all the layer and map packages 
for mpk in arcpy.ListFiles("*.mpk"):
    print("Sharing " + mpk)
    arcpy.SharePackage_management(mpk,"username","password","This is a summary","tag1, tag2","Credits","MYGROUPS","My_Group")

Environments

  • Current Workspace

Licensing information

  • ArcGIS for Desktop Basic: Yes
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • An overview of the Package toolset
  • Adding data from ArcGIS Online

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal