# Path: openfisca_survey_manager/read_sas.py
# def read_sas(sas_file_path, clean = False):
#     try:
#         import pyreadstat
#         data_frame, _ = pyreadstat.read_sas7bdat(sas_file_path)
#     except ImportError as e1:
#         log.info("pyreadstat not available trying SAS7BDAT")
#         try:
#             from sas7bdat import SAS7BDAT
#             data_frame = SAS7BDAT(sas_file_path).to_data_frame()
#         except ImportError as e2:
#             log.info("Neither pyreadstat nor SAS7BDAT are available")
#             print(e1)
#             raise(e2)
# 
#     return data_frame


import os
import pkg_resources
from openfisca_survey_manager.read_sas import read_sas
# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# OpenFisca is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.





def test():
    sas_file_path = os.path.join(
        pkg_resources.get_distribution('openfisca-survey-manager').location,
        'openfisca_survey_manager',
        'tests',
        'data_files',
        'help.sas7bdat',
        )
    read_sas(sas_file_path, clean = False)

# Path: openfisca_survey_manager/read_sas.py
# def read_sas(sas_file_path, clean = False):
#     try:
#         import pyreadstat
#         data_frame, _ = pyreadstat.read_sas7bdat(sas_file_path)
#     except ImportError as e1:
#         log.info("pyreadstat not available trying SAS7BDAT")
#         try:
#             from sas7bdat import SAS7BDAT
#             data_frame = SAS7BDAT(sas_file_path).to_data_frame()
#         except ImportError as e2:
#             log.info("Neither pyreadstat nor SAS7BDAT are available")
#             print(e1)
#             raise(e2)
# 
#     return data_frame


# Path: openfisca_survey_manager/tests/test_read_sas.py
import os
import pkg_resources
from openfisca_survey_manager.read_sas import read_sas

# https://github.com/openfisca
#
# This file is part of OpenFisca.
#
# OpenFisca is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# OpenFisca is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.





def test():
    sas_file_path = os.path.join(
        pkg_resources.get_distribution('openfisca-survey-manager').location,
        'openfisca_survey_manager',
        'tests',
        'data_files',
        'help.sas7bdat',
        )
    read_sas(sas_file_path, clean = False)

    read_sas(sas_file_path, clean = True)