Skip to main content

Routines for reading PDS3 tables

Project description

GitHub release; latest by date GitHub Release Date Test Status Documentation Status Code coverage
PyPI - Version PyPI - Format PyPI - Downloads PyPI - Python Version
GitHub commits since latest release GitHub commit activity GitHub last commit
Number of GitHub open issues Number of GitHub closed issues Number of GitHub open pull requests Number of GitHub closed pull requests
GitHub License Number of GitHub stars GitHub forks

Introduction

pdstable contains a class, PdsTable, that can read PDS3 or PDS4 labels and their associated tables.

pdstable is a product of the PDS Ring-Moon Systems Node.

Installation

The pdstable module is available via the rms-pdstable package on PyPI and can be installed with:

pip install rms-pdstable

Getting Started

The pdstable module provides the PdsTable class, which can be used to read both PDS3 (.lbl) and PDS4 (.lblx or .xml) labels and their associated tables. A PdsTable object can be created easily:

from pdstable import PdsTable
p3 = PdsTable('label_filename.lbl')  # PDS3 label and table
p4 = PdsTable('label_filename.xml')  # PDS4 label and table

Once created, the PdsTable object has properties that can be used to access the contents of the table. Columns of values are represented by NumPy arrays.

rows = p3.rows  # The number of rows
columns = p3.columns # The number of columns
col_vals = p3.get_column("FILE_SPEC")  # All values in the FILE_SPEC column
col_mask = p3.get_column_mask("FILE_SPEC")  # The mask of invalid values

The entire table can be returned as a series of dictionaries, one per row. The dictionary keys are the names of the columns:

as_dicts = p3.dicts_by_row()

PDS3 labels can only point to a single table. However, PDS4 labels can point to multiple tables. If multiple tables are present in the label, you must specify which table you want to read. This can be done using an integer index or specifying a filename or regular expression:

p4 = PdsTable('multi_table_label.xml', table_file=3)  # Load the 3rd table
p4 = PdsTable('multi_table_label.xml', table_file='.*summary_index.*')

A wide variety of other features are available, many of which are designed to increase performance. These include:

  • Specifying a subset of columns to parse.
  • Reading only a subset of rows.
  • Using a faster but less rigorous label parser for PDS3 labels.
  • Searching for rows with a specific volume or bundle name and/or file specification.

Full details can be found in the module documentation.

Contributing

Information on contributing to this package can be found in the Contributing Guide.

Links

Licensing

This code is licensed under the Apache License v2.0.

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

rms_pdstable-1.0.2.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

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

rms_pdstable-1.0.2-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file rms_pdstable-1.0.2.tar.gz.

File metadata

  • Download URL: rms_pdstable-1.0.2.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rms_pdstable-1.0.2.tar.gz
Algorithm Hash digest
SHA256 56cd963ba223dd9bbbc27427fb5135a5c61a3be5c8d4afeb58fde8efa7b2f016
MD5 1d66a1a7b399052e850c89b37bab1098
BLAKE2b-256 0cebb997a367776af427d35b39c3767ca875c815cb93a36e844b6fb38ccb1504

See more details on using hashes here.

File details

Details for the file rms_pdstable-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: rms_pdstable-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rms_pdstable-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 593c00d5d9f7aa9354fc8512d8ad676829b7442ca9d18ce6f4dc3cd9b815dfe4
MD5 47c75fc4b4e20afffe6f55dd3739af74
BLAKE2b-256 7a144c0e1c0d735c42d22cb41f2c4f84d8487dfe4bb7c0aa73c6e60923c7c67e

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