Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
whubsch committed Jul 24, 2024
0 parents commit b3b86ee
Show file tree
Hide file tree
Showing 28 changed files with 4,555 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Run Black formatter

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
52 changes: 52 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: documentation

# build the documentation whenever there are new commits on main
on:
push:
branches:
- main

# security: restrict permissions for CI jobs.
permissions:
contents: read

jobs:
# Build the documentation and upload the static HTML files as an artifact.
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: pip install pdoc

- run: pip install -e .

- name: Build documentation
run: python scripts/make_docs.py

- name: Upload documentation
uses: actions/upload-pages-artifact@v3
with:
path: docs/

# Deploy the artifact to GitHub pages.
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: testing

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: pip install pytest pydantic

- name: Install package in editable mode
run: pip install -e .

- name: Run tests
run: python -m pytest tests/test.py
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Virtual environments
env/
venv/
ENV/
env.bak/
venv.bak/

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Temporary files
*scratch*.py
scripts/test*.py
.pypirc
9 changes: 9 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) 2024-present

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Overture to OSM

![GitHub License](https://img.shields.io/github/license/whubsch/atlus_py)
![GitHub last commit](https://img.shields.io/github/last-commit/whubsch/atlus_py)
![PyPI - Version](https://img.shields.io/pypi/v/atlus)
![Pepy Total Downlods](https://img.shields.io/pepy/dt/atlus)

This Python project translates objects from the Overture maps schema to the OpenStreetMap (OSM) tagging scheme. The goal is to provide a seamless way to convert map data from Overture's format to a format that can be utilized within the OSM ecosystem. The package currently only supports Overture's `places` layer. You can improve the Overture categorization that this package uses by editing [the Overture categories page](https://wiki.openstreetmap.org/wiki/Overture_categories) on the OSM Wiki or submitting a pull request to the [tags.json](scripts/tags.json) file.

> [!NOTE]
> Use of this package does not absolve you from following OSM's [import guidelines](https://wiki.openstreetmap.org/wiki/Import/Guidelines).
## Table of Contents

- [Features](#features)
- [Usage](#usage)
- [Docs](#docs)
- [License](#license)

## Features

- Translate Overture map places to OSM tags.
- Handle various map object types, including roads, buildings, and points of interest.
- Ensure compatibility with OSM data structures and conventions.

## Usage

This package is meant to work with GeoJSON files containing Overture maps data, including those produced by the [overturemaps](https://pypi.org/project/overturemaps/) Python package.

```console
pip install atlus_py
```

## Docs

The documentation for our package is available online at our [pdoc page](https://whubsch.github.io/atlus_py/index.html). We would greatly appreciate your contributions to help improve the auto-generated docs; please submit any updates or corrections via pull requests.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE.txt) file for details.

## See also

- [Overture Maps](https://docs.overturemaps.org/schema/)
- [OpenStreetMap](https://www.openstreetmap.org/)
- [Overture categories wiki page](https://wiki.openstreetmap.org/wiki/Overture_categories)
Empty file added __init__.py
Empty file.
Binary file added docs/.DS_Store
Binary file not shown.
250 changes: 250 additions & 0 deletions docs/atlus.html

Large diffs are not rendered by default.

249 changes: 249 additions & 0 deletions docs/atlus/__about__.html

Large diffs are not rendered by default.

1,832 changes: 1,832 additions & 0 deletions docs/atlus/atlus.html

Large diffs are not rendered by default.

836 changes: 836 additions & 0 deletions docs/atlus/resources.html

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions docs/atlus_fav.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./atlus.html"/>
</head>
</html>
Binary file added docs/logo_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/search.js

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "atlus"
dynamic = ["version"]
description = 'Translate the Overture maps schema to OpenStreetMap tags.'
readme = "README.md"
requires-python = ">=3.8"
license = "MIT"
keywords = ["overture", "osm", "openstreetmap", "mapping", "overture maps"]
authors = [{ name = "Will", email = "[email protected]" }]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = ["usaddress", "regex"]

[project.urls]
Documentation = "https://whubsch.github.io/atlus_py/index.html"
Issues = "https://github.com/whubsch/atlus_py/issues"
Source = "https://github.com/whubsch/atlus_py"

[tool.hatch.version]
path = "src/atlus_py/__about__.py"

[tool.hatch.envs.types]
extra-dependencies = ["mypy>=1.0.0"]
[tool.hatch.envs.types.scripts]
check = "mypy --install-types --non-interactive {args:src/atlus_py tests}"

[tool.coverage.run]
source_pkgs = ["atlus_py", "tests"]
branch = true
parallel = true
omit = ["src/atlus_py/__about__.py"]

[tool.coverage.paths]
atlus_py = ["src/atlus_py", "*/atlus_py/src/atlus_py"]
tests = ["tests", "*/atlus_py/tests"]

[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
Empty file added scripts/__init__.py
Empty file.
16 changes: 16 additions & 0 deletions scripts/make_docs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"""Generate the docs."""

from pathlib import Path
import pdoc
import pdoc.render


here = Path(__file__).parent

pdoc.render.configure(
docformat="google",
footer_text="atlus",
favicon="https://whubsch.github.io/atlus/atlus_fav.svg",
logo="https://whubsch.github.io/atlus/logo_blank.png",
)
pdoc.pdoc("src/atlus", output_directory=here.parent / "docs")
Binary file added src/.DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions src/atlus/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Top-level package for overturetoosm."""

__version__ = "0.2.2"
7 changes: 7 additions & 0 deletions src/atlus/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""`overturetoosm` is a Python package to convert objects tagged in the
Overture schema for use in OSM. Only Overture's `places` layer is currently supported.
"""

# SPDX-FileCopyrightText: 2024-present Will <[email protected]>
#
# SPDX-License-Identifier: MIT
Loading

0 comments on commit b3b86ee

Please sign in to comment.