Skip to main content

Panorma

A lightweight Python package (just over 50 lines of code) that enables you to create typed models for Pandas DataFrames using classes.

You can easily define structured models, enforce column typing, enjoy autocompletion, and catch invalid column errors early in your DataFrame operations.

Simplify your data modeling and enhance the reliability of your DataFrame workflows.

Installation:

  pip install panorma

or

  poetry add panorma

Example:

  • Create some models:
from panorma.fields import String, Int, Float, DateTime, Categorical
from panorma.frames import DataFrame

class Users(DataFrame):
    name: String
    age: Int
    percentage: Float
    birth_date: DateTime


class Cars(DataFrame):
    car: String
    mpg: Float
    cylinders: Int
    displacement: Float
    horsepower: Float
    weight: Float
    acceleration: Float
    model: Int
    origin: Categorical
  • Instantiate your models as you instantiate a simple pandas dataframe
import pandas as pd

users = Users({
    "name": ['john', 'kevin'],
    "age": [99, 15],
    "percentage": [0.8, 7.3],
    "birth_date": [pd.Timestamp('20180310'), pd.Timestamp('20230910')],
})
cars = Cars(pd.read_csv('CAR_DATASET.csv'))
  • You will get autocompletion for models columns and pandas at the same time image

  • If the columns of your data are not matching your model, you will get a NotMatchingFields exception: image

  • If a column cannot be cast to the type declared in the model, you will get a ParseError exception: image

Release files for panorma 0.1.1

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

Source distribution (sdist)

Source distribution for panorma 0.1.1
File Size Uploaded
panorma-0.1.1.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for panorma 0.1.1
File Interpreter ABI Platform
panorma-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / panorma-0.1.1.tar.gz

Download URL panorma-0.1.1.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d19b13b258aabe62e33f88ebe6f0cadd04a2f492e3ce57911cf3d110327c60ab
BLAKE2b-256 checksum
How to use checksums
85964d5a4d1c9effa34f2508daf39c03404f549ae0cd792e5a2d91a6c6116bd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.9.13 Windows/10

Release files / panorma-0.1.1-py3-none-any.whl

Download URL panorma-0.1.1-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4344e68a267e5e4838984f17af75016fda0a83acf97ef5e046738715e4bb8710
BLAKE2b-256 checksum
How to use checksums
57a96b631aa50d074be1caeb38dd2919a139c6aa651aebd43364ed679df717d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.9.13 Windows/10

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 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