Extract Package (Data Management)

License Level:BasicStandardAdvanced

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

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

from arcpy import env

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

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

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
5/7/2015