Skip to main content

nbase-converter

nbase-converter is a native Rust/Arrow Python package for reading, writing, and converting SAS7BDAT, SAS XPORT v5/v8, and Parquet datasets.

This is an alpha release. Final Windows SAS 9.4 validation of the production SAS7BDAT writer remains required before stable 1.0.0 compatibility is declared.

Install

python -m pip install nbase-converter==0.0.2

Python 3.11 through 3.14 is supported on 64-bit Linux, macOS, and Windows.

Example

from nbase_converter import convert_dataset, filter_field, read_dataset, write_dataset

result = read_dataset(
    "input.xpt",
    columns=["USUBJID", "AGE"],
    filter=filter_field("AGE") >= 18,
    output="pandas",
)

write_dataset(
    result.data,
    "output.parquet",
    target_format="parquet",
    overwrite=True,
)

convert_dataset(
    "source.parquet",
    "submission.xpt",
    target_format="xpt8",
    metadata={
        "dataset_label": "Adverse Events",
        "columns": {
            "ASTDT": {
                "label": "Analysis Start Date",
                "sas": {"format": "IS8601DA", "length": 8},
            }
        },
    },
)

The public dataset operations are:

  • read_dataset: materialized, streaming, or metadata-only reads with projection, row bounds, encoding selection, and structured filters.
  • write_dataset: Arrow-compatible writes to Parquet, XPT v5/v8, or SAS7BDAT.
  • convert_dataset: bounded-memory full-file conversion with optional supplemental metadata.

For writes and conversions, explicit metadata overrides recognized input metadata while omitted attributes remain preserved. Supported supplemental attributes are the dataset label and each column's label, SAS format, informat, and storage length. For string attributes, "" explicitly clears an inherited value; whitespace-only labels remain literal labels.

Structured filters are created with filter_field, combined with filter_all, filter_any, or filter_not, and evaluated by these leaf helpers:

  • comparisons: filter_equal, filter_not_equal, filter_less_than, filter_less_than_or_equal, filter_greater_than, and filter_greater_than_or_equal;
  • collections and text: filter_in, filter_between, filter_contains, filter_starts_with, and filter_ends_with;
  • missing values: filter_is_missing, filter_is_not_missing, filter_is_null, and filter_is_not_null.

Python comparison operators are also available on filter_field(...). Public result and metadata contracts ship as TypedDict definitions, and the wheel is marked as a typed package.

The default cross-format type policy accepts Float64 and UTF-8 text. Non-null IEEE NaNs are written as standard SAS numeric missing values and reported as coercions. Local filesystem paths are the only supported storage interface in this release.

Source, issues, release notes, and the full contract are available from the Bitbucket repository.

Metadata

Release files for nbase-converter 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nbase-converter 0.0.2
File Size Uploaded
nbase_converter-0.0.2.tar.gz 359.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for nbase-converter 0.0.2
File Interpreter ABI Platform
nbase_converter-0.0.2-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
nbase_converter-0.0.2-cp311-abi3-manylinux_2_34_x86_64.whl CPython 3.11 abi3 Linux glibc 2.34+ x86-64 Details
nbase_converter-0.0.2-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details

Total release size: 10.0 MB

Release files / nbase_converter-0.0.2.tar.gz

Download URL nbase_converter-0.0.2.tar.gz
Size 359.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b00c1c0164e1d24293cd10a59c6664640081f1447264732accfb503381b6605c
BLAKE2b-256 checksum
How to use checksums
de8f51f9dcc7d4b5240ba854b8de9a75885ce67aa0c99c2f90a586032afe393d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / nbase_converter-0.0.2-cp311-abi3-win_amd64.whl

Download URL nbase_converter-0.0.2-cp311-abi3-win_amd64.whl
Size 3.1 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1879f30527c0aeb7366bc6a39f1fb85427fef61f156d6bfbd9f08994aa1a6aad
BLAKE2b-256 checksum
How to use checksums
fea7dfbcae3b1a481e6b979d8c1e2e1a2100003ef787ef0424351ce38256fdb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / nbase_converter-0.0.2-cp311-abi3-manylinux_2_34_x86_64.whl

Download URL nbase_converter-0.0.2-cp311-abi3-manylinux_2_34_x86_64.whl
Size 3.4 MB
Tags CPython 3.11 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
b52b967f100e43a7a6d79066c42975be0451797e35aa0cf03e3e628c62872b3f
BLAKE2b-256 checksum
How to use checksums
61575e9be37f7742310e7a79066e161d767cfe7359568f3f450d2bd87247e399
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / nbase_converter-0.0.2-cp311-abi3-macosx_10_12_x86_64.whl

Download URL nbase_converter-0.0.2-cp311-abi3-macosx_10_12_x86_64.whl
Size 3.1 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ace94ac6bd503fe982d148966f75b5db4b78ada62f590c17d574113cfa6de9b8
BLAKE2b-256 checksum
How to use checksums
9a7dd03b23230ffd072a08f86bd5aa2d2546c80ed4aefb755cfd6da62d8d99ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.0.6

4 release files

0.0.5

4 release files

0.0.4

4 release files

0.0.3

4 release files

This release

0.0.2 This release

4 release files

0.0.1

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page