Skip to main content

Typed Wrappers over Pandas DataFrames with schema validation

Project description

typedframe

Typed Wrappers over Pandas DataFrames with schema validation.

    >>> from typedframe import TypedDataFrame
    >>> class MyTable(TypedDataFrame):
    ...    schema = {
    ...        "col1": object, # str
    ...        "col2": np.int32,
    ...        "col3": 'category'
    ...    }
    ...    optional = {
    ...        "col4": bool,
               "col5": np.dtype('datetime64[ns]')
    ...    }

    >>> df = pd.DataFrame({"col1": ['foo'], "col2": np.array([1], dtype=np.int32), "col3": ['bar']})
    >>> df.col3 = df.col3.astype("category")
    >>> print(MyTable(df).df)

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

typedframe-0.1.1.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

typedframe-0.1.1-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

Supported by

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