soildb 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.
Files changed (95) hide show
  1. soildb-0.1.0/.github/workflows/ci.yml +173 -0
  2. soildb-0.1.0/.github/workflows/pypi-release.yml +36 -0
  3. soildb-0.1.0/.gitignore +178 -0
  4. soildb-0.1.0/.pre-commit-config.yaml +33 -0
  5. soildb-0.1.0/.readthedocs.yaml +21 -0
  6. soildb-0.1.0/CHANGELOG.md +13 -0
  7. soildb-0.1.0/CONTRIBUTING.md +135 -0
  8. soildb-0.1.0/LICENSE +21 -0
  9. soildb-0.1.0/Makefile +69 -0
  10. soildb-0.1.0/PKG-INFO +391 -0
  11. soildb-0.1.0/README.md +323 -0
  12. soildb-0.1.0/docs/.gitignore +3 -0
  13. soildb-0.1.0/docs/_quarto.yml +109 -0
  14. soildb-0.1.0/docs/api.qmd +381 -0
  15. soildb-0.1.0/docs/async.qmd +290 -0
  16. soildb-0.1.0/docs/index.qmd +231 -0
  17. soildb-0.1.0/docs/objects.json +1 -0
  18. soildb-0.1.0/docs/src/soildb/client.SDAClient.qmd +98 -0
  19. soildb-0.1.0/docs/src/soildb/convenience.get_mapunit_by_areasymbol.qmd +14 -0
  20. soildb-0.1.0/docs/src/soildb/convenience.get_mapunit_by_bbox.qmd +17 -0
  21. soildb-0.1.0/docs/src/soildb/convenience.get_mapunit_by_point.qmd +15 -0
  22. soildb-0.1.0/docs/src/soildb/convenience.get_sacatalog.qmd +27 -0
  23. soildb-0.1.0/docs/src/soildb/convenience.get_sacatalog_sync.qmd +20 -0
  24. soildb-0.1.0/docs/src/soildb/convenience.list_survey_areas.qmd +13 -0
  25. soildb-0.1.0/docs/src/soildb/convenience.list_survey_areas_sync.qmd +19 -0
  26. soildb-0.1.0/docs/src/soildb/exceptions.SDAConnectionError.qmd +7 -0
  27. soildb-0.1.0/docs/src/soildb/exceptions.SDAMaintenanceError.qmd +7 -0
  28. soildb-0.1.0/docs/src/soildb/exceptions.SDAQueryError.qmd +7 -0
  29. soildb-0.1.0/docs/src/soildb/exceptions.SDAResponseError.qmd +7 -0
  30. soildb-0.1.0/docs/src/soildb/exceptions.SoilDBError.qmd +7 -0
  31. soildb-0.1.0/docs/src/soildb/fetch.fetch_by_keys.qmd +58 -0
  32. soildb-0.1.0/docs/src/soildb/fetch.fetch_chorizon_by_cokey.qmd +26 -0
  33. soildb-0.1.0/docs/src/soildb/fetch.fetch_component_by_mukey.qmd +26 -0
  34. soildb-0.1.0/docs/src/soildb/fetch.fetch_mapunit_polygon.qmd +28 -0
  35. soildb-0.1.0/docs/src/soildb/fetch.fetch_survey_area_polygon.qmd +28 -0
  36. soildb-0.1.0/docs/src/soildb/fetch.get_cokey_by_mukey.qmd +15 -0
  37. soildb-0.1.0/docs/src/soildb/fetch.get_mukey_by_areasymbol.qmd +10 -0
  38. soildb-0.1.0/docs/src/soildb/index.qmd +111 -0
  39. soildb-0.1.0/docs/src/soildb/metadata.MetadataParseError.qmd +7 -0
  40. soildb-0.1.0/docs/src/soildb/metadata.SurveyMetadata.qmd +92 -0
  41. soildb-0.1.0/docs/src/soildb/metadata.extract_metadata_summary.qmd +21 -0
  42. soildb-0.1.0/docs/src/soildb/metadata.parse_survey_metadata.qmd +23 -0
  43. soildb-0.1.0/docs/src/soildb/query.Query.from_.qmd +13 -0
  44. soildb-0.1.0/docs/src/soildb/query.Query.inner_join.qmd +14 -0
  45. soildb-0.1.0/docs/src/soildb/query.Query.join.qmd +15 -0
  46. soildb-0.1.0/docs/src/soildb/query.Query.left_join.qmd +14 -0
  47. soildb-0.1.0/docs/src/soildb/query.Query.limit.qmd +13 -0
  48. soildb-0.1.0/docs/src/soildb/query.Query.order_by.qmd +14 -0
  49. soildb-0.1.0/docs/src/soildb/query.Query.qmd +164 -0
  50. soildb-0.1.0/docs/src/soildb/query.Query.select.qmd +13 -0
  51. soildb-0.1.0/docs/src/soildb/query.Query.where.qmd +13 -0
  52. soildb-0.1.0/docs/src/soildb/query.QueryBuilder.qmd +99 -0
  53. soildb-0.1.0/docs/src/soildb/query.SpatialQuery.contains_point.qmd +14 -0
  54. soildb-0.1.0/docs/src/soildb/query.SpatialQuery.from_.qmd +13 -0
  55. soildb-0.1.0/docs/src/soildb/query.SpatialQuery.inner_join.qmd +14 -0
  56. soildb-0.1.0/docs/src/soildb/query.SpatialQuery.intersects_bbox.qmd +16 -0
  57. soildb-0.1.0/docs/src/soildb/query.SpatialQuery.intersects_geometry.qmd +13 -0
  58. soildb-0.1.0/docs/src/soildb/query.SpatialQuery.left_join.qmd +14 -0
  59. soildb-0.1.0/docs/src/soildb/query.SpatialQuery.limit.qmd +13 -0
  60. soildb-0.1.0/docs/src/soildb/query.SpatialQuery.order_by.qmd +14 -0
  61. soildb-0.1.0/docs/src/soildb/query.SpatialQuery.qmd +181 -0
  62. soildb-0.1.0/docs/src/soildb/query.SpatialQuery.select.qmd +13 -0
  63. soildb-0.1.0/docs/src/soildb/query.SpatialQuery.where.qmd +13 -0
  64. soildb-0.1.0/docs/src/soildb/response.SDAResponse.qmd +117 -0
  65. soildb-0.1.0/docs/src/soildb/spatial.SpatialQueryBuilder.qmd +54 -0
  66. soildb-0.1.0/docs/src/soildb/spatial.mupolygon_in_bbox.qmd +14 -0
  67. soildb-0.1.0/docs/src/soildb/spatial.query_featline.qmd +12 -0
  68. soildb-0.1.0/docs/src/soildb/spatial.query_featpoint.qmd +12 -0
  69. soildb-0.1.0/docs/src/soildb/spatial.query_mupolygon.qmd +12 -0
  70. soildb-0.1.0/docs/src/soildb/spatial.query_sapolygon.qmd +12 -0
  71. soildb-0.1.0/docs/src/soildb/spatial.sapolygon_in_bbox.qmd +14 -0
  72. soildb-0.1.0/docs/src/soildb/spatial.spatial_query.qmd +51 -0
  73. soildb-0.1.0/docs/tutorial.qmd +336 -0
  74. soildb-0.1.0/docs/usage.qmd +96 -0
  75. soildb-0.1.0/examples/01_basic_usage.py +114 -0
  76. soildb-0.1.0/examples/02_spatial_analysis.py +260 -0
  77. soildb-0.1.0/examples/03_metadata_example.py +166 -0
  78. soildb-0.1.0/pyproject.toml +132 -0
  79. soildb-0.1.0/requirements-dev.txt +27 -0
  80. soildb-0.1.0/src/soildb/__init__.py +102 -0
  81. soildb-0.1.0/src/soildb/client.py +241 -0
  82. soildb-0.1.0/src/soildb/convenience.py +228 -0
  83. soildb-0.1.0/src/soildb/exceptions.py +68 -0
  84. soildb-0.1.0/src/soildb/fetch.py +485 -0
  85. soildb-0.1.0/src/soildb/metadata.py +428 -0
  86. soildb-0.1.0/src/soildb/query.py +516 -0
  87. soildb-0.1.0/src/soildb/response.py +498 -0
  88. soildb-0.1.0/src/soildb/spatial.py +450 -0
  89. soildb-0.1.0/tests/conftest.py +48 -0
  90. soildb-0.1.0/tests/test_client.py +24 -0
  91. soildb-0.1.0/tests/test_fetch.py +371 -0
  92. soildb-0.1.0/tests/test_integration.py +65 -0
  93. soildb-0.1.0/tests/test_metadata.py +310 -0
  94. soildb-0.1.0/tests/test_query.py +119 -0
  95. soildb-0.1.0/tests/test_response.py +213 -0
@@ -0,0 +1,173 @@
1
+ name: CI/CD Pipeline
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main ]
8
+ release:
9
+ types: [ published ]
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v5
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Cache pip dependencies
27
+ uses: actions/cache@v4
28
+ with:
29
+ path: ~/.cache/pip
30
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt', '**/pyproject.toml') }}
31
+ restore-keys: |
32
+ ${{ runner.os }}-pip-
33
+
34
+ - name: Install dependencies
35
+ run: |
36
+ python -m pip install --upgrade pip
37
+ pip install -e ".[all]"
38
+
39
+ - name: Lint with ruff
40
+ run: |
41
+ ruff check src/ tests/ examples/ --output-format=github
42
+ continue-on-error: true
43
+
44
+ - name: Type check with mypy
45
+ run: |
46
+ mypy src/soildb --ignore-missing-imports
47
+ continue-on-error: true
48
+
49
+ - name: Test with pytest
50
+ run: |
51
+ pytest tests/ -v --cov=soildb --cov-report=xml --cov-report=term-missing
52
+
53
+ - name: Upload coverage to Codecov
54
+ if: matrix.python-version == '3.11'
55
+ uses: codecov/codecov-action@v5
56
+ with:
57
+ file: ./coverage.xml
58
+ fail_ci_if_error: false
59
+
60
+ lint:
61
+ runs-on: ubuntu-latest
62
+ steps:
63
+ - uses: actions/checkout@v5
64
+
65
+ - name: Set up Python
66
+ uses: actions/setup-python@v5
67
+ with:
68
+ python-version: "3.11"
69
+
70
+ - name: Install dependencies
71
+ run: |
72
+ python -m pip install --upgrade pip
73
+ pip install ruff mypy
74
+
75
+ - name: Lint with ruff
76
+ run: |
77
+ ruff check src/ tests/ examples/ --output-format=github
78
+ continue-on-error: true
79
+
80
+ - name: Type check with mypy
81
+ run: |
82
+ mypy src/soildb --ignore-missing-imports
83
+
84
+ security:
85
+ runs-on: ubuntu-latest
86
+ steps:
87
+ - uses: actions/checkout@v5
88
+
89
+ - name: Set up Python
90
+ uses: actions/setup-python@v5
91
+ with:
92
+ python-version: "3.11"
93
+
94
+ - name: Install dependencies
95
+ run: |
96
+ python -m pip install --upgrade pip
97
+ pip install bandit safety
98
+
99
+ - name: Run security checks with bandit
100
+ run: |
101
+ bandit -r src/ -f json -o bandit-report.json
102
+ continue-on-error: true
103
+
104
+ - name: Check dependencies with safety
105
+ run: |
106
+ safety check --json --output safety-report.json
107
+ continue-on-error: true
108
+
109
+ - name: Upload security artifacts
110
+ uses: actions/upload-artifact@v4
111
+ with:
112
+ name: security-reports
113
+ path: |
114
+ bandit-report.json
115
+ safety-report.json
116
+
117
+ examples:
118
+ runs-on: ubuntu-latest
119
+ steps:
120
+ - uses: actions/checkout@v5
121
+
122
+ - name: Set up Python
123
+ uses: actions/setup-python@v5
124
+ with:
125
+ python-version: "3.11"
126
+
127
+ - name: Install dependencies
128
+ run: |
129
+ python -m pip install --upgrade pip
130
+ pip install -e ".[dev]"
131
+
132
+ - name: Test basic examples (no network)
133
+ run: |
134
+ python -c "
135
+ import sys
136
+ sys.path.insert(0, 'examples')
137
+
138
+ # Test imports and basic functionality
139
+ try:
140
+ import soildb
141
+ print('Package imports successfully')
142
+
143
+ query = soildb.get_mapunit_by_areasymbol('IA169')
144
+ print('Basic query construction works')
145
+
146
+ print('All basic functionality tests passed')
147
+ except Exception as e:
148
+ print(f'Basic functionality test failed: {e}')
149
+ sys.exit(1)
150
+ "
151
+
152
+ integration:
153
+ runs-on: ubuntu-latest
154
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
155
+ needs: [test, lint]
156
+ steps:
157
+ - uses: actions/checkout@v5
158
+
159
+ - name: Set up Python
160
+ uses: actions/setup-python@v5
161
+ with:
162
+ python-version: "3.11"
163
+
164
+ - name: Install dependencies
165
+ run: |
166
+ python -m pip install --upgrade pip
167
+ pip install -e ".[all]"
168
+
169
+ - name: Run integration tests (with network)
170
+ run: |
171
+ pytest tests/test_integration.py -v -m "not slow" --timeout=30
172
+ env:
173
+ PYTHONPATH: ${{ github.workspace }}/src
@@ -0,0 +1,36 @@
1
+ name: Upload Python Package to PyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ release:
6
+ types: [created]
7
+
8
+ jobs:
9
+ pypi-publish:
10
+ name: Publish release to PyPI
11
+ runs-on: ubuntu-latest
12
+ environment:
13
+ name: pypi
14
+ url: https://pypi.org/p/py-soildb
15
+ permissions:
16
+ id-token: write
17
+ steps:
18
+ - uses: actions/checkout@v5
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.x"
23
+ - name: Install and verify Hatch
24
+ run: |
25
+ sudo apt install pipx
26
+ pipx install hatch
27
+ hatch --version
28
+ - name: Install dependencies
29
+ run: |
30
+ python -m pip install --upgrade pip
31
+ pip install -r requirements-dev.txt
32
+ - name: Build package
33
+ run: |
34
+ hatch build
35
+ - name: Publish package distributions to PyPI
36
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,178 @@
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
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ .ruff_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ #Pipfile.lock
97
+
98
+ # poetry
99
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103
+ #poetry.lock
104
+
105
+ # pdm
106
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107
+ #pdm.lock
108
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109
+ # in version control.
110
+ # https://pdm.fming.dev/#use-with-ide
111
+ .pdm.toml
112
+
113
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
114
+ __pypackages__/
115
+
116
+ # Celery stuff
117
+ celerybeat-schedule
118
+ celerybeat.pid
119
+
120
+ # SageMath parsed files
121
+ *.sage.py
122
+
123
+ # Environments
124
+ .env
125
+ .venv
126
+ env/
127
+ venv/
128
+ ENV/
129
+ env.bak/
130
+ venv.bak/
131
+
132
+ # Spyder project settings
133
+ .spyderproject
134
+ .spyproject
135
+
136
+ # Rope project settings
137
+ .ropeproject
138
+
139
+ # mkdocs documentation
140
+ /site
141
+
142
+ # mypy
143
+ .mypy_cache/
144
+ .dmypy.json
145
+ dmypy.json
146
+
147
+ # Pyre type checker
148
+ .pyre/
149
+
150
+ # pytype static type analyzer
151
+ .pytype/
152
+
153
+ # Cython debug symbols
154
+ cython_debug/
155
+
156
+ # PyCharm
157
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
158
+ # be added to the global gitignore or merged into this project gitignore. For PyCharm
159
+ # Community Edition, use 'PyCharm CE' instead of 'PyCharm'.
160
+ .idea/
161
+
162
+ # VS Code
163
+ .vscode/
164
+
165
+ # macOS
166
+ .DS_Store
167
+
168
+ # Test data
169
+ test_data/
170
+ *.csv
171
+ *.parquet
172
+
173
+ # scratch files
174
+ scratch/
175
+ examples_p/
176
+
177
+ # agent instructions
178
+ copilot-instructions.md
@@ -0,0 +1,33 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.4.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-added-large-files
9
+ - id: check-merge-conflict
10
+ - id: check-toml
11
+
12
+ - repo: https://github.com/astral-sh/ruff-pre-commit
13
+ rev: v0.1.0
14
+ hooks:
15
+ - id: ruff
16
+ args: [--fix, --exit-non-zero-on-fix]
17
+ - id: ruff-format
18
+
19
+ - repo: https://github.com/pre-commit/mirrors-mypy
20
+ rev: v1.5.1
21
+ hooks:
22
+ - id: mypy
23
+ additional_dependencies: [types-all]
24
+ args: [--ignore-missing-imports]
25
+
26
+ - repo: local
27
+ hooks:
28
+ - id: quarto-readme
29
+ name: Render README
30
+ entry: quarto render docs/index.qmd --to gfm --output README.md && mv docs/README.md ../README.md
31
+ language: system
32
+ files: ^docs/index.qmd$
33
+ stages: [pre-commit]
@@ -0,0 +1,21 @@
1
+ version: 2
2
+
3
+ build:
4
+ os: ubuntu-22.04
5
+ tools:
6
+ python: "3.10"
7
+ jobs:
8
+ post_install:
9
+ - pip install -r requirements-dev.txt
10
+ - pip install -e .
11
+ - curl -LO https://github.com/quarto-dev/quarto-cli/releases/download/v1.4.553/quarto-1.4.553-linux-amd64.deb
12
+ - apt-get update && apt-get install -y ./quarto-1.4.553-linux-amd64.deb
13
+ - quartodoc build --config docs/_quarto.yml
14
+ - quarto render docs/
15
+ formats: []
16
+ sphinx:
17
+ configuration: null
18
+ mkdocs:
19
+ configuration: null
20
+ output:
21
+ html: docs/_site
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ ## [0.1.0] - 2025-09-28
4
+
5
+ Initial release of soildb Python package.
6
+
7
+ ### Added
8
+ - SDA client for querying USDA soil data
9
+ - Query builder for custom SQL queries
10
+ - DataFrame export (pandas and polars)
11
+ - Spatial queries with bounding boxes and points
12
+ - Bulk data fetching with pagination
13
+ - Example scripts for soil analysis
@@ -0,0 +1,135 @@
1
+ # Contributing
2
+
3
+ Guidelines for contributing to soildb.
4
+
5
+ ## Development Setup
6
+
7
+ 1. Fork the repository and clone your fork:
8
+ ```bash
9
+ git clone https://github.com/your-username/py-soildb.git
10
+ cd py-soildb
11
+ ```
12
+
13
+ 2. Create a virtual environment:
14
+ ```bash
15
+ python -m venv venv
16
+ source venv/bin/activate # On Windows: venv\Scripts\activate
17
+ ```
18
+
19
+ 3. Install the package in development mode:
20
+ ```bash
21
+ pip install -e ".[dev,dataframes,spatial]"
22
+ ```
23
+
24
+ 4. Install pre-commit hooks:
25
+ ```bash
26
+ pre-commit install
27
+ ```
28
+
29
+ ## Running Tests
30
+
31
+ Run the test suite:
32
+ ```bash
33
+ pytest
34
+ ```
35
+
36
+ Run tests with coverage:
37
+ ```bash
38
+ pytest --cov=soildb --cov-report=html
39
+ ```
40
+
41
+ Run only unit tests (skip integration tests):
42
+ ```bash
43
+ pytest -m "not integration"
44
+ ```
45
+
46
+ ## Code Style
47
+
48
+ We use several tools to maintain code quality:
49
+
50
+ - **ruff** for code formatting and linting (combines Black, flake8, and more)
51
+ - **mypy** for type checking
52
+
53
+ Run all checks:
54
+ ```bash
55
+ ruff check src/ tests/ examples/
56
+ ruff format src/ tests/ examples/
57
+ mypy src/
58
+ ```
59
+
60
+ Or use the Makefile shortcuts:
61
+ ```bash
62
+ make lint # Run ruff check and mypy
63
+ make format # Format code with ruff
64
+ ```
65
+
66
+ ## Making Changes
67
+
68
+ 1. Create a new branch for your feature or bug fix:
69
+ ```bash
70
+ git checkout -b feature/your-feature-name
71
+ ```
72
+
73
+ 2. Make your changes and write tests to cover them.
74
+
75
+ 3. Ensure all tests pass and code style checks pass.
76
+
77
+ 4. Commit your changes with a clear commit message:
78
+ ```bash
79
+ git commit -m "Add feature: description of your changes"
80
+ ```
81
+
82
+ 5. Push your changes and create a pull request.
83
+
84
+ ## Pull Request Guidelines
85
+
86
+ - Include a clear description of the changes
87
+ - Reference any related issues
88
+ - Ensure all tests pass
89
+ - Include tests for new functionality
90
+ - Update documentation as needed
91
+ - Follow the existing code style
92
+
93
+ ## Reporting Issues
94
+
95
+ When reporting issues, please include:
96
+
97
+ - Python version
98
+ - soildb version
99
+ - Operating system
100
+ - Complete error traceback
101
+ - Minimal code example that reproduces the issue
102
+
103
+ ## Integration Tests
104
+
105
+ Some tests require network access to query the actual SDA service. These are marked with `@pytest.mark.integration` and are skipped by default.
106
+
107
+ To run integration tests:
108
+ ```bash
109
+ pytest -m integration
110
+ ```
111
+
112
+ **Note:** Integration tests may fail if the SDA service is under maintenance.
113
+
114
+ ## Documentation
115
+
116
+ Documentation is built using Sphinx. To build documentation locally:
117
+
118
+ ```bash
119
+ cd docs/
120
+ make html
121
+ ```
122
+
123
+ The built documentation will be in `docs/_build/html/`.
124
+
125
+ ## Release Process
126
+
127
+ 1. Update version in `pyproject.toml` and `src/soildb/__init__.py`
128
+ 2. Update `CHANGELOG.md`
129
+ 3. Create a git tag: `git tag v0.x.x`
130
+ 4. Push tag: `git push origin v0.x.x`
131
+ 5. GitHub Actions will automatically build and publish to PyPI
132
+
133
+ ## License
134
+
135
+ By contributing to soildb, you agree that your contributions will be licensed under the MIT License.
soildb-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Andrew Brown
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.
soildb-0.1.0/Makefile ADDED
@@ -0,0 +1,69 @@
1
+ .PHONY: help install test lint format docs clean build
2
+ .DEFAULT_GOAL := help
3
+
4
+ help: ## Show this help message
5
+ @echo "Available commands:"
6
+ @awk 'BEGIN {FS = ":.*##"} /^[a-zA-Z_-]+:.*?##/ { printf " %-15s %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
7
+
8
+ install: ## Install the package in development mode
9
+ pip install -e ".[dev,dataframes,spatial,docs,security]"
10
+
11
+ install-prod: ## Install only production dependencies
12
+ pip install -e .
13
+
14
+ test: ## Run the test suite
15
+ pytest tests/ -v
16
+
17
+ test-cov: ## Run tests with coverage
18
+ pytest tests/ -v --cov=soildb --cov-report=html --cov-report=term-missing
19
+
20
+ test-integration: ## Run integration tests (requires network)
21
+ pytest tests/test_integration.py -v
22
+
23
+ lint: ## Run linting checks
24
+ ruff check src/ tests/ examples/
25
+ mypy src/soildb --ignore-missing-imports
26
+
27
+ format: ## Format code
28
+ ruff format src/ tests/ examples/
29
+
30
+ format-check: ## Check code formatting without making changes
31
+ ruff format --check src/ tests/ examples/
32
+
33
+ security: ## Run security checks
34
+ bandit -r src/
35
+ safety check
36
+
37
+ docs: ## Build documentation with Quarto
38
+ quartodoc build --config docs/_quarto.yml
39
+ quarto render docs
40
+
41
+ docs-serve: ## Serve documentation with Quarto and watch for changes
42
+ quartodoc build --config docs/_quarto.yml
43
+ quarto preview docs
44
+
45
+ clean: ## Clean build artifacts
46
+ rm -rf build/
47
+ rm -rf dist/
48
+ rm -rf *.egg-info/
49
+ rm -rf .coverage
50
+ rm -rf htmlcov/
51
+ rm -rf .pytest_cache/
52
+ rm -rf .mypy_cache/
53
+ find . -type d -name __pycache__ -exec rm -rf {} +
54
+ find . -type f -name "*.pyc" -delete
55
+
56
+ build: ## Build the package
57
+ python -m build
58
+
59
+ pre-commit-install: ## Install pre-commit hooks
60
+ pre-commit install
61
+
62
+ pre-commit-run: ## Run pre-commit on all files
63
+ pre-commit run --all-files
64
+
65
+ examples: ## Run example scripts (basic functionality test)
66
+ @echo "Testing basic examples..."
67
+ @python -c "import soildb; print('✓ Package imports successfully')"
68
+ @python examples/basic_examples.py
69
+ @echo "✓ All examples completed successfully"