overture-schema-theme-addresses 0.1.1.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- overture_schema_theme_addresses-0.1.1.dev0/PKG-INFO +18 -0
- overture_schema_theme_addresses-0.1.1.dev0/README.md +3 -0
- overture_schema_theme_addresses-0.1.1.dev0/pyproject.toml +69 -0
- overture_schema_theme_addresses-0.1.1.dev0/pyproject.toml.orig +68 -0
- overture_schema_theme_addresses-0.1.1.dev0/src/overture/schema/addresses/__init__.py +10 -0
- overture_schema_theme_addresses-0.1.1.dev0/src/overture/schema/addresses/address.py +172 -0
- overture_schema_theme_addresses-0.1.1.dev0/src/overture/schema/addresses/py.typed +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: overture-schema-theme-addresses
|
|
3
|
+
Version: 0.1.1.dev0
|
|
4
|
+
Summary: Overture Maps addresses theme models and structures
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Requires-Dist: overture-schema-common>=0.1.1
|
|
7
|
+
Requires-Dist: overture-schema-system>=0.1.1
|
|
8
|
+
Requires-Dist: pydantic>=2.13.0
|
|
9
|
+
Maintainer: Overture Maps Schema Working Group
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Project-URL: Homepage, https://overturemaps.org
|
|
12
|
+
Project-URL: Source, https://github.com/OvertureMaps/schema
|
|
13
|
+
Project-URL: Issues, https://github.com/OvertureMaps/schema/issues
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# Overture Schema Addresses Theme
|
|
17
|
+
|
|
18
|
+
Feature types and shared components for the Overture Maps addresses theme.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
dependencies = [
|
|
3
|
+
"overture-schema-common>=0.1.1",
|
|
4
|
+
"overture-schema-system>=0.1.1",
|
|
5
|
+
"pydantic>=2.13.0",
|
|
6
|
+
]
|
|
7
|
+
description = "Overture Maps addresses theme models and structures"
|
|
8
|
+
version = "0.1.1.dev0"
|
|
9
|
+
license = "MIT"
|
|
10
|
+
name = "overture-schema-theme-addresses"
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
|
|
14
|
+
[[project.maintainers]]
|
|
15
|
+
name = "Overture Maps Schema Working Group"
|
|
16
|
+
|
|
17
|
+
[project.urls]
|
|
18
|
+
Homepage = "https://overturemaps.org"
|
|
19
|
+
Source = "https://github.com/OvertureMaps/schema"
|
|
20
|
+
Issues = "https://github.com/OvertureMaps/schema/issues"
|
|
21
|
+
|
|
22
|
+
[project.entry-points."overture.models"]
|
|
23
|
+
address = "overture.schema.addresses:Address"
|
|
24
|
+
|
|
25
|
+
[project.entry-points.pytest11]
|
|
26
|
+
overture_baselines = "overture.schema.system.testing.plugin"
|
|
27
|
+
|
|
28
|
+
[tool.uv.sources.overture-schema-common]
|
|
29
|
+
workspace = true
|
|
30
|
+
|
|
31
|
+
[tool.uv.sources.overture-schema-system]
|
|
32
|
+
workspace = true
|
|
33
|
+
|
|
34
|
+
[tool.uv.build-backend]
|
|
35
|
+
module-name = "overture.schema.addresses"
|
|
36
|
+
|
|
37
|
+
[tool.pytest.ini_options]
|
|
38
|
+
pythonpath = ["src"]
|
|
39
|
+
testpaths = ["tests"]
|
|
40
|
+
|
|
41
|
+
[build-system]
|
|
42
|
+
requires = ["uv_build>=0.11.32,<0.13"]
|
|
43
|
+
build-backend = "uv_build"
|
|
44
|
+
|
|
45
|
+
[[examples.Address]]
|
|
46
|
+
id = "416ab01c-d836-4c4f-aedc-2f30941ce94d"
|
|
47
|
+
geometry = "POINT (-176.5637854 -43.9471955)"
|
|
48
|
+
country = "NZ"
|
|
49
|
+
street = "Tikitiki Hill Road"
|
|
50
|
+
number = "54"
|
|
51
|
+
version = 1
|
|
52
|
+
theme = "addresses"
|
|
53
|
+
type = "address"
|
|
54
|
+
|
|
55
|
+
[examples.Address.bbox]
|
|
56
|
+
xmin = -176.56381225585938
|
|
57
|
+
xmax = -176.56378173828125
|
|
58
|
+
ymin = -43.94719696044922
|
|
59
|
+
ymax = -43.94718933105469
|
|
60
|
+
|
|
61
|
+
[[examples.Address.address_levels]]
|
|
62
|
+
value = "Chatham Islands"
|
|
63
|
+
|
|
64
|
+
[[examples.Address.address_levels]]
|
|
65
|
+
value = "Chatham Island"
|
|
66
|
+
|
|
67
|
+
[[examples.Address.sources]]
|
|
68
|
+
property = ""
|
|
69
|
+
dataset = "OpenAddresses/LINZ"
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
maintainers = [
|
|
3
|
+
{name = "Overture Maps Schema Working Group"},
|
|
4
|
+
]
|
|
5
|
+
dependencies = [
|
|
6
|
+
"overture-schema-common>=0.1.1",
|
|
7
|
+
"overture-schema-system>=0.1.1",
|
|
8
|
+
"pydantic>=2.13.0",
|
|
9
|
+
]
|
|
10
|
+
description = "Overture Maps addresses theme models and structures"
|
|
11
|
+
version = "0.1.1.dev0"
|
|
12
|
+
license = "MIT"
|
|
13
|
+
name = "overture-schema-theme-addresses"
|
|
14
|
+
readme = "README.md"
|
|
15
|
+
requires-python = ">=3.10"
|
|
16
|
+
|
|
17
|
+
[project.urls]
|
|
18
|
+
Homepage = "https://overturemaps.org"
|
|
19
|
+
Source = "https://github.com/OvertureMaps/schema"
|
|
20
|
+
Issues = "https://github.com/OvertureMaps/schema/issues"
|
|
21
|
+
|
|
22
|
+
[tool.uv.sources]
|
|
23
|
+
overture-schema-common = { workspace = true }
|
|
24
|
+
overture-schema-system = { workspace = true }
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
[build-system]
|
|
28
|
+
requires = ["uv_build>=0.11.32,<0.13"]
|
|
29
|
+
build-backend = "uv_build"
|
|
30
|
+
|
|
31
|
+
[tool.uv.build-backend]
|
|
32
|
+
module-name = "overture.schema.addresses"
|
|
33
|
+
|
|
34
|
+
[tool.pytest.ini_options]
|
|
35
|
+
pythonpath = ["src"]
|
|
36
|
+
testpaths = ["tests"]
|
|
37
|
+
|
|
38
|
+
[project.entry-points."overture.models"]
|
|
39
|
+
address = "overture.schema.addresses:Address"
|
|
40
|
+
|
|
41
|
+
[project.entry-points.pytest11]
|
|
42
|
+
overture_baselines = "overture.schema.system.testing.plugin"
|
|
43
|
+
|
|
44
|
+
[[examples.Address]]
|
|
45
|
+
id = "416ab01c-d836-4c4f-aedc-2f30941ce94d"
|
|
46
|
+
geometry = "POINT (-176.5637854 -43.9471955)"
|
|
47
|
+
country = "NZ"
|
|
48
|
+
street = "Tikitiki Hill Road"
|
|
49
|
+
number = "54"
|
|
50
|
+
version = 1
|
|
51
|
+
theme = "addresses"
|
|
52
|
+
type = "address"
|
|
53
|
+
|
|
54
|
+
[examples.Address.bbox]
|
|
55
|
+
xmin = -176.56381225585938
|
|
56
|
+
xmax = -176.56378173828125
|
|
57
|
+
ymin = -43.94719696044922
|
|
58
|
+
ymax = -43.94718933105469
|
|
59
|
+
|
|
60
|
+
[[examples.Address.address_levels]]
|
|
61
|
+
value = "Chatham Islands"
|
|
62
|
+
|
|
63
|
+
[[examples.Address.address_levels]]
|
|
64
|
+
value = "Chatham Island"
|
|
65
|
+
|
|
66
|
+
[[examples.Address.sources]]
|
|
67
|
+
property = ""
|
|
68
|
+
dataset = "OpenAddresses/LINZ"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Addresses theme.
|
|
2
|
+
|
|
3
|
+
Feature types and shared components for the Overture Maps addresses theme.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
|
|
7
|
+
|
|
8
|
+
from .address import Address, AddressLevel
|
|
9
|
+
|
|
10
|
+
__all__ = ["Address", "AddressLevel"]
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"""
|
|
2
|
+
The `Address` feature type model and supporting types.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import textwrap
|
|
6
|
+
from typing import Annotated, Literal
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
9
|
+
|
|
10
|
+
from overture.schema.common import (
|
|
11
|
+
OvertureFeature,
|
|
12
|
+
)
|
|
13
|
+
from overture.schema.system.geometric import (
|
|
14
|
+
Geometry,
|
|
15
|
+
GeometryType,
|
|
16
|
+
GeometryTypeConstraint,
|
|
17
|
+
)
|
|
18
|
+
from overture.schema.system.model_constraint import no_extra_fields
|
|
19
|
+
from overture.schema.system.string import CountryCodeAlpha2, StrippedString
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@no_extra_fields
|
|
23
|
+
class AddressLevel(BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
A sub-country addressing unit, such as a region, city, or neighborhood, that is less specific
|
|
26
|
+
than a street name and not a postal code.
|
|
27
|
+
|
|
28
|
+
In the following address, the terms `Montréal` and `QC` are address levels:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
3998 Rue De Bullion, Montréal, QC H2W 2E4
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The number of address levels per address is country-dependent.
|
|
35
|
+
|
|
36
|
+
Other addressing systems may use the terms "administrative level" or "admin level" for the
|
|
37
|
+
same concept. We have chosen the term "address level" to communicate the fact that in some
|
|
38
|
+
countries and regions, address levels do not necessarily correspond to administrative units.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
value: Annotated[
|
|
42
|
+
StrippedString | None,
|
|
43
|
+
Field(
|
|
44
|
+
min_length=1,
|
|
45
|
+
),
|
|
46
|
+
] = None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class Address(OvertureFeature[Literal["addresses"], Literal["address"]]):
|
|
50
|
+
"""
|
|
51
|
+
Addresses are structured labels for the geographic locations where businesses and individuals
|
|
52
|
+
reside.
|
|
53
|
+
|
|
54
|
+
While address formats around the world have some general points in common, the specifics vary
|
|
55
|
+
extensively from place to place. The rules for dividing an address up into parts or fields vary,
|
|
56
|
+
as do the names of those parts or fields.
|
|
57
|
+
|
|
58
|
+
The address schema uses a simplified approach to capture the common structure of addresses
|
|
59
|
+
worldwide while accommodating local variance. The schema is heavily based on the OpenAddresses
|
|
60
|
+
(www.openaddresses.io) project.
|
|
61
|
+
|
|
62
|
+
For sub-country administrative levels (and non-administrative levels such as neighborhoods), the
|
|
63
|
+
schema provides the `address_levels` field. This is where the names of cities and towns,
|
|
64
|
+
provinces, state, and regions, and similar addressing units are found.
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
model_config = ConfigDict(title="address")
|
|
68
|
+
|
|
69
|
+
# Overture Feature
|
|
70
|
+
|
|
71
|
+
geometry: Annotated[
|
|
72
|
+
Geometry,
|
|
73
|
+
GeometryTypeConstraint(GeometryType.POINT),
|
|
74
|
+
Field(description="Position of the address. Addresses are point geometries."),
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
# Optional
|
|
78
|
+
|
|
79
|
+
address_levels: Annotated[
|
|
80
|
+
list[AddressLevel] | None,
|
|
81
|
+
Field(
|
|
82
|
+
min_length=1,
|
|
83
|
+
max_length=5,
|
|
84
|
+
description=textwrap.dedent("""
|
|
85
|
+
Names of the sub-country addressing areas the address belongs to, including the city
|
|
86
|
+
or locality, in descending order of generality.
|
|
87
|
+
|
|
88
|
+
The list is sorted so that the highest, or most general, level comes first (*e.g.*,
|
|
89
|
+
region) and the lowest, or most particular level, comes last (*e.g.*, city or town).
|
|
90
|
+
|
|
91
|
+
The number of items in this list and their meaning is country-dependent. For
|
|
92
|
+
example, in the United States, we expect two items: the state, and the locality or
|
|
93
|
+
municipality within the state. Other countries might have as few as one, or even
|
|
94
|
+
three or more.
|
|
95
|
+
|
|
96
|
+
When a specific level that is required for a country is not known. most likely
|
|
97
|
+
because the data provider has not supplied it and we have not derived it from
|
|
98
|
+
another source, the list item corresponding to that level must be present, but its
|
|
99
|
+
`value` field should be omitted.
|
|
100
|
+
""").strip(),
|
|
101
|
+
),
|
|
102
|
+
] = None
|
|
103
|
+
country: CountryCodeAlpha2 = Field(
|
|
104
|
+
description="The country the address belongs to, as an ISO 3166-1 alpha-2 country code."
|
|
105
|
+
)
|
|
106
|
+
number: Annotated[
|
|
107
|
+
StrippedString | None,
|
|
108
|
+
Field(
|
|
109
|
+
min_length=1,
|
|
110
|
+
description=textwrap.dedent("""
|
|
111
|
+
The house number.
|
|
112
|
+
|
|
113
|
+
This field does not necessarily contain an integer or even a number. Values such as
|
|
114
|
+
"74B", "189 1/2", and "208.5", where the non-integer or non-number part is part of
|
|
115
|
+
the house number, not a unit number, are in common use.
|
|
116
|
+
""").strip(),
|
|
117
|
+
),
|
|
118
|
+
] = None
|
|
119
|
+
postal_city: Annotated[
|
|
120
|
+
StrippedString | None,
|
|
121
|
+
Field(
|
|
122
|
+
min_length=1,
|
|
123
|
+
description=textwrap.dedent("""
|
|
124
|
+
The postal authority designated city name, if applicable.
|
|
125
|
+
|
|
126
|
+
In some countries or regions, a mailing address may need to specify a different city
|
|
127
|
+
name than the city that actually contains the address coordinates. This optional
|
|
128
|
+
field can be used to specify the alternate city name to use.
|
|
129
|
+
|
|
130
|
+
For example:
|
|
131
|
+
|
|
132
|
+
- The postal city for the US address *716 East County Road, Winchester, Indiana*
|
|
133
|
+
is Ridgeville.
|
|
134
|
+
- The postal city for the Slovenian address *Tomaj 71, 6221 Tomaj, Slovenia* is
|
|
135
|
+
Dutovlje.
|
|
136
|
+
""").strip(),
|
|
137
|
+
),
|
|
138
|
+
] = None
|
|
139
|
+
postcode: Annotated[
|
|
140
|
+
StrippedString | None,
|
|
141
|
+
Field(
|
|
142
|
+
min_length=1,
|
|
143
|
+
description="The postal code.",
|
|
144
|
+
),
|
|
145
|
+
] = None
|
|
146
|
+
street: Annotated[
|
|
147
|
+
StrippedString | None,
|
|
148
|
+
Field(
|
|
149
|
+
min_length=1,
|
|
150
|
+
description=textwrap.dedent("""
|
|
151
|
+
The street name.
|
|
152
|
+
|
|
153
|
+
The street name can include a type (*e.g.*, "Street" or "St", "Boulevard" or "Blvd",
|
|
154
|
+
*etc.*) and a directional (*e.g.*, "NW" or "Northwest", "S" or "Sud"). Both type and
|
|
155
|
+
directional, if present, may be either a prefix or a suffix to the primary name.
|
|
156
|
+
They may either be fully spelled-out or abbreviated.
|
|
157
|
+
""").strip(),
|
|
158
|
+
),
|
|
159
|
+
] = None
|
|
160
|
+
unit: Annotated[
|
|
161
|
+
StrippedString | None,
|
|
162
|
+
Field(
|
|
163
|
+
min_length=1,
|
|
164
|
+
description=textwrap.dedent("""
|
|
165
|
+
The secondary address unit designator.
|
|
166
|
+
|
|
167
|
+
In the case where the primary street address is divided into secondary units, which
|
|
168
|
+
may be apartments, floors, or even buildings if the primary street address is a
|
|
169
|
+
campus, this field names the specific secondary unit being addressed.
|
|
170
|
+
""").strip(),
|
|
171
|
+
),
|
|
172
|
+
] = None
|
|
File without changes
|