Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: GIS",
]
requires-python = ">=3.11"
dependencies = ["obspec>=0.1.0", "pmtiles>=3.4.1"]
dependencies = ["pmtiles>=3.4.1"]

[project.urls]
Source = "https://github.com/developmentseed/async-pmtiles"
Expand Down
19 changes: 17 additions & 2 deletions src/async_pmtiles/_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import gzip
import json
from dataclasses import dataclass
from typing import TYPE_CHECKING, Self
from typing import TYPE_CHECKING, Protocol, Self

from pmtiles.tile import (
Compression,
Expand All @@ -19,7 +19,6 @@
if TYPE_CHECKING:
import sys

from obspec import GetRangeAsync
from pmtiles.tile import HeaderDict

if sys.version_info >= (3, 12):
Expand All @@ -28,6 +27,22 @@
from typing_extensions import Buffer


class GetRangeAsync(Protocol):
async def get_range_async(
self,
path: str,
*,
start: int,
end: int | None = None,
length: int | None = None,
) -> Buffer:
"""Call `get_range` asynchronously.

Refer to the documentation for [GetRange][obspec.GetRange].
"""
...


@dataclass()
class PMTilesReader:
"""PMTiles Reader."""
Expand Down