Create File Geodatabase (Data Management Tools)
Summary
Creates a file geodatabase in a folder.
Usage
The output path must already exist.
If the output geodatabase name does not include the .gdb extension, it will be added.
Parameters
Label
Explanation
Data type
File Geodatabase Location
The folder where the file geodatabase will be created.
Folder
File GDB Name
The name of the file geodatabase to be created.
String
File Geodatabase Version
(Optional)
Specifies the ArcGIS version for the new geodatabase.
Current —A geodatabase compatible with the currently installed version of ArcGIS will be created. This is the default.
10.0 —A geodatabase compatible with ArcGIS version 10 will be created.
9.3 —A geodatabase compatible with ArcGIS version 9.3 will be created.
9.2 —A geodatabase compatible with ArcGIS version 9.2 will be created.
String
Derived output
Label
Explanation
Data type
Output File Geodatabase
The new output file geodatabase.
Workspace
arcpy.management.CreateFileGDB(out_folder_path, out_name, {out_version})
Name
Explanation
Data type
out_folder_path
The folder where the file geodatabase will be created.
Folder
out_name
The name of the file geodatabase to be created.
String
out_version
(Optional)
Specifies the ArcGIS version for the new geodatabase.
CURRENT —A geodatabase compatible with the currently installed version of ArcGIS will be created. This is the default.
10.0 —A geodatabase compatible with ArcGIS version 10 will be created.
9.3 —A geodatabase compatible with ArcGIS version 9.3 will be created.
9.2 —A geodatabase compatible with ArcGIS version 9.2 will be created.
String
Derived output
Name
Explanation
Data type
out_file_gdb
The new output file geodatabase.
Workspace
Code sample
CreateFileGDB example 1 (Python window)
The following Python window script demonstrates how to use the CreateFileGDB function in immediate mode.
import arcpy
arcpy.management.CreateFileGDB("C:/output", "fGDB.gdb")
CreateFileGDB example 2 (Python window)
The following Python window script demonstrates how to use the CreateFileGDB function in immediate mode to create a file geodatabase corresponding to a previous release of ArcGIS.
import arcpy
arcpy.management.CreateFileGDB("C:/output", "fGDB.gdb", "9.2")
CreateFileGDB example 3 (stand-alone script)
The following Python script demonstrates how to use the CreateFileGDB function in a stand-alone script.
# Name: CreateFileGDB_Example2.py
# Description: Create a file GDB
# Import system modules
import arcpy
# Set local variables
out_folder_path = "C:/output"
out_name = "fGDB.gdb"
# Run CreateFileGDB
arcpy.management.CreateFileGDB(out_folder_path, out_name)
Environments
Current Workspace , Scratch Workspace
Licensing information
Basic: Yes
Standard: Yes
Advanced: Yes