tiny-osm 0.1.0__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,67 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - v*
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: write
13
+
14
+ concurrency:
15
+ group: docs-deploy
16
+ cancel-in-progress: false
17
+
18
+ jobs:
19
+ docs:
20
+ name: Deploy Documentation
21
+ runs-on: ubuntu-latest
22
+
23
+ steps:
24
+ - uses: actions/checkout@v6
25
+ with:
26
+ fetch-depth: 0
27
+
28
+ - uses: prefix-dev/setup-pixi@v0.9.4
29
+ with:
30
+ pixi-version: v0.67.0
31
+ environments: docs
32
+ activate-environment: docs
33
+ locked: true
34
+
35
+ - name: Configure Git
36
+ run: |-
37
+ git config user.name "github-actions[bot]"
38
+ git config user.email "github-actions[bot]@users.noreply.github.com"
39
+
40
+ - name: Fetch gh-pages branch
41
+ run: git fetch origin gh-pages:gh-pages || true
42
+
43
+ - name: Deploy latest docs (main branch)
44
+ if: github.ref == 'refs/heads/main'
45
+ run: |-
46
+ pixi r docs-deploy
47
+ mike set-default --push latest
48
+
49
+ - name: Deploy release docs (tagged version)
50
+ if: startsWith(github.ref, 'refs/tags/v')
51
+ run: |-
52
+ VERSION=$(git describe --tags --abbrev=0)
53
+ # Find the previous stable version before deploying
54
+ PREV=$(mike list --json 2>/dev/null | python3 -c "
55
+ import json, sys
56
+ versions = json.load(sys.stdin)
57
+ prev = [v['version'] for v in versions if 'stable' in v.get('aliases', [])]
58
+ print(prev[0] if prev else '')
59
+ " || true)
60
+ # Deploy new version with stable alias
61
+ pixi r docs-release
62
+ mike retitle --push "$VERSION" "$VERSION (stable)"
63
+ # Remove (stable) label from previous version
64
+ if [ -n "$PREV" ] && [ "$PREV" != "$VERSION" ]; then
65
+ mike retitle --push "$PREV" "$PREV"
66
+ fi
67
+ mike set-default --push latest
@@ -0,0 +1,72 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+ workflow_dispatch: # allows you to trigger manually
8
+
9
+ permissions:
10
+ contents: write
11
+ attestations: write
12
+ id-token: write
13
+
14
+ jobs:
15
+ release-notes:
16
+ name: Create Release Notes
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v6
20
+ with:
21
+ fetch-depth: 0
22
+
23
+ - name: Generate release notes with git-cliff
24
+ uses: orhun/git-cliff-action@v4
25
+ with:
26
+ config: pyproject.toml
27
+ args: --latest --strip all
28
+ env:
29
+ OUTPUT: release-notes.md
30
+ GITHUB_REPO: ${{ github.repository }}
31
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32
+
33
+ - name: Create GitHub Release
34
+ uses: softprops/action-gh-release@v2
35
+ if: startsWith(github.ref, 'refs/tags/')
36
+ with:
37
+ body_path: release-notes.md
38
+ env:
39
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40
+
41
+ build-package:
42
+ name: Build and Inspect Python Package
43
+ runs-on: ubuntu-latest
44
+ needs: release-notes
45
+ steps:
46
+ - uses: actions/checkout@v6
47
+ with:
48
+ fetch-depth: 0
49
+
50
+ - uses: hynek/build-and-inspect-python-package@v2
51
+ with:
52
+ attest-build-provenance-github: true
53
+
54
+ release-pypi:
55
+ name: Publish to PyPI
56
+ runs-on: ubuntu-latest
57
+ needs: build-package
58
+
59
+ steps:
60
+ - name: Download packages built by build-and-inspect-python-package
61
+ uses: actions/download-artifact@v8
62
+ with:
63
+ name: Packages
64
+ path: dist
65
+
66
+ - name: Generate artifact attestation for sdist and wheel
67
+ uses: actions/attest-build-provenance@v4
68
+ with:
69
+ subject-path: dist
70
+
71
+ - name: Upload package to PyPI
72
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,63 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - '**'
7
+ tags-ignore:
8
+ - '**'
9
+ pull_request:
10
+ branches:
11
+ - '**'
12
+ workflow_dispatch:
13
+
14
+ concurrency:
15
+ group: ${{ github.workflow }}-${{ github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ test:
20
+ name: unit - ${{ matrix.environment }}, ${{ matrix.os }}
21
+ runs-on: ${{ matrix.os }}
22
+ strategy:
23
+ matrix:
24
+ os: [ubuntu-latest, macos-latest, windows-latest]
25
+ environment: [test311, test314]
26
+
27
+ steps:
28
+ - uses: actions/checkout@v6
29
+ - uses: prefix-dev/setup-pixi@v0.9.4
30
+ with:
31
+ pixi-version: v0.67.0
32
+ environments: ${{ matrix.environment }}
33
+ activate-environment: ${{ matrix.environment }}
34
+ locked: true
35
+ - name: Run unit tests
36
+ run: pixi r test
37
+
38
+ - name: Upload coverage reports to Codecov
39
+ uses: codecov/codecov-action@v5
40
+ with:
41
+ token: ${{ secrets.CODECOV_TOKEN }}
42
+ slug: ${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}
43
+
44
+ test-network:
45
+ name: network - test314, ubuntu-latest
46
+ needs: test
47
+ runs-on: ubuntu-latest
48
+ steps:
49
+ - uses: actions/checkout@v6
50
+ - uses: prefix-dev/setup-pixi@v0.9.4
51
+ with:
52
+ pixi-version: v0.67.0
53
+ environments: test314
54
+ activate-environment: test314
55
+ locked: true
56
+ - name: Run network tests
57
+ run: pixi r test-network
58
+
59
+ - name: Upload coverage reports to Codecov
60
+ uses: codecov/codecov-action@v5
61
+ with:
62
+ token: ${{ secrets.CODECOV_TOKEN }}
63
+ slug: ${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}
@@ -0,0 +1,118 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ env/
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+
28
+ # PyInstaller
29
+ *.manifest
30
+ *.spec
31
+
32
+ # Installer logs
33
+ pip-log.txt
34
+ pip-delete-this-directory.txt
35
+
36
+ # Unit test / coverage reports
37
+ htmlcov/
38
+ .tox/
39
+ .coverage
40
+ .coverage.*
41
+ .cache
42
+ nosetests.xml
43
+ coverage.xml
44
+ *.cover
45
+ .hypothesis/
46
+ .pytest_cache/
47
+ .pytest_tmp/
48
+
49
+ # Translations
50
+ *.mo
51
+ *.pot
52
+
53
+ # Django stuff:
54
+ *.log
55
+ local_settings.py
56
+
57
+ # Flask stuff:
58
+ instance/
59
+ .webassets-cache
60
+
61
+ # Scrapy stuff:
62
+ .scrapy
63
+
64
+ # Sphinx documentation
65
+ docs/_build/
66
+
67
+ # PyBuilder
68
+ target/
69
+
70
+ # Jupyter Notebook
71
+ # Note: docs/examples/*.ipynb ARE tracked - they are generated from the
72
+ # paired .py (percent format) files via `pixi r nb-sync` and executed via
73
+ # `pixi r nb-execute`. Strip outputs before committing with `pixi r nb-clear`.
74
+ .ipynb_checkpoints
75
+
76
+ # pyenv
77
+ .python-version
78
+
79
+ # celery beat schedule file
80
+ celerybeat-schedule
81
+
82
+ # SageMath parsed files
83
+ *.sage.py
84
+
85
+ # dotenv
86
+ .env
87
+
88
+ # virtualenv
89
+ .venv
90
+ venv/
91
+ ENV/
92
+
93
+ # Spyder project settings
94
+ .spyderproject
95
+ .spyproject
96
+
97
+ # Rope project settings
98
+ .ropeproject
99
+
100
+ # mkdocs documentation
101
+ /site
102
+
103
+ # mypy
104
+ .mypy_cache/
105
+
106
+ # IDE settings
107
+ .vscode/
108
+ .idea/
109
+
110
+ # logs
111
+ cache
112
+ .pixi
113
+ .DS_Store
114
+ junit.xml
115
+ .coverage
116
+ *.egg-info
117
+ data
118
+ .nox
@@ -0,0 +1,98 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v6.0.0
4
+ hooks:
5
+ - id: check-added-large-files
6
+ args: [--maxkb=50000]
7
+ - id: mixed-line-ending
8
+ args: [--fix=lf]
9
+ - id: check-ast
10
+ exclude: ^docs/examples/notebooks/.*\.py$
11
+ - id: check-builtin-literals
12
+ exclude: ^docs/examples/notebooks/.*\.py$
13
+ - id: check-case-conflict
14
+ - id: check-docstring-first
15
+ - id: check-shebang-scripts-are-executable
16
+ - id: check-merge-conflict
17
+ - id: check-json
18
+ - id: check-toml
19
+ - id: check-xml
20
+ - id: check-yaml
21
+ exclude: mkdocs.yml
22
+ - id: debug-statements
23
+ exclude: ^docs/examples/notebooks/.*\.py$
24
+ - id: destroyed-symlinks
25
+ - id: detect-private-key
26
+ - id: end-of-file-fixer
27
+ exclude: ^LICENSE|\.(html|csv|txt|svg|py)$
28
+ - id: pretty-format-json
29
+ args: [--autofix, --no-ensure-ascii, --no-sort-keys]
30
+ - id: trailing-whitespace
31
+ args: [--markdown-linebreak-ext=md]
32
+ exclude: \.(html|svg)$
33
+
34
+ - repo: https://github.com/bwhmather/ssort
35
+ rev: 0.16.0
36
+ hooks:
37
+ - id: ssort
38
+ name: Sort top level statements with ssort
39
+ exclude: ^docs/examples/notebooks/.*\.py$
40
+
41
+ - repo: https://github.com/astral-sh/ruff-pre-commit
42
+ rev: v0.15.10
43
+ hooks:
44
+ - id: ruff
45
+ name: Linting with Ruff
46
+ types_or: [python, jupyter]
47
+ args: [--fix, --unsafe-fixes]
48
+ - id: ruff-format
49
+ name: Formatting with Ruff
50
+ types_or: [python, jupyter]
51
+
52
+
53
+ - repo: https://github.com/PyCQA/doc8
54
+ rev: v2.0.0
55
+ hooks:
56
+ - id: doc8
57
+ name: Check documentation formats with doc8
58
+ args: [--max-line-length, '100']
59
+
60
+ - repo: https://github.com/codespell-project/codespell
61
+ rev: v2.4.2
62
+ hooks:
63
+ - id: codespell
64
+ name: Check common misspellings in text files with codespell.
65
+ additional_dependencies:
66
+ - tomli
67
+
68
+ - repo: https://github.com/tox-dev/pyproject-fmt
69
+ rev: v2.21.1
70
+ hooks:
71
+ - id: pyproject-fmt
72
+ name: Apply a consistent format to pyproject.toml
73
+
74
+ - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
75
+ rev: v2.16.0
76
+ hooks:
77
+ - id: pretty-format-yaml
78
+ args: [--autofix, --indent, '2']
79
+
80
+ - repo: https://github.com/rhysd/actionlint
81
+ rev: v1.7.12
82
+ hooks:
83
+ - id: actionlint
84
+ files: .github/workflows/
85
+ args: [-ignore, SC1090, -ignore, SC2046, -ignore, SC2086, -ignore, SC2129, -ignore, SC2155, -ignore, property "date"]
86
+
87
+ - repo: https://github.com/executablebooks/mdformat
88
+ rev: 1.0.0
89
+ hooks:
90
+ - id: mdformat
91
+ additional_dependencies:
92
+ - mdformat-mkdocs
93
+ - mdformat-ruff
94
+ - ruff
95
+ - mdformat-config
96
+ - mdformat-toc
97
+ args: [--wrap, '88']
98
+ exclude: ^docs/reference/
@@ -0,0 +1,3 @@
1
+ # Authors
2
+
3
+ - Taher Chegini ([@cheginit](https://github.com/cheginit))
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. The format is based
4
+ on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.1.0] - 2026-04-16
8
+
9
+ ### Added
10
+
11
+ - Single-function API (`fetch`) to retrieve OSM data as GeoJSON FeatureCollections
12
+ - Predefined Overpass QL filters via `OSMFilters` (HIGHWAY, WATERWAY, WATER_BODY)
13
+ - Support for any custom Overpass QL tag-filter string
14
+ - Automatic bounding box subdivision into tiles for large queries
15
+ - Multi-mirror retry with automatic failover across Overpass API endpoints
16
+ - Full GeoJSON assembly: ring stitching, hole assignment, polygon-feature rule tree
17
+ - Element deduplication across tile boundaries
18
+ - Module-level HTTP connection pooling for TLS reuse across `fetch` calls
19
+ - Configurable logging via `configure_logger`
@@ -0,0 +1,36 @@
1
+ # Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a
6
+ harassment-free experience for everyone.
7
+
8
+ ## Our Standards
9
+
10
+ Examples of behavior that contributes to a positive environment:
11
+
12
+ - Using welcoming and inclusive language
13
+ - Being respectful of differing viewpoints and experiences
14
+ - Gracefully accepting constructive criticism
15
+ - Focusing on what is best for the community
16
+ - Showing empathy towards other community members
17
+
18
+ Examples of unacceptable behavior:
19
+
20
+ - The use of sexualized language or imagery
21
+ - Trolling, insulting/derogatory comments, and personal or political attacks
22
+ - Public or private harassment
23
+ - Publishing others' private information without explicit permission
24
+ - Other conduct which could reasonably be considered inappropriate in a professional
25
+ setting
26
+
27
+ ## Enforcement
28
+
29
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to
30
+ the project maintainers. All complaints will be reviewed and investigated promptly and
31
+ fairly.
32
+
33
+ ## Attribution
34
+
35
+ This Code of Conduct is adapted from the
36
+ [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
@@ -0,0 +1,110 @@
1
+ # Contributing
2
+
3
+ Thank you for your interest in contributing!
4
+
5
+ ## Development Setup
6
+
7
+ 1. Install [pixi](https://pixi.sh) and [gh](https://github.com/cli/cli#installation).
8
+ 1. Clone the repository.
9
+ 1. Set up the development environment:
10
+
11
+ ```console
12
+ pixi install -e dev
13
+ pixi install -e typecheck
14
+ ```
15
+
16
+ 1. Install pre-commit hooks:
17
+
18
+ ```console
19
+ pixi r pcupdate # optionally bump hooks to latest versions first
20
+ pixi r lint # installs hooks and runs them across the repo
21
+ ```
22
+
23
+ ## Commit Messages
24
+
25
+ This project uses
26
+ [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). All commit
27
+ messages **must** follow this format:
28
+
29
+ ```
30
+ <type>[optional scope]: <description>
31
+
32
+ [optional body]
33
+
34
+ [optional footer(s)]
35
+ ```
36
+
37
+ ### Types
38
+
39
+ | Type | When to use | Changelog section |
40
+ | ---------- | -------------------------------------- | ----------------- |
41
+ | `feat` | A new feature | Added |
42
+ | `fix` | A bug fix | Fixed |
43
+ | `perf` | A performance improvement | Changed |
44
+ | `refactor` | Code restructuring, no behavior change | Changed |
45
+ | `revert` | Reverting a previous commit | Fixed |
46
+ | `docs` | Documentation only | _(skipped)_ |
47
+ | `test` | Adding or updating tests | _(skipped)_ |
48
+ | `chore` | Maintenance, dependencies, tooling | _(skipped)_ |
49
+ | `ci` | CI/CD changes | _(skipped)_ |
50
+
51
+ ### Breaking Changes
52
+
53
+ Append `!` after the type, or add `BREAKING CHANGE:` in the footer:
54
+
55
+ ```
56
+ feat!: drop support for Python 3.11
57
+ ```
58
+
59
+ ```
60
+ feat: new API
61
+
62
+ BREAKING CHANGE: `old_function` has been removed.
63
+ ```
64
+
65
+ ### Examples
66
+
67
+ ```
68
+ feat(osm): add support for railway layer
69
+ fix: handle missing CRS in bbox reprojection
70
+ chore: bump ruff to v0.15.5
71
+ docs: add example notebook for water_body fetch
72
+ ```
73
+
74
+ ## Running Tests
75
+
76
+ ```console
77
+ pixi r test # unit tests only
78
+ pixi r test-network # network tests only
79
+ pixi r test-all # all tests
80
+ ```
81
+
82
+ ## Type Checking
83
+
84
+ ```console
85
+ pixi r typecheck
86
+ ```
87
+
88
+ ## Documentation
89
+
90
+ ```console
91
+ pixi r docs-serve
92
+ ```
93
+
94
+ ## Managing the Changelog
95
+
96
+ The changelog is maintained by [git-cliff](https://git-cliff.org) and generated
97
+ automatically from conventional commit messages.
98
+
99
+ ```console
100
+ pixi r changelog # preview unreleased changes
101
+ pixi r changelog-update # write them to CHANGELOG.md
102
+ ```
103
+
104
+ ## Submitting Changes
105
+
106
+ 1. Fork the repository.
107
+ 1. Create a feature branch.
108
+ 1. Make your changes with tests.
109
+ 1. Ensure all checks pass.
110
+ 1. Submit a pull request.
tiny_osm-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Taher Chegini
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.