overture-schema-theme-places 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.
@@ -0,0 +1,19 @@
1
+ Metadata-Version: 2.4
2
+ Name: overture-schema-theme-places
3
+ Version: 0.1.1.dev0
4
+ Summary: Overture Maps places theme with place type models
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[email]>=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 Places Theme
17
+
18
+ Shared structures and validation logic for Overture Maps places theme.
19
+ Contains common place categories, contact structures, and validation utilities.
@@ -0,0 +1,4 @@
1
+ # Overture Schema Places Theme
2
+
3
+ Shared structures and validation logic for Overture Maps places theme.
4
+ Contains common place categories, contact structures, and validation utilities.
@@ -0,0 +1,79 @@
1
+ [project]
2
+ dependencies = [
3
+ "overture-schema-common>=0.1.1",
4
+ "overture-schema-system>=0.1.1",
5
+ "pydantic[email]>=2.13.0",
6
+ ]
7
+ description = "Overture Maps places theme with place type models"
8
+ version = "0.1.1.dev0"
9
+ license = "MIT"
10
+ name = "overture-schema-theme-places"
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
+ place = "overture.schema.places:Place"
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.places"
36
+
37
+ [build-system]
38
+ requires = ["uv_build>=0.11.32,<0.13"]
39
+ build-backend = "uv_build"
40
+
41
+ [[examples.Place]]
42
+ id = "99003ee6-e75b-4dd6-8a8a-53a5a716c50d"
43
+ geometry = "POINT (-150.46875 -79.1713346)"
44
+ version = 1
45
+ confidence = 0.7337175792507205
46
+ websites = ["https://www.superhotel.co.jp/s_hotels/beppu/"]
47
+ socials = ["https://www.facebook.com/107663894904826"]
48
+ phones = ["+81977009000"]
49
+ operating_status = "open"
50
+ theme = "places"
51
+ type = "place"
52
+
53
+ [examples.Place.bbox]
54
+ xmin = -150.46875
55
+ xmax = -150.46875
56
+ ymin = -79.17134094238281
57
+ ymax = -79.17133331298828
58
+
59
+ [[examples.Place.sources]]
60
+ property = ""
61
+ dataset = "meta"
62
+ record_id = "107663894904826"
63
+ update_time = "2025-06-30T07:00:00.000Z"
64
+ confidence = 0.7337175792507205
65
+
66
+ [examples.Place.names]
67
+ primary = "スーパーホテル別府駅前"
68
+
69
+ [examples.Place.categories]
70
+ primary = "hotel"
71
+
72
+ [examples.Place.brand.names]
73
+ primary = "SUPER HOTEL"
74
+
75
+ [[examples.Place.addresses]]
76
+ freeform = "秋田県横手市駅前町13−8"
77
+ locality = "横手市"
78
+ postcode = "013-0036"
79
+ country = "JP"
@@ -0,0 +1,85 @@
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[email]>=2.13.0",
9
+ ]
10
+ description = "Overture Maps places theme with place type models"
11
+ version = "0.1.1.dev0"
12
+ license = "MIT"
13
+ name = "overture-schema-theme-places"
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
+ [build-system]
27
+ requires = ["uv_build>=0.11.32,<0.13"]
28
+ build-backend = "uv_build"
29
+
30
+ [tool.uv.build-backend]
31
+ module-name = "overture.schema.places"
32
+
33
+ [project.entry-points."overture.models"]
34
+ place = "overture.schema.places:Place"
35
+
36
+ [project.entry-points.pytest11]
37
+ overture_baselines = "overture.schema.system.testing.plugin"
38
+
39
+ [[examples.Place]]
40
+ id = "99003ee6-e75b-4dd6-8a8a-53a5a716c50d"
41
+ geometry = "POINT (-150.46875 -79.1713346)"
42
+ version = 1
43
+ confidence = 0.7337175792507205
44
+ websites = [
45
+ "https://www.superhotel.co.jp/s_hotels/beppu/"
46
+ ]
47
+ socials = [
48
+ "https://www.facebook.com/107663894904826"
49
+ ]
50
+ phones = [
51
+ "+81977009000"
52
+ ]
53
+ operating_status = "open"
54
+ theme = "places"
55
+ type = "place"
56
+
57
+ [examples.Place.bbox]
58
+ xmin = -150.46875
59
+ xmax = -150.46875
60
+ ymin = -79.17134094238281
61
+ ymax = -79.17133331298828
62
+
63
+ [[examples.Place.sources]]
64
+ property = ""
65
+ dataset = "meta"
66
+ record_id = "107663894904826"
67
+ update_time = "2025-06-30T07:00:00.000Z"
68
+ confidence = 0.7337175792507205
69
+
70
+ [examples.Place.names]
71
+ primary = "スーパーホテル別府駅前"
72
+
73
+ [examples.Place.categories]
74
+ primary = "hotel"
75
+
76
+ [examples.Place.brand]
77
+
78
+ [examples.Place.brand.names]
79
+ primary = "SUPER HOTEL"
80
+
81
+ [[examples.Place.addresses]]
82
+ freeform = "秋田県横手市駅前町13−8"
83
+ locality = "横手市"
84
+ postcode = "013-0036"
85
+ country = "JP"
@@ -0,0 +1,11 @@
1
+ """Places theme.
2
+
3
+ Point-based representations of real-world facilities, services, and amenities with
4
+ category classifications and metadata.
5
+ """
6
+
7
+ __path__ = __import__("pkgutil").extend_path(__path__, __name__)
8
+
9
+ from .place import Address, Brand, Categories, OperatingStatus, Place
10
+
11
+ __all__ = ["Address", "Brand", "Categories", "OperatingStatus", "Place"]
@@ -0,0 +1,305 @@
1
+ """
2
+ The `Place` feature type model and supporting types.
3
+ """
4
+
5
+ import textwrap
6
+ from enum import Enum
7
+ from typing import Annotated, Literal
8
+
9
+ from pydantic import BaseModel, ConfigDict, EmailStr, Field, HttpUrl
10
+
11
+ from overture.schema.common import (
12
+ OvertureFeature,
13
+ )
14
+ from overture.schema.common.confidence import (
15
+ ConfidenceScore,
16
+ )
17
+ from overture.schema.common.names import (
18
+ Named,
19
+ )
20
+ from overture.schema.system.field_constraint import (
21
+ UniqueItemsConstraint,
22
+ )
23
+ from overture.schema.system.geometric import (
24
+ Geometry,
25
+ GeometryType,
26
+ GeometryTypeConstraint,
27
+ )
28
+ from overture.schema.system.model_constraint import no_extra_fields
29
+ from overture.schema.system.string import (
30
+ CountryCodeAlpha2,
31
+ PhoneNumber,
32
+ RegionCode,
33
+ SnakeCaseString,
34
+ WikidataId,
35
+ )
36
+
37
+
38
+ class OperatingStatus(str, Enum):
39
+ """
40
+ General indication of whether a place is: in continued operation, in a temporary operating
41
+ hiatus, or closed permanently.
42
+
43
+ Operating status should not be confused with opening hours or operating hours. In particular,
44
+ the status `"open"` does not mean the place is open *right now*, it means that in general the
45
+ place is continuing to operate normally, as opposed to being in an operating hiatus
46
+ (`"temporarily_closed"`) or shuttered (`"permanently_closed"`).
47
+ """
48
+
49
+ OPEN = "open"
50
+ PERMANENTLY_CLOSED = "permanently_closed"
51
+ TEMPORARILY_CLOSED = "temporarily_closed"
52
+
53
+
54
+ @no_extra_fields
55
+ class Categories(BaseModel):
56
+ """
57
+ Categories a place belongs to.
58
+
59
+ Complete list is available on GitHub: https://github.com/OvertureMaps/schema/blob/main/docs/schema/concepts/by-theme/places/overture_categories.csv
60
+ """
61
+
62
+ # Required
63
+
64
+ primary: Annotated[
65
+ SnakeCaseString,
66
+ Field(description="The primary or main category of the place."),
67
+ ]
68
+
69
+ # Optional
70
+
71
+ alternate: Annotated[
72
+ list[SnakeCaseString] | None,
73
+ Field(
74
+ description=textwrap.dedent("""
75
+ Alternate categories of the place.
76
+
77
+ Some places might fit into two categories, e.g., a book store and a coffee shop. In
78
+ these cases, the primary category can be augmented with additional categories.
79
+ """).strip(),
80
+ ),
81
+ UniqueItemsConstraint(),
82
+ ] = None
83
+
84
+
85
+ @no_extra_fields
86
+ class Taxonomy(BaseModel):
87
+ """
88
+ A structured representation of the place's category within the Overture taxonomy.
89
+
90
+ Provides the primary classification, full hierarchy path, and alternate categories.
91
+ """
92
+
93
+ # Required
94
+
95
+ primary: Annotated[
96
+ SnakeCaseString,
97
+ Field(
98
+ description=textwrap.dedent("""
99
+ The primary, or most specific, category known about this place.
100
+
101
+ The `primary` category value must always equal the last or rightmost entry in the `hierarchy` field.
102
+ """)
103
+ ),
104
+ ]
105
+
106
+ hierarchy: Annotated[
107
+ list[SnakeCaseString],
108
+ Field(
109
+ min_length=1,
110
+ description=textwrap.dedent("""
111
+ The full primary hierarchy of categories known for this place, ordered from most general to most specific.
112
+ An example hierarchy might be: `["food_and_drink", "restaurant", "casual_eatery", "gas_station_sushi"]`.
113
+
114
+ The rightmost, or most specific, value in the `hierarchy` must always be equal to the `primary` field.
115
+ The basic level category of the place will typically be found in the middle of the primary hierarchy.
116
+ The primary hierarchy does not include any of the alternate categories found in the `alternates` field.
117
+ """).strip(),
118
+ ),
119
+ UniqueItemsConstraint(),
120
+ ]
121
+
122
+ # Optional
123
+
124
+ alternates: Annotated[
125
+ list[SnakeCaseString] | None,
126
+ Field(
127
+ min_length=1,
128
+ description=textwrap.dedent("""
129
+ Unordered list of additional categories that are known for this
130
+ place but that are not part of the primary category hierarchy.
131
+
132
+ Alternate categories allow a more complete picture of the place
133
+ to be surfaced when it fits multiple unconnected branches in the
134
+ taxonomy. For example a gas station that also sells groceries
135
+ might have primary category of "gas_station" with an alternate
136
+ of "grocery_store".
137
+
138
+ Alternate categories are not part of the primary hierarchy or
139
+ another alternate category's hierarchy.
140
+ In other words, if a category is a parent in the hierarchy of another category,
141
+ that category can't be a primary or alternate category itself.
142
+
143
+ Note as well that this field is an unordered list of extra
144
+ categories and does not represent a hierarchy.
145
+ """).strip(),
146
+ ),
147
+ UniqueItemsConstraint(),
148
+ ] = None
149
+
150
+
151
+ @no_extra_fields
152
+ class Brand(Named):
153
+ """
154
+ A brand associated with a place.
155
+
156
+ A location with multiple brands is modeled as multiple separate places, each with its own brand.
157
+ """
158
+
159
+ # Optional
160
+
161
+ wikidata: WikidataId | None = None
162
+
163
+
164
+ @no_extra_fields
165
+ class Address(BaseModel):
166
+ """
167
+ An address associated with a place.
168
+ """
169
+
170
+ # Optional
171
+
172
+ freeform: Annotated[
173
+ str | None,
174
+ Field(
175
+ description="Free-form address that contains street name, house number and other address info",
176
+ ),
177
+ ] = None
178
+ locality: Annotated[
179
+ str | None,
180
+ Field(
181
+ description="City, town, or neighborhood component of the place address",
182
+ ),
183
+ ] = None
184
+ postcode: Annotated[
185
+ str | None, Field(description="Postal code component of the place address")
186
+ ] = None
187
+ region: RegionCode | None = None
188
+ country: CountryCodeAlpha2 | None = None
189
+
190
+
191
+ class Place(OvertureFeature[Literal["places"], Literal["place"]], Named):
192
+ """
193
+ Places are point representations of real-world facilities, businesses, services, or amenities.
194
+ """
195
+
196
+ model_config = ConfigDict(title="place")
197
+
198
+ # Overture Feature
199
+
200
+ geometry: Annotated[
201
+ Geometry,
202
+ GeometryTypeConstraint(GeometryType.POINT),
203
+ Field(
204
+ description="Position of the place. Places are point geometries.",
205
+ ),
206
+ ]
207
+
208
+ # Optional
209
+
210
+ operating_status: Annotated[
211
+ OperatingStatus | None,
212
+ Field(
213
+ description=textwrap.dedent("""
214
+ An indication of whether a place is: in continued operation, in a temporary
215
+ operating hiatus, or closed permanently.
216
+
217
+ This is not an indication of opening hours or that the place is open/closed at the
218
+ current time-of-day or day-of-week.
219
+
220
+ When `operating_status` is `"permanently_closed"`, the `confidence` field will be
221
+ set to 0.
222
+ """).strip(),
223
+ ),
224
+ ] = None
225
+
226
+ categories: Categories | None = None
227
+ basic_category: Annotated[
228
+ SnakeCaseString | None,
229
+ Field(
230
+ description=textwrap.dedent(
231
+ """
232
+ The basic level category of a place.
233
+
234
+ This field classifies places into categories at a level that most people find
235
+ intuitive. The full list of possible values it may hold can be found at (TODO).
236
+
237
+ The basic level category, or simply basic category, is based on a cognitive science
238
+ model use in taxonomy and ontology development. The idea is to provide the category
239
+ name at the level of generality that is preferred by humans in learning and memory
240
+ tasks. This category to be roughly in the middle of the general-to-specific category
241
+ hierarchy.
242
+
243
+ The full list of basic level categories is available at https://docs.overturemaps.org/guides/places/
244
+ """
245
+ ).strip()
246
+ ),
247
+ ] = None
248
+ taxonomy: Annotated[
249
+ Taxonomy | None,
250
+ Field(
251
+ description=textwrap.dedent(
252
+ """
253
+ A structured representation of the place's category within the Overture taxonomy.
254
+
255
+ Provides the primary classification, full hierarchy path, and alternate categories.
256
+ """
257
+ ).strip()
258
+ ),
259
+ ] = None
260
+ confidence: Annotated[
261
+ ConfidenceScore | None,
262
+ Field(
263
+ description=textwrap.dedent(
264
+ """
265
+ A score between 0 and 1 indicating how confident we are that the place exists.
266
+
267
+ A confidence score of 0 indicates that we are certain the place doesn't exist
268
+ anymore and will always be paired with an `operating_status` of
269
+ `"permanently_closed"`.
270
+
271
+ A confidence score of 1 indicates that we are certain the place does exist.
272
+
273
+ If there is no value for confidence, it means we don't have enough information on
274
+ which to estimate our confidence level.
275
+ """
276
+ ).strip(),
277
+ ),
278
+ ] = None
279
+ websites: Annotated[
280
+ list[HttpUrl] | None,
281
+ Field(min_length=1, description="The websites of the place."),
282
+ UniqueItemsConstraint(),
283
+ ] = None
284
+ socials: Annotated[
285
+ list[HttpUrl] | None,
286
+ Field(min_length=1, description="The social media URLs of the place."),
287
+ UniqueItemsConstraint(),
288
+ ] = None
289
+ emails: Annotated[
290
+ list[EmailStr] | None,
291
+ Field(min_length=1, description="The email addresses of the place."),
292
+ UniqueItemsConstraint(),
293
+ ] = None
294
+ phones: Annotated[
295
+ list[PhoneNumber] | None,
296
+ Field(min_length=1, description="The phone numbers of the place."),
297
+ UniqueItemsConstraint(),
298
+ ] = None
299
+ brand: Annotated[
300
+ Brand | None, Field(description="The brand associated with the place.")
301
+ ] = None
302
+ addresses: Annotated[
303
+ list[Address] | None,
304
+ Field(min_length=1, description="The address or addresses of the place"),
305
+ ] = None