<commit_before># -*- coding: utf-8 _-*-


from dgis.binder import bind_api


__version__ = '0.3.0'


class API(object):
    """2GIS API"""

    def __init__(self, key, host='catalog.api.2gis.ru', version='1.3', cache=False):
        """

        Parameters::
            key : user API key
            host : base URL for queries
            version : API version for working
            cache : enable cache of the requests
        """

        self.key = key
        self.host = host
        self.version = version
        self.cache = cache

    """Projects lists

    http://api.2gis.ru/doc/firms/list/project-list/
    """
    project_list = bind_api(
        path='/project/list',
        allowed_param=[],
    )

    """List of the project cities

    http://api.2gis.ru/doc/firms/list/city-list/
    """
    city_list = bind_api(
        path='/city/list',
        allowed_param=['where', 'project_id']
    )

    """Rubrics search

    http://api.2gis.ru/doc/firms/list/rubricator/
    """
    rubricator = bind_api(
        path='/rubricator',
        allowed_param=['where', 'id', 'parent_id'],
    )

    """Firms search

    http://api.2gis.ru/doc/firms/searches/search/
    """
    search = bind_api(
        path='/search',
        allowed_param=['what', 'where', 'point', 'radius', 'bound', 'page', 'pagesize', 'sort', 'filters'],
    )

    """Firms search in rubric

    http://api.2gis.ru/doc/firms/searches/searchinrubric/
    """
    search_in_rubric = bind_api(
        path='/searchinrubric',
        allowed_param=['what', 'where', 'point', 'radius', 'bound', 'page', 'pagesize', 'sort', 'filters'],
    )

    """Firm filials

    http://api.2gis.ru/doc/firms/searches/firmsbyfilialid/
    """
    firms_by_filial_id = bind_api(
        path='/firmsByFilialId',
        allowed_param=['firmid',],
    )<commit_msg>Endpoint /ads/search for adverts search<commit_after># -*- coding: utf-8 _-*-


from dgis.binder import bind_api


__version__ = '0.3.0'


class API(object):
    """2GIS API"""

    def __init__(self, key, host='catalog.api.2gis.ru', version='1.3', cache=False):
        """

        Parameters::
            key : user API key
            host : base URL for queries
            version : API version for working
            cache : enable cache of the requests
        """

        self.key = key
        self.host = host
        self.version = version
        self.cache = cache

    """Projects lists

    http://api.2gis.ru/doc/firms/list/project-list/
    """
    project_list = bind_api(
        path='/project/list',
        allowed_param=[],
    )

    """List of the project cities

    http://api.2gis.ru/doc/firms/list/city-list/
    """
    city_list = bind_api(
        path='/city/list',
        allowed_param=['where', 'project_id']
    )

    """Rubrics search

    http://api.2gis.ru/doc/firms/list/rubricator/
    """
    rubricator = bind_api(
        path='/rubricator',
        allowed_param=['where', 'id', 'parent_id'],
    )

    """Firms search

    http://api.2gis.ru/doc/firms/searches/search/
    """
    search = bind_api(
        path='/search',
        allowed_param=['what', 'where', 'point', 'radius', 'bound', 'page', 'pagesize', 'sort', 'filters'],
    )

    """Firms search in rubric

    http://api.2gis.ru/doc/firms/searches/searchinrubric/
    """
    search_in_rubric = bind_api(
        path='/searchinrubric',
        allowed_param=['what', 'where', 'point', 'radius', 'bound', 'page', 'pagesize', 'sort', 'filters'],
    )

    """Firm filials

    http://api.2gis.ru/doc/firms/searches/firmsbyfilialid/
    """
    firms_by_filial_id = bind_api(
        path='/firmsByFilialId',
        allowed_param=['firmid',],
    )

    """Adverts search

    http://api.2gis.ru/doc/firms/searches/adssearch/
    """
    ads_search = bind_api(
        path='/ads/search',
        allowed_param=['what', 'where', 'format', 'page', 'pagesize'],
    )
{'fraction_non_alphanumeric': 0.1665391481764856, 'fraction_numerical': 0.007396072430502423, 'mean_word_length': 2.2253289473684212, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1825073', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1332, 'n_words': 243}