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
64 changes: 29 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,49 @@ name: CI
on:
push:
branches:
- main
- main
tags:
- '*'
- "*"
pull_request:
env:
LATEST_PY_VERSION: '3.13'

jobs:
tests:
lint-python:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.11'
- '3.12'
- '3.13'

steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
- uses: actions/checkout@v4

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
version: "latest"

- name: Install aiopmtiles
run: |
python -m pip install --upgrade pip
python -m pip install .["test","aws","gcp"]
# Ensure docs build without warnings
# - name: Check docs
# run: uv run --group docs mkdocs build --strict

- name: run pre-commit
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
run: |
python -m pip install pre-commit
pre-commit run --all-files
# Use ruff-action so we get annotations in the Github UI
- uses: astral-sh/ruff-action@v3

- name: Run test
run: python -m pytest --cov aiopmtiles --cov-report xml --cov-report term-missing
pytest:
name: Pytest
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4

- name: Upload Results
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
uses: codecov/codecov-action@v1
- name: Install a specific version of uv
uses: astral-sh/setup-uv@v6
with:
file: ./coverage.xml
flags: unittests
name: ${{ matrix.python-version }}
fail_ci_if_error: false
version: "latest"

- name: Run pytest
run: uv run pytest

publish:
needs: [tests]
needs: [pytest]
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
steps:
Expand Down
33 changes: 0 additions & 33 deletions .pre-commit-config.yaml

This file was deleted.

32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,30 @@ $ python -m pip install git+http://github.com/developmentseed/aiopmtiles
## Example

```python
from async_pmtiles import PMTilesReader
from obstore.store import HTTPStore

from aiopmtiles import Reader
store = HTTPStore("https://r2-public.protomaps.com/protomaps-sample-datasets")
src = await PMTilesReader.open("cb_2018_us_zcta510_500k.pmtiles", store=store)

async with Reader("https://r2-public.protomaps.com/protomaps-sample-datasets/cb_2018_us_zcta510_500k.pmtiles") as src:
# PMTiles Metadata
meta = src.metadata
# PMTiles Metadata
meta = await src.metadata()

# Spatial Metadata
bounds = src.bounds
minzoom, maxzoom = src.minzoom, src.maxzoom
# Spatial Metadata
bounds = src.bounds
minzoom, maxzoom = src.minzoom, src.maxzoom

# Is the data a Vector Tile Archive
assert src.is_vector
# Is the data a Vector Tile Archive
assert src.is_vector

# PMTiles tiles type
tile_type = src._header["tile_type"]
# PMTiles tiles type
src.tile_type

# Tile Compression
comp = src.tile_compression
# Tile Compression
src.tile_compression

# Get Tile
data = await src.get_tile(0, 0, 0)
# Get Tile
data = await src.get_tile(x=0, y=0, z=0)
```

## Contribution & Development
Expand Down
5 changes: 0 additions & 5 deletions aiopmtiles/__init__.py

This file was deleted.

145 changes: 0 additions & 145 deletions aiopmtiles/aiopmtiles.py

This file was deleted.

Loading