Skip to content

tbroadley/sandpaper

 
 

Repository files navigation

image

PyPi Status

Supported Versions

Release Status

Last Commit

License

Documentation Status

Build Status

Code Coverage

Requirements Status

Say Thanks

Basic Usage

Learn more by reading the documentation!

from sandpaper import SandPaper

paper = SandPaper('my-sandpaper')\
   .strip(                                  # strip whitespace from column comment
      column_filter=r'comment'
   )\
   .translate_text({                        # get group id from column group
      r'^group_(\d+)$': '{0}'
   }, column_filter=r'group')\
   .translate_date({                        # normalize date from column date
      '%Y-%m-%d': '%c',
      '%m-%d': '%c'
   }, column_filter=r'date')

# apply sandpaper rules to a source file and write results to a target file
paper.apply('/home/you/source.csv', '/home/you/target.csv')

About

Python module for table type data normalization

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%