Skip to main content

Object-oriented pandas DataFrame mapper.

Project description



  • Python 3.5+
  • Pandas 0.20.0+


Install DataFrame Mapper via pip:

$ pip install dataframe-mapper


Simple DataFrame Mapper example:

from dfmapper import DataFrameMapper, IntColumn, StrColumn

class UserDfm(DataFrameMapper):

    id = IntColumn(min=1, nullable=False)
    username = StrColumn(max_length=30, nullable=False)
    profile = StrColumn()

    def find_by_id(self, id):
        return self.df[ == id]

user_dfm = UserDfm({
    "id": [1, 2, 3],
    "username": ["Bessie Bennett", "Sandra Matthews", "Jessie Bates"],
    "profile": ["BLAH BLAH BLAH", "PITH PITH PITH", None]

#: True

#:    id username       profile
#: 0  1  Bessie Bennett BLAH BLAH BLAH


DataFrame Mapper is licensed under MIT License. See LICENSE for more information.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for dataframe-mapper, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size dataframe_mapper-0.0.3-py3-none-any.whl (6.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size dataframe-mapper-0.0.3.tar.gz (5.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page