aio_taginfo.api.v4.key.chronology

/api/4/key/chronology endpoint.

 1"""`/api/4/key/chronology` endpoint."""
 2
 3import datetime
 4
 5from aio_taginfo.api.v4 import Response
 6from aio_taginfo.api.v4._internal import NonEmptyString, api_get_json, api_params
 7
 8from aiohttp import ClientSession
 9from pydantic import Field
10from pydantic.dataclasses import dataclass
11
12
13__all__ = (
14    "call",
15    "KeyChronology",
16)
17
18
19@dataclass(kw_only=True, frozen=True)
20class _Params:
21    key: NonEmptyString = Field(repr=True)
22
23
24@dataclass(kw_only=True, frozen=True)
25class KeyChronology:
26    """
27    Chronology of key counts relative to a previous entry.
28
29    Attributes:
30        date: Date of key counts
31        nodes: Difference in number of nodes with this key, relative to the previous entry
32        ways: Difference in number of ways with this key, relative to the previous entry
33        relations: Difference in number of relations with this key, relative to the previous entry
34    """
35
36    date: datetime.date = Field(repr=True)
37    nodes: int = Field(repr=True)
38    ways: int = Field(repr=True)
39    relations: int = Field(repr=True)
40
41
42async def call(
43    key: str,
44    session: ClientSession | None = None,
45) -> Response[list[KeyChronology]]:
46    """
47    Get chronology of key counts.
48
49    https://taginfo.openstreetmap.org/taginfo/apidoc#api_4_key_chronology
50
51    Args:
52        key: tag key
53        session: request client session
54
55    Raises:
56        TaginfoError
57    """
58    return await api_get_json(
59        path="key/chronology",
60        cls=Response[list[KeyChronology]],
61        session=session,
62        params=api_params(_Params, key=key),
63    )
64
65
66__docformat__ = "google"
async def call( key: str, session: aiohttp.client.ClientSession | None = None) -> aio_taginfo.api.v4.Response[list[KeyChronology]]:
43async def call(
44    key: str,
45    session: ClientSession | None = None,
46) -> Response[list[KeyChronology]]:
47    """
48    Get chronology of key counts.
49
50    https://taginfo.openstreetmap.org/taginfo/apidoc#api_4_key_chronology
51
52    Args:
53        key: tag key
54        session: request client session
55
56    Raises:
57        TaginfoError
58    """
59    return await api_get_json(
60        path="key/chronology",
61        cls=Response[list[KeyChronology]],
62        session=session,
63        params=api_params(_Params, key=key),
64    )

Get chronology of key counts.

https://taginfo.openstreetmap.org/taginfo/apidoc#api_4_key_chronology

Arguments:
  • key: tag key
  • session: request client session
Raises:
  • TaginfoError
@dataclass(kw_only=True, frozen=True)
class KeyChronology:
25@dataclass(kw_only=True, frozen=True)
26class KeyChronology:
27    """
28    Chronology of key counts relative to a previous entry.
29
30    Attributes:
31        date: Date of key counts
32        nodes: Difference in number of nodes with this key, relative to the previous entry
33        ways: Difference in number of ways with this key, relative to the previous entry
34        relations: Difference in number of relations with this key, relative to the previous entry
35    """
36
37    date: datetime.date = Field(repr=True)
38    nodes: int = Field(repr=True)
39    ways: int = Field(repr=True)
40    relations: int = Field(repr=True)

Chronology of key counts relative to a previous entry.

Attributes:
  • date: Date of key counts
  • nodes: Difference in number of nodes with this key, relative to the previous entry
  • ways: Difference in number of ways with this key, relative to the previous entry
  • relations: Difference in number of relations with this key, relative to the previous entry
KeyChronology(*args: Any, **kwargs: Any)
139    def __init__(__dataclass_self__: PydanticDataclass, *args: Any, **kwargs: Any) -> None:
140        __tracebackhide__ = True
141        s = __dataclass_self__
142        s.__pydantic_validator__.validate_python(ArgsKwargs(args, kwargs), self_instance=s)
date: datetime.date = FieldInfo(annotation=date, required=True)
nodes: int = FieldInfo(annotation=int, required=True)
ways: int = FieldInfo(annotation=int, required=True)
relations: int = FieldInfo(annotation=int, required=True)