DOI: 10.34808/6qky-6063
title: Forest data organizer Python tool

description: VERSION 2.0:
PDF extraction pipeline added.
Modified (5 files):

forest_data_organizer.py - Added auto-detection of input file (original XLSX / PDF-extracted XLSX / PDF-extracted CSV), CSV loading support, Windows console Unicode fix
requirements.txt - Added pymupdf&gt;=1.23.0
README.md - Documented two-step workflow (extraction → analysis), pdf_data_extractor.py reference
USAGE_EXAMPLES.md - Added PDF extraction usage examples
METHOD_VALIDATION.md - Added PDF extraction accuracy validation vs. official LP publications

Created (2 files):

pdf_data_extractor.py - Standalone PDF extraction pipeline (~800 lines);  handles two PDF layout formats (pre-2012 and post-2012), outputs FINAL_forest_database_PDF_extracted.csv/.xlsx
CHANGES_LOG_2026-02-24.txt - Detailed record of all modifications
 VERSION 1.1:
The visualisation feature added. 
Modified (3 files):• forest_data_organizer.py - Added ~400 lines of visualization code (7 plotting methods, 300 DPI output)• requirements.txt - Added matplotlib&gt;=3.4.0• README.md - Documented visualization features
Created (1 file):• generate_visualizations.py - Standalone utility to regenerate visualizations from CSV files\
  DESCRIPTION
This dataset contains a Python tool for processing forest inventory data and calculating standard forestry and ecological metrics. The tool reads Excel spreadsheets containing forest inventory data and outputs organized datasets with derived variables. All formulas based on published literature. See code documentation for specific citations. The related dataset https://doi.org/10.34808/nhf1-dg46  provides processed data for immediate use, whereas this dataset provides the processing tool for users with their own inventory data or custom analysis requirements.
Input processing:

Reads XLSX format inventory file
Standardizes species names to forestry codes
Parses age class categories
Classifies tree types and age categories

Metric calculation:

Biodiversity indices: Shannon Index (H' = -Σ(pi × ln(pi))), Simpson Index (D = 1 - Σ(pi²)), Pielou's Evenness (J' = H'/ln(S)), Species Richness
Age structure: Weighted mean age, age class distribution percentages, coefficient of variation
Composition: Coniferous/deciduous ratios by area and volume, dominant species identification
Growth: Mean Annual Increment (Volume/(Area × Age)), Current Annual Increment (ΔVolume/Area)
Temporal: Year-over-year changes in area and volume

Data provenance tracking:

Tags each derived value with source type
Categories: RAW, RAW_SUMMED, CALCULATED, COUNTED, DETERMINED, ESTIMATED
Generates metadata file explaining categories

Implementation Details:

Language: Python 3.7+
Dependencies: pandas (≥1.3.0), numpy (≥1.21.0), scipy (≥1.7.0), openpyxl (≥3.0.0)
Lines of code: ~680
Processing time: &lt;10 seconds for 1,260 records

Input Requirements:

Excel file (.xlsx) with columns:
Species (text)
Year (integer)
Tree_Type (text)
Category (text, e.g., "Age_41-60")
Volume_m3 (float)
Area_ha (float)

Documentation:

README: Installation, usage, API reference
Usage examples: 16 practical scenarios
Validation report: Detailed test results

Limitations:
- Designed for hierarchical age-class inventory data- Assumes standard forestry category naming conventions- Growth metrics require age class information- MAI calculation depends on age class midpoint estimates