korneevm / import_me

Python library to simplify importing data from xls/xlsx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

import me

Build Status Maintainability Test Coverage PyPI version PyPI - Python Version

Python tool for importing and validating data from xlsx/xls/csv files.

Example

from import_me import BaseXLSXParser, Column

>>> class XLSXParser(BaseXLSXParser):
...     columns = [
...         Column('first_name', index=0, header='First Name'),
...         Column('last_name', index=1, header='Last Name'),
...     ]

>>> parser = XLSXParser(file_path=xlsx_filepath)
>>> parser()
>>> print(parser.has_errors)  # False
>>> pprint(parser.cleaned_data)
[
    {
        'first_name': 'Ivan',
        'last_name': 'Ivanov',
        'row_index': 1,
    },
    {
        'first_name': 'Petr',
        'last_name': 'Petrov',
        'row_index': 2,
    },
]

Installation

pip install import_me

Contributing

We would love you to contribute to our project. It's simple:

  • Create an issue with bug you found or proposal you have. Wait for approve from maintainer.
  • Create a pull request. Make sure all checks are green.
  • Fix review comments if any.
  • Be awesome.

Here are useful tips:

About

Python library to simplify importing data from xls/xlsx


Languages

Language:Python 99.7%Language:Makefile 0.3%