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.3.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.3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metaprinter-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 4a071666123e0c6a9f745416bfc674b0dd95e14d697082cb9d2ae392858fca86
MD5 8a4235026824f7561e788efaa13396c8
BLAKE2b-256 9e2bd19665096180a0692f410f55cec187a1d784bd0e36538e1a3b1654fbfa3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for metaprinter-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 382fad37763f555af93985133e4196ff93603f86a4a8444ff76ff2ea3cf05f2f
MD5 48ee76514e001f5bd694166aea38c7dc
BLAKE2b-256 5d5e2881803bb594575ed92f62926c3a8922274b0bfe5cf73c41130bb33afde2

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