Esempio n. 1
0
    def __init__(self, dal, **kwargs):

        self.dal = dal

        self.logger = create_logger(logger_name=type(self).__name__,
                                    logger_level=kwargs.get(
                                        "logger_level", "DEBUG"))
Esempio n. 2
0
    def __init__(self, api_key: str, **kwargs):
        """Constructor and initialization.

        Args:
            api_key (str): The Google Places API key.
        """

        # Internalize arguments.
        self.api_key = api_key

        self.logger = create_logger(logger_name=type(self).__name__,
                                    logger_level=kwargs.get(
                                        "logger_level", "DEBUG"))
# coding=utf-8

import multiprocessing
from typing import List, Dict, Optional, Tuple, Union

import sqlalchemy.orm
from fform.dals_pubmed import DalPubmed
from fform.orm_pubmed import AffiliationCanonical

from pubmed_ingester.config import import_config
from pubmed_ingester.loggers import create_logger
from pubmed_ingester.retrievers import RetrieverGoogleMaps
from pubmed_ingester.retrievers import get_place_details
from pubmed_ingester.utils import chunk_generator

logger = create_logger(logger_name=__name__)

api_keys = [
    "AIzaSyCJ65svcyTj2fEpBgjNhL7_Zk7yhfQxh6Y",
    "AIzaSyBBU2IJcRgMtYnCEgYwoVVTIZ_tR-kKg_g",
    "AIzaSyBhYcbF_PtLpA_BuckzQfd2A6XeWxF3s-Y",
    "AIzaSyDhG5rV9SNu0uQV88lq9QvjXRXI_Mzz3Lo",
]


def _get_address_component_name(
        address_components: List[Dict],
        include_types: Tuple[str],
        exclude_types: Optional[Tuple[str, ...]] = (),
) -> Union[str, None]: