Skip to content

ihsn/nesstar-exporter

Repository files navigation

Nesstar Exporter

Nesstar Exporter is a Python package designed to facilitate the export of metadata from Nesstar files. This package allows users to extract DDI (Data Documentation Initiative) files, data files in various formats, and RDF (Resource Description Framework) from Nesstar Publisher.

Features

  • Core Export Functionality:

    • Export DDI files from Nesstar Publisher
    • Export data files in formats such as SPSS, Stata, and Delimited Text
    • Export RDF metadata
    • Generate comprehensive info.json with dataset metadata
  • Command Line Tools:

    • export-nesstar.py - General-purpose export utility with ZIP packaging
    • create-metadata-editor-package.py - Specialized tool for metadata editors
  • Advanced Options:

    • JSON-based configuration system
    • Automatic directory creation
    • Verbose logging and quiet modes
    • Flexible output formats and structures

Installation

To install the required dependencies, navigate to the project directory and run:

pip install -r requirements.txt

Usage

To use the Nesstar Exporter, you can create an instance of the NesstarExporter class and call the export_all method to perform the entire export process.

from src.exporter import NesstarExporter

exporter = NesstarExporter(nesstar_file='path/to/your/file.Nesstar',        output_folder='output/directory',nesstar_export_exe="/path/to/nesstar-exporter-exe")

exporter.export_all()

Usage example

Python notebook: see usage-example.ipynb

Command Line Utilities

This package includes two powerful command-line utilities for different use cases:

export-nesstar.py

A general-purpose CLI tool for exporting Nesstar files with extensive customization options.

Quick Start:

# Basic export
python export-nesstar.py myfile.Nesstar

# Export with ZIP package
python export-nesstar.py myfile.Nesstar --zip-package

# Custom output folder and format
python export-nesstar.py myfile.Nesstar output-folder --format SPSS_SAV --zip-package

Key Features:

  • Multiple export formats (SPSS, Stata, Delimited Text)
  • Metadata-only or full data exports
  • Automatic ZIP packaging
  • JSON configuration support
  • Comprehensive logging options

Documentation: See CLI-README.md for complete usage guide

create-metadata-editor-package.py

A specialized tool for exporting Nesstar files to Metadata Editor ZIP Package.

Quick Start:

# Create metadata editor package
python create-metadata-editor-package.py myfile.Nesstar

# Custom output location
python create-metadata-editor-package.py myfile.Nesstar my-package-name

# Create ZIP and clean up folder
python create-metadata-editor-package.py myfile.Nesstar --cleanup

Key Features:

  • Automatic CSV conversion from tab-delimited files
  • Organized folder structure with documentation/ subfolder
  • Metadata-editor compatible file formats
  • Ready-to-use ZIP packages
  • DDI and RDF metadata preservation
  • Optional cleanup (delete folder after ZIP creation)

What it creates:

  • info.json - Dataset metadata and file inventory
  • *.xml - DDI documentation
  • *.rdf - RDF metadata
  • documentation/*.csv - Data files in CSV format

Documentation: See METADATA-EDITOR-README.md for detailed information

Configuration

Both utilities use a shared config.json file for common settings:

{
  "nesstar_export_exe": "path/to/NesstarExporter.exe",
  "create_subdirectories": true,
  "verbose_logging": false
}

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Extract DDI, RDF, and Data from Nesstar Publisher

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors