rms-pdstable
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 number of rows can also be read from the label alone, without reading the table:
rows = PdsTable.rows_from_label('label_filename.lbl')
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()
A large table can instead be streamed one row dictionary at a time, reading and parsing
only a chunk of rows at once. Construct it with defer_load=True so that the whole table
is not loaded first:
big = PdsTable('big_index.lbl', defer_load=True)
for row in big.iter_dicts(chunk_rows=5000): # or simply: for row in big:
print(row['FILE_SPEC'])
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.
- Streaming rows from a large table without loading all of it.
- 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.
Metadata
Release files for rms-pdstable 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rms_pdstable-1.2.0.tar.gz | 1.9 MB | Without provenance | Details for rms_pdstable-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rms_pdstable-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for rms_pdstable-1.2.0-py3-none-any.whl |
Total release size: 1.9 MB
Release files / rms_pdstable-1.2.0.tar.gz
| Download URL | rms_pdstable-1.2.0.tar.gz |
|---|---|
| Size | 1.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b86b9f0425b769385de94394e52a3e6b18c831ad272daf3c1e05b9b6ddbf372f
|
|
BLAKE2b-256 checksum How to use checksums |
1270e600970de0479ba91f6fe09533389c5cf7b40d7a2df846528d42835358d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / rms_pdstable-1.2.0-py3-none-any.whl
| Download URL | rms_pdstable-1.2.0-py3-none-any.whl |
|---|---|
| Size | 36.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b2f0c125dc241cb0cd81d6a95fce74d4fc8ed94130141fe23f85ac2fef24811e
|
|
BLAKE2b-256 checksum How to use checksums |
c0def7282f558c3f5b2c975e30d9dd13c62e0853c7c782a23fb6827321da7994
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for rms-pdstable 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.