From 14010896a5617a7718a29f04c54c62e3c2720c01 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 16 Mar 2021 16:13:34 +0200 Subject: [PATCH] csv_metadata_quality/experimental.py: Move all imports to top of file PEP8 recommends keeping imports at the top of the file. Also, I had to re-work the issn/isbn so they didn't conflict with the functions in check.py (flake8 warned about them being redefined). Imports sorted with isort. See: https://www.python.org/dev/peps/pep-0008/#imports --- csv_metadata_quality/experimental.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/csv_metadata_quality/experimental.py b/csv_metadata_quality/experimental.py index 2633899..1444115 100644 --- a/csv_metadata_quality/experimental.py +++ b/csv_metadata_quality/experimental.py @@ -1,5 +1,9 @@ +import re + +import langid import pandas as pd from colorama import Fore +from pycountry import languages def correct_language(row): @@ -11,11 +15,6 @@ def correct_language(row): language and returns the value in the language field if it does match. """ - import re - - import langid - from pycountry import languages - # Initialize some variables at global scope so that we can set them in the # loop scope below and still be able to access them afterwards. language = ""