Logo maphew

File-gdb statistics

 

Get feature class/raster file size in file geodatabase from standalone script#

I'm currently trying to make a standalone script to list the file size of data present in a file geodatabase such as feature classes and rasters. I know this information is available when in the catalog view of ArcGIS Pro where one of the column shows the size of datasets in kilobytes.

I've began looking at acquiring this information via arcpy but from my research it seems this type of information can only be acquired via the sdk.

So far I've found this property https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic27573.html  but, correct me if I'm wrong, it seems to be only accessible when executing code as an add-in and not as a standalone script.

My question would thus be if I'm on the right path or there's another way to get file sizes of datasets in a file geodatabase.

– Nicolas Racine
https://community.esri.com/t5/arcgis-pro-sdk-questions/get-feature-class-raster-file-size-in-file/td-p/1316153

I wrote (with LLM) something up for this using python and Fiona library. It does not rely on arcpy or arcgis sdk - so no warranties, YMMV, etc. It works for me and is much lighter and faster than using native esri tooling.

uv run GDB/get-fgdb-stats.py ^
  "D:\work\Nat_Hydro_Network\yt_nhn-nov-2025.gdb" ^
  --csv inventory.csv ^
  --xlsx inventory.xlsx
  
Scanning D:\work\Nat_Hydro_Network\yt_nhn-nov-2025.gdb...

  Name                             Type                             Geometry   Date Modified              Size KB 
 ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  NHN_HD_SLWATER_1                 File Geodatabase Feature Class   Line       2025-11-25 08:52:41 AM   2,722,484
  NHN_TO_NAMEDFEA_2                File Geodatabase Feature Class   Polygon    2025-11-25 08:52:41 AM   2,334,932
  NHN_HD_MANMADE_1                 File Geodatabase Feature Class   Line       2025-11-25 08:52:41 AM   1,757,635
  ...
  NHN_HN_DELIMITER_1               File Geodatabase Feature Class   Line       2025-11-25 08:52:41 AM          12
  NHN_HE_OBSTACLEPT_6              File Geodatabase Feature Class   None       2025-11-25 08:52:40 AM           8
  NHN_HE_MANMADEPT_6               File Geodatabase Feature Class   None       2025-11-25 08:52:40 AM           6

If I ever update it, the change is most likely to show up in https://github.com/maphew/mhwcode/tree/master/gis