sap-knowledge-pipeline 0.1.0a1__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 (73) hide show
  1. sap_knowledge_pipeline-0.1.0a1/.editorconfig +18 -0
  2. sap_knowledge_pipeline-0.1.0a1/.gitattributes +9 -0
  3. sap_knowledge_pipeline-0.1.0a1/.github/ISSUE_TEMPLATE/bug_report.yml +58 -0
  4. sap_knowledge_pipeline-0.1.0a1/.github/ISSUE_TEMPLATE/config.yml +5 -0
  5. sap_knowledge_pipeline-0.1.0a1/.github/ISSUE_TEMPLATE/feature_request.yml +26 -0
  6. sap_knowledge_pipeline-0.1.0a1/.github/dependabot.yml +13 -0
  7. sap_knowledge_pipeline-0.1.0a1/.github/pull_request_template.md +23 -0
  8. sap_knowledge_pipeline-0.1.0a1/.github/workflows/ci.yml +62 -0
  9. sap_knowledge_pipeline-0.1.0a1/.github/workflows/publish.yml +43 -0
  10. sap_knowledge_pipeline-0.1.0a1/.gitignore +12 -0
  11. sap_knowledge_pipeline-0.1.0a1/CHANGELOG.md +24 -0
  12. sap_knowledge_pipeline-0.1.0a1/CODE_OF_CONDUCT.md +27 -0
  13. sap_knowledge_pipeline-0.1.0a1/CONTRIBUTING.md +62 -0
  14. sap_knowledge_pipeline-0.1.0a1/LICENSE +22 -0
  15. sap_knowledge_pipeline-0.1.0a1/PKG-INFO +618 -0
  16. sap_knowledge_pipeline-0.1.0a1/README.md +575 -0
  17. sap_knowledge_pipeline-0.1.0a1/ROADMAP.md +36 -0
  18. sap_knowledge_pipeline-0.1.0a1/SECURITY.md +26 -0
  19. sap_knowledge_pipeline-0.1.0a1/docs/assets/architecture.svg +63 -0
  20. sap_knowledge_pipeline-0.1.0a1/docs/assets/hero.svg +48 -0
  21. sap_knowledge_pipeline-0.1.0a1/examples/hana_to_rag.py +57 -0
  22. sap_knowledge_pipeline-0.1.0a1/examples/live_odata_smoke.py +101 -0
  23. sap_knowledge_pipeline-0.1.0a1/pyproject.toml +101 -0
  24. sap_knowledge_pipeline-0.1.0a1/sap-business-partner-sandbox.example.toml +20 -0
  25. sap_knowledge_pipeline-0.1.0a1/sap-knowledge.example.toml +13 -0
  26. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/__init__.py +29 -0
  27. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/__main__.py +6 -0
  28. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/cli.py +294 -0
  29. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/configuration.py +173 -0
  30. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/errors.py +49 -0
  31. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/integrations/__init__.py +1 -0
  32. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/integrations/fastembed.py +56 -0
  33. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/integrations/qdrant.py +217 -0
  34. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/knowledge/__init__.py +17 -0
  35. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/knowledge/chunking.py +73 -0
  36. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/knowledge/models.py +45 -0
  37. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/knowledge/recipes.py +48 -0
  38. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/knowledge/rendering.py +117 -0
  39. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/models.py +40 -0
  40. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/py.typed +1 -0
  41. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/recipes/__init__.py +10 -0
  42. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/recipes/business_partner.py +19 -0
  43. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sources/__init__.py +1 -0
  44. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sources/hana/__init__.py +6 -0
  45. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sources/hana/catalog.py +124 -0
  46. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sources/hana/client.py +178 -0
  47. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sources/odata/__init__.py +22 -0
  48. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sources/odata/client.py +146 -0
  49. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sources/odata/metadata.py +158 -0
  50. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sources/odata/payloads.py +123 -0
  51. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sources/odata/urls.py +57 -0
  52. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sync/__init__.py +26 -0
  53. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sync/checkpoints.py +42 -0
  54. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sync/hana.py +61 -0
  55. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sync/models.py +61 -0
  56. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sync/pipeline.py +136 -0
  57. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/sync/sinks.py +38 -0
  58. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/vector/__init__.py +7 -0
  59. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/vector/embeddings.py +20 -0
  60. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/vector/models.py +22 -0
  61. sap_knowledge_pipeline-0.1.0a1/src/sap_knowledge/vector/rag.py +46 -0
  62. sap_knowledge_pipeline-0.1.0a1/tests/test_business_partner_flow.py +62 -0
  63. sap_knowledge_pipeline-0.1.0a1/tests/test_cli.py +177 -0
  64. sap_knowledge_pipeline-0.1.0a1/tests/test_client.py +84 -0
  65. sap_knowledge_pipeline-0.1.0a1/tests/test_configuration.py +145 -0
  66. sap_knowledge_pipeline-0.1.0a1/tests/test_hana.py +206 -0
  67. sap_knowledge_pipeline-0.1.0a1/tests/test_knowledge.py +144 -0
  68. sap_knowledge_pipeline-0.1.0a1/tests/test_metadata.py +59 -0
  69. sap_knowledge_pipeline-0.1.0a1/tests/test_payloads.py +84 -0
  70. sap_knowledge_pipeline-0.1.0a1/tests/test_qdrant.py +139 -0
  71. sap_knowledge_pipeline-0.1.0a1/tests/test_rag.py +31 -0
  72. sap_knowledge_pipeline-0.1.0a1/tests/test_sync.py +267 -0
  73. sap_knowledge_pipeline-0.1.0a1/tests/test_urls.py +37 -0
@@ -0,0 +1,18 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+
9
+ [*.py]
10
+ indent_style = space
11
+ indent_size = 4
12
+
13
+ [*.{yml,yaml}]
14
+ indent_style = space
15
+ indent_size = 2
16
+
17
+ [*.md]
18
+ trim_trailing_whitespace = false
@@ -0,0 +1,9 @@
1
+ * text=auto
2
+
3
+ *.py text eol=lf
4
+ *.md text eol=lf
5
+ *.toml text eol=lf
6
+ *.yml text eol=lf
7
+ *.yaml text eol=lf
8
+ *.svg text eol=lf
9
+
@@ -0,0 +1,58 @@
1
+ name: Bug report
2
+ description: Report reproducible incorrect behavior
3
+ title: "[Bug]: "
4
+ labels: [bug]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for reporting a problem. Never include SAP credentials, private hostnames, continuation URLs, or customer data.
10
+ - type: input
11
+ id: version
12
+ attributes:
13
+ label: Package version
14
+ placeholder: 0.1.0a1
15
+ validations:
16
+ required: true
17
+ - type: dropdown
18
+ id: source
19
+ attributes:
20
+ label: Source
21
+ options:
22
+ - OData V2
23
+ - OData V4
24
+ - SAP HANA
25
+ - Knowledge transformation
26
+ - Vector indexing or retrieval
27
+ - Other
28
+ validations:
29
+ required: true
30
+ - type: textarea
31
+ id: description
32
+ attributes:
33
+ label: What happened?
34
+ description: Explain the observed and expected behavior.
35
+ validations:
36
+ required: true
37
+ - type: textarea
38
+ id: reproduction
39
+ attributes:
40
+ label: Minimal reproduction
41
+ description: Use synthetic data and remove all secrets and private identifiers.
42
+ render: python
43
+ validations:
44
+ required: true
45
+ - type: textarea
46
+ id: environment
47
+ attributes:
48
+ label: Environment
49
+ description: Include Python, operating system, Django if relevant, and SAP interface versions.
50
+ validations:
51
+ required: true
52
+ - type: checkboxes
53
+ id: safety
54
+ attributes:
55
+ label: Data safety
56
+ options:
57
+ - label: I removed credentials, tokens, private URLs, customer data, and production records.
58
+ required: true
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Security report
4
+ url: https://github.com/yassinbahri/sap-knowledge-pipeline/security/advisories/new
5
+ about: Report vulnerabilities privately. Do not open a public issue.
@@ -0,0 +1,26 @@
1
+ name: Feature request
2
+ description: Propose a focused source, transformation, or retrieval improvement
3
+ title: "[Feature]: "
4
+ labels: [enhancement]
5
+ body:
6
+ - type: textarea
7
+ id: problem
8
+ attributes:
9
+ label: Problem
10
+ description: What SAP-to-knowledge workflow is difficult today?
11
+ validations:
12
+ required: true
13
+ - type: textarea
14
+ id: proposal
15
+ attributes:
16
+ label: Proposed behavior
17
+ description: Describe the smallest useful public contract.
18
+ validations:
19
+ required: true
20
+ - type: textarea
21
+ id: safety
22
+ attributes:
23
+ label: Security and data considerations
24
+ description: Explain authorization, sensitive fields, provenance, and compatibility concerns.
25
+ validations:
26
+ required: true
@@ -0,0 +1,13 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pip
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ groups:
8
+ python-dependencies:
9
+ patterns: ["*"]
10
+ - package-ecosystem: github-actions
11
+ directory: /
12
+ schedule:
13
+ interval: weekly
@@ -0,0 +1,23 @@
1
+ ## Summary
2
+
3
+ Describe the problem and the behavior introduced by this change.
4
+
5
+ Fixes #
6
+
7
+ ## Testing
8
+
9
+ - [ ] Added or updated focused tests.
10
+ - [ ] Ran `ruff check .`.
11
+ - [ ] Ran `ruff format --check .`.
12
+ - [ ] Ran `mypy src`.
13
+ - [ ] Ran `pytest`.
14
+
15
+ ## SAP data safety
16
+
17
+ - [ ] This change contains no credentials, private SAP URLs, customer data, production metadata, or sensitive continuation URLs.
18
+ - [ ] New fields are explicitly allow-listed and provenance remains available.
19
+ - [ ] Tests are offline and use synthetic fixtures or fake connections.
20
+
21
+ ## Documentation
22
+
23
+ - [ ] Updated user documentation and `CHANGELOG.md` when behavior changed.
@@ -0,0 +1,62 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ name: Python ${{ matrix.python-version }}
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
19
+
20
+ steps:
21
+ - uses: actions/checkout@v7
22
+ - uses: actions/setup-python@v7
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+ cache: pip
26
+ - name: Upgrade pip
27
+ run: python -m pip install --upgrade pip
28
+ - name: Install project and development dependencies
29
+ run: python -m pip install --group dev -e .
30
+ - name: Lint
31
+ run: ruff check .
32
+ - name: Check formatting
33
+ run: ruff format --check .
34
+ - name: Type check
35
+ run: mypy src
36
+ - name: Test
37
+ run: pytest
38
+
39
+ package:
40
+ name: Build distribution
41
+ runs-on: ubuntu-latest
42
+ steps:
43
+ - uses: actions/checkout@v7
44
+ - uses: actions/setup-python@v7
45
+ with:
46
+ python-version: "3.13"
47
+ cache: pip
48
+ - run: python -m pip install build check-wheel-contents twine
49
+ - run: python -m build
50
+ - run: twine check --strict dist/*
51
+ - run: check-wheel-contents dist/*.whl
52
+ - name: Smoke test the built wheel
53
+ run: |
54
+ python -m venv /tmp/sap-knowledge-wheel
55
+ /tmp/sap-knowledge-wheel/bin/python -m pip install dist/*.whl
56
+ /tmp/sap-knowledge-wheel/bin/python -c "import sap_knowledge; print(sap_knowledge.__version__)"
57
+ /tmp/sap-knowledge-wheel/bin/sap-knowledge --version
58
+ - uses: actions/upload-artifact@v7
59
+ with:
60
+ name: distributions
61
+ path: dist/
62
+ if-no-files-found: error
@@ -0,0 +1,43 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ build:
12
+ name: Build and validate distributions
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v7
16
+ - uses: actions/setup-python@v7
17
+ with:
18
+ python-version: "3.13"
19
+ - run: python -m pip install build check-wheel-contents twine
20
+ - run: python -m build
21
+ - run: twine check --strict dist/*
22
+ - run: check-wheel-contents dist/*.whl
23
+ - uses: actions/upload-artifact@v7
24
+ with:
25
+ name: distributions
26
+ path: dist/
27
+ if-no-files-found: error
28
+
29
+ publish:
30
+ name: Publish distributions
31
+ needs: build
32
+ runs-on: ubuntu-latest
33
+ environment:
34
+ name: pypi
35
+ url: https://pypi.org/p/sap-knowledge-pipeline
36
+ permissions:
37
+ id-token: write
38
+ steps:
39
+ - uses: actions/download-artifact@v8
40
+ with:
41
+ name: distributions
42
+ path: dist/
43
+ - uses: pypa/gh-action-pypi-publish@v1.14.2
@@ -0,0 +1,12 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.py[cod]
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ .mypy_cache/
7
+ dist/
8
+ build/
9
+ *.egg-info/
10
+ .env
11
+ /data/
12
+ /state/
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ All notable changes to SAP Knowledge Pipeline are documented here. The project
4
+ uses semantic versioning and publishes pre-releases while the public API is
5
+ still evolving.
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0a1] - 2026-08-01
10
+
11
+ ### Added
12
+
13
+ - OData V2 and V4 clients with safe server-driven pagination.
14
+ - EDMX metadata inspection and validated Business Partner recipes.
15
+ - Allow-listed document rendering, deterministic chunking, and citations.
16
+ - Resumable OData synchronization with JSONL upsert/delete events.
17
+ - Local FastEmbed embeddings, Qdrant indexing, search, and grounded prompts.
18
+ - Certificate-validated SAP HANA connectivity and explicit snapshot datasets.
19
+ - Privilege-filtered HANA catalog discovery for schemas, objects, and columns.
20
+ - HANA snapshot conversion into the portable knowledge-event format.
21
+ - Python 3.11 through 3.14 support and a fully offline automated test suite.
22
+
23
+ [Unreleased]: https://github.com/yassinbahri/sap-knowledge-pipeline/compare/0.1.0a1...HEAD
24
+ [0.1.0a1]: https://github.com/yassinbahri/sap-knowledge-pipeline/releases/tag/0.1.0a1
@@ -0,0 +1,27 @@
1
+ # Code of Conduct
2
+
3
+ ## Our commitment
4
+
5
+ We are committed to making participation in this project a respectful,
6
+ harassment-free experience for everyone, regardless of background, identity,
7
+ experience level, or personal characteristics.
8
+
9
+ ## Expected behavior
10
+
11
+ - Be respectful, patient, and constructive.
12
+ - Focus criticism on ideas and code, not people.
13
+ - Welcome questions and contributors with different experience levels.
14
+ - Protect private SAP, customer, and security information.
15
+ - Accept maintainer decisions gracefully and help improve the discussion.
16
+
17
+ ## Unacceptable behavior
18
+
19
+ Harassment, discrimination, personal attacks, deliberate intimidation,
20
+ publication of private information, and sustained disruptive behavior are not
21
+ acceptable.
22
+
23
+ ## Enforcement
24
+
25
+ Report conduct concerns privately through the maintainer's GitHub profile.
26
+ Maintainers may edit or remove contributions and temporarily or permanently ban
27
+ participants whose behavior is harmful to the community.
@@ -0,0 +1,62 @@
1
+ # Contributing
2
+
3
+ Thank you for helping build SAP Knowledge Pipeline. The project is in an early
4
+ stage, so small protocol fixtures, documentation improvements, and focused bug
5
+ fixes are especially valuable.
6
+
7
+ ## Set up the project
8
+
9
+ Fork the repository, clone your fork, and create a branch from `main`:
10
+
11
+ ```console
12
+ git clone https://github.com/YOUR-USERNAME/sap-knowledge-pipeline.git
13
+ cd sap-knowledge-pipeline
14
+ git switch -c fix/short-description
15
+ python -m venv .venv
16
+ ```
17
+
18
+ Activate the environment and install the development dependencies:
19
+
20
+ ```console
21
+ # Windows PowerShell
22
+ .venv\Scripts\Activate.ps1
23
+ python -m pip install --group dev -e .
24
+
25
+ # macOS or Linux
26
+ source .venv/bin/activate
27
+ python -m pip install --group dev -e .
28
+ ```
29
+
30
+ ## Run the checks
31
+
32
+ Run the same checks used by CI before opening a pull request:
33
+
34
+ ```console
35
+ ruff check .
36
+ ruff format --check .
37
+ mypy src
38
+ pytest
39
+ ```
40
+
41
+ Use `ruff format .` to apply formatting. Add a regression test for every bug
42
+ fix. Tests must not require credentials or a live SAP system; use an
43
+ `httpx.MockTransport`, fake DB-API connection, and sanitized fixtures instead.
44
+
45
+ ## Security and test data
46
+
47
+ Never commit SAP credentials, cookies, tokens, internal hostnames, customer
48
+ data, or metadata copied from a private system. Reduce payloads to the smallest
49
+ synthetic fixture that demonstrates the behavior.
50
+
51
+ Please do not open a public issue for a suspected vulnerability. Until a
52
+ private security contact is published, follow [SECURITY.md](SECURITY.md).
53
+
54
+ By participating, you agree to follow the project's
55
+ [Code of Conduct](CODE_OF_CONDUCT.md).
56
+
57
+ ## Pull requests
58
+
59
+ Keep pull requests focused. In the description, explain the problem, the chosen
60
+ behavior, and how it was tested. Link the related issue with `Fixes #123` when
61
+ appropriate. Maintainers may ask for changes when a contribution expands the
62
+ public API or weakens continuation-link validation.
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yassin Bahri
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.
22
+