Skip to main content

print spss metadata

Project description

SPSS Metadata Printer ๐Ÿ“Š

Easy-to-use Python package for extracting, viewing, and exporting metadata from SPSS files with beautiful formatting.

โœจ Features

  • ๐Ÿ“‹ Pretty-print comprehensive SPSS metadata to console
  • ๐Ÿ’พ Export metadata summaries to text files automatically saved to Downloads
  • ๐Ÿ”„ Support for Pandas and Polars DataFrames
  • ๐Ÿ“Š Detailed variable information including labels, types, and value mappings
  • ๐ŸŽจ Beautiful table formatting with configurable width and display options

๐Ÿš€ Quick Start

Installation

pip install metaprinter

Basic Usage

import pyreadstat
from metaprinter import print_metadata, export_metadata

# Load your SPSS file
df, meta = pyreadstat.read_sav('data.sav')

# Display beautiful metadata summary
summary = print_metadata(df, meta)

# Export to Downloads/metadata_summary.txt
export_path = export_metadata(df, meta)

Output Preview:

============================================================
SPSS FILE METADATA
============================================================
File encoding   : 'UTF-8'
Number of cols  : 25
Number of rows  : 100
Table name      : 'Table'
File label      : 'Customer Satisfaction Survey'
Notes           : 'Notes'

VARIABLE METADATA
============================================================
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ column        โ”† dtype   โ”† column_n โ”† n_uniques โ”† n_categories โ”† column_label        โ”† value_labels        โ”‚
โ”‚ ---           โ”† ---     โ”† ---      โ”† ---       โ”† ---          โ”† ---                 โ”† ---                 โ”‚
โ”‚ str           โ”† str     โ”† i64      โ”† i64       โ”† i64          โ”† str                 โ”† str                 โ”‚
โ•žโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ก
โ”‚ respondent_id โ”† Int64   โ”† 1547     โ”† 1547      โ”† 0            โ”† Respondent ID       โ”†                     โ”‚
โ”‚ satisfaction  โ”† Int64   โ”† 1523     โ”† 5         โ”† 5            โ”† Satisfaction Level  โ”† {                   โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "1": "Very Low",  โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "2": "Low",       โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "3": "Neutral",   โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "4": "High",      โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "5": "Very High"  โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”† }                   โ”‚
โ”‚ age           โ”† Int64   โ”† 1534     โ”† 6         โ”† 6            โ”† Age Group Category  โ”† {                   โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "1": "18-25",     โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "2": "26-35",     โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "3": "36-45",     โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "4": "46-55",     โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "5": "56-65",     โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”†   "6": "65+"        โ”‚
โ”‚               โ”†         โ”†          โ”†           โ”†              โ”†                     โ”† }                   โ”‚
โ”‚ ...           โ”† ...     โ”† ...      โ”† ...       โ”† ...          โ”† ...                 โ”† ...                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Advanced Configuration:

# Customize table width for narrow displays
print_metadata(df, meta, max_width=120)

# Control column truncation
print_metadata(df, meta, show_all_columns=False)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metaprinter-0.1.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metaprinter-0.1.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file metaprinter-0.1.2.tar.gz.

File metadata

  • Download URL: metaprinter-0.1.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.9

File hashes

Hashes for metaprinter-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8afee0e7622eca63588b7899892a1c0aab5b04ac9e78fb446913bb09eb8fca91
MD5 13e1809441b88efaa6f76adc04dc884c
BLAKE2b-256 66f9ce82c3596cd3caaca552a4e9af17a328d62fec0afff4f5e28ceb64e75aaa

See more details on using hashes here.

File details

Details for the file metaprinter-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for metaprinter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0390b74b9d84f73b021fa089ce9ff8bfcb2aa5023e8e7f1d9b205e07282be93b
MD5 83e28514acb09c46b5e52bc8f1e71f94
BLAKE2b-256 ee21b33b087ae10ec7f178d870c6acb0d99031d60ce018b1a4b0d24dbf526220

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page