ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

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
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Extract Package

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

Summary

Extracts the contents of a package to a specified folder. The output folder will be updated with the extracted contents of the input package.

Usage

  • Supported package types include:

    • Geoprocessing Packages (.gpk)
    • Layer Packages (.lpk)
    • Map Packages (.mpk)
    • Locator Packages (.gcpk)
    • Tile Packages (.tpk)

  • The output folder can be a new folder or an existing folder. When extracting to an existing folder, the contents of the package will be appended to existing files and folders. If the output folder already contains the extracted contents of the package, the existing contents will be overwritten.

  • Packages with attachments will have their attached files unpacked to the commondata\userdata\ subfolder in the Output Folder. Typically the files inside a package are supporting files, like a .pdf, .docx or an image. You will need to navigate to the extracted directory in Windows Explorer to open these files.

Syntax

ExtractPackage_management (in_package, output_folder)
ParameterExplanationData Type
in_package

The input package that will be extracted.

File
output_folder

The output folder to contain the contents of the package.

Folder

Code sample

ExtractPackage example 1 (Python window)

The following Python window script demonstrates how to use the ExtractPackage tool.

arcpy.env.workspace = "C:/arcgis/ArcTutor/Getting_Started/Greenvalley" 
arcpy.ExtractPackage_management('WaterUsePackage.lpk', 'C:/My_Data/Packages/WaterUse_unpacked')
ExtractPackage example 2 (stand-alone script)

Find all Geoprocesssing Packages within a specified folder and use the ExtractPackage tool to extract contents to specified folder.

# Name: ExtractPackage.py
# Description: Find Geoprocesssing Packages within a specified folder and extract contents.

import arcpy
import os

arcpy.env.overwriteOutput = True
# set folder that contains packages to extract
arcpy.env.workspace = "C:/geoprocessing/gpks" 
wrksp = arcpy.env.workspace

for gpk in arcpy.ListFiles("*.gpk"):
    print("Extracting... " + gpk)
    arcpy.ExtractPackage_management(gpk, os.path.splitext(gpk)[0])
print("done")

Environments

  • Current Workspace

Licensing information

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

Related topics

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

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • 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 © 2017 Esri. | Privacy | Legal