repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
Nominatim | Nominatim-master/nominatim/api/search/icu_tokenizer.py | # SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Implementation of query analysis for the ICU tokenizer.
"""
from typing import Tuple, Dict, List, Optiona... | 11,732 | 38.240803 | 94 | py |
Nominatim | Nominatim-master/nominatim/api/search/geocoder.py | # SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Public interface to the search code.
"""
from typing import List, Any, Optional, Iterator, Tuple
import i... | 7,448 | 37.796875 | 100 | py |
Nominatim | Nominatim-master/nominatim/api/search/db_search_fields.py | # SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Data structures for more complex fields in abstract search descriptions.
"""
from typing import List, Tup... | 7,269 | 32.971963 | 91 | py |
Nominatim | Nominatim-master/nominatim/api/search/db_search_builder.py | # SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Convertion from token assignment to an abstract DB search.
"""
from typing import Optional, List, Tuple, ... | 17,524 | 45.118421 | 98 | py |
Nominatim | Nominatim-master/nominatim/api/search/__init__.py | # SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Module for forward search.
"""
# pylint: disable=useless-import-alias
from .geocoder import (ForwardGeoc... | 510 | 30.9375 | 80 | py |
Nominatim | Nominatim-master/nominatim/api/search/token_assignment.py | # SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Create query interpretations where each vertice in the query is assigned
a specific function (expressed a... | 14,523 | 39.569832 | 100 | py |
Nominatim | Nominatim-master/nominatim/api/search/query.py | # SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Datastructures for a tokenized query.
"""
from typing import List, Tuple, Optional, NamedTuple, Iterator
... | 9,201 | 32.220217 | 88 | py |
Nominatim | Nominatim-master/nominatim/api/search/legacy_tokenizer.py | # SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Implementation of query analysis for the legacy tokenizer.
"""
from typing import Tuple, Dict, List, Opti... | 10,691 | 39.653992 | 94 | py |
Nominatim | Nominatim-master/nominatim/clicmd/special_phrases.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Implementation of the 'special-phrases' command.
"""
import argparse
import logging
from pathlib import P... | 3,842 | 39.882979 | 91 | py |
Nominatim | Nominatim-master/nominatim/clicmd/add_data.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Implementation of the 'add-data' subcommand.
"""
from typing import cast
import argparse
import logging
impo... | 4,735 | 45.431373 | 104 | py |
Nominatim | Nominatim-master/nominatim/clicmd/setup.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Implementation of the 'import' subcommand.
"""
from typing import Optional
import argparse
import logging
fro... | 9,731 | 45.564593 | 96 | py |
Nominatim | Nominatim-master/nominatim/clicmd/refresh.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Implementation of 'refresh' subcommand.
"""
from typing import Tuple, Optional
import argparse
import logging... | 8,530 | 45.36413 | 102 | py |
Nominatim | Nominatim-master/nominatim/clicmd/args.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Provides custom functions over command-line arguments.
"""
from typing import Optional, List, Dict, Any, Sequ... | 7,561 | 28.084615 | 96 | py |
Nominatim | Nominatim-master/nominatim/clicmd/api.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Subcommand definitions for API calls from the command line.
"""
from typing import Mapping, Dict, Any
import ... | 16,244 | 40.335878 | 97 | py |
Nominatim | Nominatim-master/nominatim/clicmd/admin.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Implementation of the 'admin' subcommand.
"""
import logging
import argparse
from nominatim.tools.exec_utils... | 3,803 | 40.347826 | 91 | py |
Nominatim | Nominatim-master/nominatim/clicmd/__init__.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Subcommand definitions for the command-line tool.
"""
# mypy and pylint disagree about the style of explicit ... | 1,262 | 45.777778 | 89 | py |
Nominatim | Nominatim-master/nominatim/clicmd/freeze.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Implementation of the 'freeze' subcommand.
"""
import argparse
from nominatim.db.connection import connect
f... | 1,298 | 28.522727 | 78 | py |
Nominatim | Nominatim-master/nominatim/clicmd/index.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Implementation of the 'index' subcommand.
"""
import argparse
import psutil
from nominatim.db import status... | 2,502 | 36.924242 | 89 | py |
Nominatim | Nominatim-master/nominatim/clicmd/replication.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Implementation of the 'replication' sub-command.
"""
from typing import Optional
import argparse
import datet... | 8,838 | 42.975124 | 92 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/base.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Abstract class definitions for tokenizers. These base classes are here
mainly for documentation purposes.
"""... | 8,402 | 33.438525 | 82 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/icu_tokenizer.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tokenizer implementing normalisation as used before Nominatim 4 but using
libICU instead of the PostgreSQL mo... | 31,837 | 38.113022 | 96 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/place_sanitizer.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Handler for cleaning name and address tags in place information before it
is handed to the token analysis.
""... | 2,020 | 36.425926 | 93 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/factory.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Functions for creating a tokenizer or initialising the right one for an
existing database.
A tokenizer is so... | 3,695 | 34.883495 | 82 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/icu_token_analysis.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Container class collecting all components required to transform an OSM name
into a Nominatim token.
"""
from ... | 1,784 | 39.568182 | 101 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/__init__.py | 0 | 0 | 0 | py | |
Nominatim | Nominatim-master/nominatim/tokenizer/icu_rule_loader.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Helper class to create ICU rules from a configuration file.
"""
from typing import Mapping, Any, Dict, Option... | 7,603 | 37.598985 | 93 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/legacy_tokenizer.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tokenizer implementing normalisation as used before Nominatim 4.
"""
from typing import Optional, Sequence, L... | 25,781 | 37.423249 | 99 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/sanitizers/base.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Common data types and protocols for sanitizers.
"""
from typing import Optional, List, Mapping, Callable
fro... | 2,199 | 32.846154 | 83 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/sanitizers/strip_brace_terms.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
This sanitizer creates additional name variants for names that have
addendums in brackets (e.g. "Halle (Saale... | 1,207 | 33.514286 | 79 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/sanitizers/delete_tags.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Sanitizer which prevents certain tags from getting into the search index.
It remove tags which matches all pr... | 5,178 | 39.147287 | 95 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/sanitizers/tag_analyzer_by_language.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
This sanitizer sets the `analyzer` property depending on the
language of the tag. The language is taken from ... | 3,902 | 38.03 | 89 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/sanitizers/clean_housenumbers.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Sanitizer that preprocesses address tags for house numbers. The sanitizer
allows to
* define which tags are ... | 3,085 | 37.098765 | 81 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/sanitizers/config.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Configuration for Sanitizers.
"""
from typing import Sequence, Union, Optional, Pattern, Callable, Any, TYPE_... | 6,546 | 42.072368 | 93 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/sanitizers/clean_postcodes.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Sanitizer that filters postcodes by their officially allowed pattern.
Arguments:
convert-to-address: If ... | 3,130 | 37.654321 | 87 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/sanitizers/__init__.py | 0 | 0 | 0 | py | |
Nominatim | Nominatim-master/nominatim/tokenizer/sanitizers/clean_tiger_tags.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Sanitizer that preprocesses tags from the TIGER import.
It makes the following changes:
* remove state refe... | 1,390 | 28.595745 | 77 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/sanitizers/split_name_list.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Sanitizer that splits lists of names into their components.
Arguments:
delimiters: Define the set of cha... | 1,208 | 29.225 | 78 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/token_analysis/base.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Common data types and protocols for analysers.
"""
from typing import Mapping, List, Any
from nominatim.typi... | 4,057 | 40.835052 | 84 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/token_analysis/generic_mutation.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Creator for mutation variants for the generic token analysis.
"""
from typing import Sequence, Iterable, Iter... | 2,073 | 34.758621 | 91 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/token_analysis/postcodes.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Specialized processor for postcodes. Supports a 'lookup' variant of the
token, which produces variants with o... | 2,446 | 36.075758 | 114 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/token_analysis/config_variants.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Parser for configuration for variants.
"""
from typing import Any, Iterator, Tuple, List, Optional, Set, Name... | 4,506 | 31.192857 | 86 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/token_analysis/housenumbers.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Specialized processor for housenumbers. Analyses common housenumber patterns
and creates variants for them.
"... | 2,487 | 34.042254 | 117 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/token_analysis/generic.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Generic processor for names that creates abbreviation variants.
"""
from typing import Mapping, Dict, Any, It... | 5,698 | 36.741722 | 94 | py |
Nominatim | Nominatim-master/nominatim/tokenizer/token_analysis/__init__.py | 0 | 0 | 0 | py | |
Nominatim | Nominatim-master/nominatim/indexer/indexer.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Main work horse for indexing (computing addresses) the database.
"""
from typing import Optional, Any, cast
i... | 8,831 | 35.345679 | 97 | py |
Nominatim | Nominatim-master/nominatim/indexer/runners.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Mix-ins that provide the actual commands for the indexer for various indexing
tasks.
"""
from typing import A... | 7,344 | 36.284264 | 99 | py |
Nominatim | Nominatim-master/nominatim/indexer/progress.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Helpers for progress logging.
"""
import logging
from datetime import datetime
LOG = logging.getLogger()
IN... | 2,551 | 33.026667 | 93 | py |
Nominatim | Nominatim-master/nominatim/indexer/__init__.py | 0 | 0 | 0 | py | |
Nominatim | Nominatim-master/nominatim/utils/__init__.py | 0 | 0 | 0 | py | |
Nominatim | Nominatim-master/nominatim/utils/json_writer.py | # SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Streaming JSON encoder.
"""
from typing import Any, TypeVar, Optional, Callable
import io
try:
import... | 4,693 | 30.293333 | 88 | py |
Nominatim | Nominatim-master/nominatim/utils/centroid.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Functions for computation of centroids.
"""
from typing import Tuple, Any
from collections.abc import Collect... | 1,510 | 29.22 | 74 | py |
Nominatim | Nominatim-master/nominatim/data/postcode_format.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Functions for formatting postcodes according to their country-specific
format.
"""
from typing import Any, Ma... | 4,356 | 36.886957 | 92 | py |
Nominatim | Nominatim-master/nominatim/data/place_info.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Wrapper around place information the indexer gets from the database and hands to
the tokenizer.
"""
from typi... | 2,999 | 33.482759 | 81 | py |
Nominatim | Nominatim-master/nominatim/data/__init__.py | 0 | 0 | 0 | py | |
Nominatim | Nominatim-master/nominatim/data/country_info.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Functions for importing and managing static country information.
"""
from typing import Dict, Any, Iterable, ... | 6,230 | 34.403409 | 92 | py |
Nominatim | Nominatim-master/nominatim/data/place_name.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Data class for a single name of a place.
"""
from typing import Optional, Dict, Mapping
class PlaceName:
... | 2,816 | 34.658228 | 89 | py |
Nominatim | Nominatim-master/nominatim/server/__init__.py | 0 | 0 | 0 | py | |
Nominatim | Nominatim-master/nominatim/server/starlette/server.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Server implementation using the starlette webserver framework.
"""
from typing import Any, Optional, Mapping,... | 3,127 | 31.583333 | 87 | py |
Nominatim | Nominatim-master/nominatim/server/starlette/__init__.py | 0 | 0 | 0 | py | |
Nominatim | Nominatim-master/nominatim/server/falcon/server.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Server implementation using the falcon webserver framework.
"""
from typing import Optional, Mapping, cast, A... | 3,536 | 30.580357 | 96 | py |
Nominatim | Nominatim-master/nominatim/server/falcon/__init__.py | 0 | 0 | 0 | py | |
Nominatim | Nominatim-master/test/python/mock_legacy_word_table.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Legacy word table for testing with functions to prefil and test contents
of the table.
"""
class MockLegacyW... | 3,840 | 37.029703 | 85 | py |
Nominatim | Nominatim-master/test/python/cursor.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Specialised psycopg2 cursor with shortcut functions useful for testing.
"""
import psycopg2.extras
class Cur... | 2,221 | 31.676471 | 83 | py |
Nominatim | Nominatim-master/test/python/conftest.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
import itertools
import sys
from pathlib import Path
import psycopg2
import pytest
# always test against the so... | 7,129 | 28.832636 | 95 | py |
Nominatim | Nominatim-master/test/python/dummy_tokenizer.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tokenizer for testing.
"""
from nominatim.data.place_info import PlaceInfo
from nominatim.config import Confi... | 1,869 | 21.804878 | 71 | py |
Nominatim | Nominatim-master/test/python/mocks.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Custom mocks for testing.
"""
import itertools
import psycopg2.extras
from nominatim.db import properties
... | 3,474 | 38.488636 | 104 | py |
Nominatim | Nominatim-master/test/python/mock_icu_word_table.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Legacy word table for testing with functions to prefil and test contents
of the table.
"""
class MockIcuWord... | 4,622 | 36.893443 | 96 | py |
Nominatim | Nominatim-master/test/python/cli/test_cmd_api.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2023 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for API access commands of command-line interface wrapper.
"""
import json
import pytest
import nomina... | 5,980 | 33.976608 | 86 | py |
Nominatim | Nominatim-master/test/python/cli/test_cli.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for command line interface wrapper.
These tests just check that the various command line parameters ro... | 6,969 | 35.492147 | 95 | py |
Nominatim | Nominatim-master/test/python/cli/conftest.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
import pytest
import nominatim.cli
class MockParamCapture:
""" Mock that records the parameters with which ... | 2,567 | 27.853933 | 80 | py |
Nominatim | Nominatim-master/test/python/cli/test_cmd_admin.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Test for the command line interface wrapper admin subcommand.
These tests just check that the various comman... | 1,991 | 31.655738 | 94 | py |
Nominatim | Nominatim-master/test/python/cli/test_cmd_import.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for import command of the command-line interface wrapper.
"""
import pytest
import nominatim.tools.dat... | 5,561 | 42.795276 | 93 | py |
Nominatim | Nominatim-master/test/python/cli/test_cmd_replication.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for replication command of command-line interface wrapper.
"""
import datetime as dt
import time
impor... | 5,435 | 33.405063 | 95 | py |
Nominatim | Nominatim-master/test/python/cli/test_cmd_refresh.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for command line interface wrapper for refresk command.
"""
import pytest
import nominatim.tools.refre... | 4,806 | 39.737288 | 104 | py |
Nominatim | Nominatim-master/test/python/tools/test_refresh_setup_website.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for setting up the website scripts.
"""
import subprocess
import pytest
from nominatim.tools import r... | 3,149 | 29 | 105 | py |
Nominatim | Nominatim-master/test/python/tools/test_exec_utils.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for tools.exec_utils module.
"""
from pathlib import Path
import subprocess
import pytest
from nomina... | 5,050 | 33.59589 | 111 | py |
Nominatim | Nominatim-master/test/python/tools/test_migration.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for migration functions
"""
import pytest
import psycopg2.extras
from nominatim.tools import migration... | 8,965 | 36.991525 | 101 | py |
Nominatim | Nominatim-master/test/python/tools/test_sp_wiki_loader.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for methods of the SPWikiLoader class.
"""
import pytest
from nominatim.tools.special_phrases.sp_wi... | 2,434 | 40.982759 | 93 | py |
Nominatim | Nominatim-master/test/python/tools/conftest.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
import pytest
@pytest.fixture
def osm2pgsql_options(temp_db):
""" A standard set of options for osm2pgsql.
... | 670 | 30.952381 | 62 | py |
Nominatim | Nominatim-master/test/python/tools/test_replication.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for replication functionality.
"""
import datetime as dt
import time
import pytest
from osmium.replica... | 5,398 | 35.234899 | 204 | py |
Nominatim | Nominatim-master/test/python/tools/test_refresh_create_functions.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for creating PL/pgSQL functions for Nominatim.
"""
import pytest
from nominatim.tools.refresh import c... | 1,991 | 33.344828 | 81 | py |
Nominatim | Nominatim-master/test/python/tools/test_refresh_address_levels.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for function for importing address ranks.
"""
import json
from pathlib import Path
import pytest
from... | 3,351 | 35.835165 | 88 | py |
Nominatim | Nominatim-master/test/python/tools/test_freeze.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for freeze functions (removing unused database parts).
"""
from nominatim.tools import freeze
NOMINATI... | 1,704 | 27.416667 | 80 | py |
Nominatim | Nominatim-master/test/python/tools/test_check_database.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for database integrity checks.
"""
import pytest
from nominatim.tools import check_database as chkdb
... | 4,137 | 38.788462 | 95 | py |
Nominatim | Nominatim-master/test/python/tools/test_postcodes.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for functions to maintain the artificial postcode table.
"""
import subprocess
import pytest
from nom... | 9,265 | 37.769874 | 112 | py |
Nominatim | Nominatim-master/test/python/tools/test_refresh.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Test for various refresh functions.
"""
from pathlib import Path
import pytest
from nominatim.tools import ... | 4,188 | 40.068627 | 96 | py |
Nominatim | Nominatim-master/test/python/tools/test_sp_csv_loader.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for methods of the SPCsvLoader class.
"""
import pytest
from nominatim.errors import UsageError
fr... | 1,453 | 28.08 | 81 | py |
Nominatim | Nominatim-master/test/python/tools/test_admin.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for maintenance and analysis functions.
"""
import pytest
from nominatim.errors import UsageError
from... | 2,800 | 37.369863 | 90 | py |
Nominatim | Nominatim-master/test/python/tools/test_database_import.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for functions to import a new database.
"""
from pathlib import Path
from contextlib import closing
im... | 8,715 | 33.587302 | 92 | py |
Nominatim | Nominatim-master/test/python/tools/test_import_special_phrases.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for import special phrases methods
of the class SPImporter.
"""
from shutil import copyfile
imp... | 9,308 | 37.466942 | 99 | py |
Nominatim | Nominatim-master/test/python/tools/test_tiger_data.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Test for tiger data function
"""
import tarfile
from textwrap import dedent
import pytest
from nominatim.to... | 5,836 | 35.943038 | 94 | py |
Nominatim | Nominatim-master/test/python/tools/test_add_osm_data.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for functions to add additional data to the database.
"""
from pathlib import Path
import pytest
from... | 2,355 | 36.396825 | 95 | py |
Nominatim | Nominatim-master/test/python/config/test_config_load_module.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Test for loading extra Python modules.
"""
from pathlib import Path
import sys
import pytest
from nominatim... | 2,656 | 31.402439 | 89 | py |
Nominatim | Nominatim-master/test/python/config/test_config.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Test for loading dotenv configuration.
"""
from pathlib import Path
import pytest
from nominatim.config impo... | 13,664 | 29.986395 | 90 | py |
Nominatim | Nominatim-master/test/python/db/test_sql_preprocessor.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for SQL preprocessing.
"""
import pytest
from nominatim.db.sql_preprocessor import SQLPreprocessor
@p... | 2,034 | 34.701754 | 92 | py |
Nominatim | Nominatim-master/test/python/db/test_async_connection.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for function providing a non-blocking query interface towards PostgreSQL.
"""
from contextlib import cl... | 3,065 | 25.894737 | 84 | py |
Nominatim | Nominatim-master/test/python/db/test_connection.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for specialised connection and cursor classes.
"""
import pytest
import psycopg2
from nominatim.db.con... | 3,150 | 24.827869 | 78 | py |
Nominatim | Nominatim-master/test/python/db/test_status.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for status table manipulation.
"""
import datetime as dt
import pytest
import nominatim.db.status
fro... | 5,025 | 34.394366 | 204 | py |
Nominatim | Nominatim-master/test/python/db/test_properties.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for property table manpulation.
"""
import pytest
from nominatim.db import properties
@pytest.fixture... | 1,470 | 29.645833 | 83 | py |
Nominatim | Nominatim-master/test/python/db/test_utils.py | # SPDX-License-Identifier: GPL-2.0-only
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2022 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Tests for DB utility functions in db.utils
"""
import json
import pytest
import nominatim.db.utils as db_ut... | 4,824 | 28.968944 | 83 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.