Metadata-Version: 2.1
Name: dataframe-mapper
Version: 0.0.2
Summary: Object-oriented pandas DataFrame mapper.
Home-page: https://pypi.org/project/dataframe-mapper/
Author: Tsuyoshi Tokuda
Author-email: tokuda109@gmail.com
License: MIT
Keywords: pandas
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Provides-Extra: test
Provides-Extra: lint
Requires-Dist: pandas (>=0.23.0)
Provides-Extra: lint
Requires-Dist: pylint (==1.9.1); extra == 'lint'
Provides-Extra: test
Requires-Dist: pytest (==3.5.1); extra == 'test'

DataFrame Mapper
================

**THIS IS EXPERIMENTAL**.

Requirements
------------

- Python 3.5+
- Pandas 0.20.0+

Installation
------------

Install DataFrame Mapper via pip::

    $ pip install dataframe-mapper

Example
-------

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[self.df.id == id]

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

    user_dfm.validate()
    #: True

    user_dfm.find_by_id(1)
    #:    id username       profile
    #: 0  1  Bessie Bennett BLAH BLAH BLAH

License
-------

DataFrame Mapper is licensed under MIT License. See `LICENSE <https://github.com/tokuda109/dataframe-mapper/blob/master/LICENSE>`_ for more information.


