promptledger-huggingface 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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ertugrul Mutlu
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.
@@ -0,0 +1,52 @@
1
+ Metadata-Version: 2.4
2
+ Name: promptledger-huggingface
3
+ Version: 0.1.0
4
+ Summary: Optional huggingface provider for PromptLedger
5
+ Author: PromptLedger Contributors
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/Ertugrulmutlu/promptledger
8
+ Project-URL: Documentation, https://github.com/Ertugrulmutlu/promptledger/blob/main/docs/plugin-sdk.md
9
+ Project-URL: Issues, https://github.com/Ertugrulmutlu/promptledger/issues
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: promptledger<0.9,>=0.8
14
+ Requires-Dist: huggingface_hub<2,>=0.30
15
+ Dynamic: license-file
16
+
17
+ # PromptLedger Hugging Face provider
18
+
19
+ Optional provider for PromptLedger 0.8.x (SDK v1).
20
+
21
+ Publish versioned prompt artifacts to an existing private dataset using huggingface_hub. Configure Hugging Face credentials separately. Repository visibility may change after upload; never publish sensitive prompts. Import is not supported.
22
+
23
+ ## Installation
24
+
25
+ ```sh
26
+ python -m pip install promptledger-huggingface
27
+ promptledger plugins conformance huggingface --confirm
28
+ ```
29
+
30
+ From a source checkout, install Core first and use `python -m pip install -e ./plugins/huggingface` instead.
31
+
32
+ ## Usage
33
+
34
+ Initialize a workspace and create the referenced prompt where required. Example:
35
+
36
+ ```sh
37
+ promptledger integrations hf-publish --id greeting --ref 1 --repo account/private-dataset --confirm
38
+ ```
39
+
40
+ ## Before publishing
41
+
42
+ Create a private dataset and configure Hugging Face credentials outside PromptLedger. Use a token with sufficient write permissions for the destination. Review the saved prompt before publication.
43
+
44
+ ```sh
45
+ promptledger plugins run huggingface healthcheck --confirm
46
+ ```
47
+
48
+ A healthcheck does not guarantee write access to the chosen dataset.
49
+
50
+ Providers are trusted Python code, not sandboxed. Explicit confirmation is required for network execution. No automatic synchronization or publication. Review the [SDK guide](https://github.com/Ertugrulmutlu/promptledger/blob/main/docs/plugin-sdk.md) for the trust boundary and provider options.
51
+
52
+ MIT license.
@@ -0,0 +1,36 @@
1
+ # PromptLedger Hugging Face provider
2
+
3
+ Optional provider for PromptLedger 0.8.x (SDK v1).
4
+
5
+ Publish versioned prompt artifacts to an existing private dataset using huggingface_hub. Configure Hugging Face credentials separately. Repository visibility may change after upload; never publish sensitive prompts. Import is not supported.
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ python -m pip install promptledger-huggingface
11
+ promptledger plugins conformance huggingface --confirm
12
+ ```
13
+
14
+ From a source checkout, install Core first and use `python -m pip install -e ./plugins/huggingface` instead.
15
+
16
+ ## Usage
17
+
18
+ Initialize a workspace and create the referenced prompt where required. Example:
19
+
20
+ ```sh
21
+ promptledger integrations hf-publish --id greeting --ref 1 --repo account/private-dataset --confirm
22
+ ```
23
+
24
+ ## Before publishing
25
+
26
+ Create a private dataset and configure Hugging Face credentials outside PromptLedger. Use a token with sufficient write permissions for the destination. Review the saved prompt before publication.
27
+
28
+ ```sh
29
+ promptledger plugins run huggingface healthcheck --confirm
30
+ ```
31
+
32
+ A healthcheck does not guarantee write access to the chosen dataset.
33
+
34
+ Providers are trusted Python code, not sandboxed. Explicit confirmation is required for network execution. No automatic synchronization or publication. Review the [SDK guide](https://github.com/Ertugrulmutlu/promptledger/blob/main/docs/plugin-sdk.md) for the trust boundary and provider options.
35
+
36
+ MIT license.
@@ -0,0 +1,23 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+ [project]
5
+ name = "promptledger-huggingface"
6
+ version = "0.1.0"
7
+ description = "Optional huggingface provider for PromptLedger"
8
+ requires-python = ">=3.10"
9
+ dependencies = ["promptledger>=0.8,<0.9", "huggingface_hub>=0.30,<2"]
10
+ readme = "README.md"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "PromptLedger Contributors" }]
14
+
15
+ [project.urls]
16
+ Repository = "https://github.com/Ertugrulmutlu/promptledger"
17
+ Documentation = "https://github.com/Ertugrulmutlu/promptledger/blob/main/docs/plugin-sdk.md"
18
+ Issues = "https://github.com/Ertugrulmutlu/promptledger/issues"
19
+
20
+ [project.entry-points."promptledger.plugins"]
21
+ huggingface = "ledger_huggingface:HuggingFacePlugin"
22
+ [tool.setuptools.packages.find]
23
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,29 @@
1
+ """Publish immutable version-specific artifacts to existing private datasets."""
2
+ import hashlib
3
+ import json
4
+ from dataclasses import asdict
5
+ from promptledger.sdk import TypedIntegration, PluginManifest, ArtifactPublisher, HealthcheckProvider, OperationResult
6
+
7
+ def _api():
8
+ try:
9
+ from huggingface_hub import HfApi
10
+ except ImportError as exc:
11
+ raise ValueError('Install huggingface_hub in the plugin environment') from exc
12
+ return HfApi()
13
+
14
+ class HuggingFacePlugin(TypedIntegration, ArtifactPublisher, HealthcheckProvider):
15
+ manifest = PluginManifest('huggingface','0.1.0',('publish','healthcheck'))
16
+ def healthcheck(self, options):
17
+ _api()
18
+ return {'status':'configured','note':'Client available; credentials and server not tested'}
19
+ def publish(self, request):
20
+ api = _api()
21
+ info = api.repo_info(repo_id=request.destination,repo_type='dataset')
22
+ if info.private is not True: raise ValueError('Only existing private dataset repositories are supported')
23
+ p = request.prompt
24
+ data = json.dumps({'schema_version':1,**asdict(p)},ensure_ascii=False,sort_keys=True,indent=2).encode()
25
+ digest = hashlib.sha256(data).hexdigest()
26
+ path = f'prompts/{digest}.json'
27
+ result = api.upload_file(path_or_fileobj=data,path_in_repo=path,repo_id=request.destination,
28
+ repo_type='dataset',commit_message=f'PromptLedger version {p.version}')
29
+ return OperationResult(request.destination,{'path':path,'artifact_sha256':digest,'commit_url':str(result.commit_url)})
@@ -0,0 +1,52 @@
1
+ Metadata-Version: 2.4
2
+ Name: promptledger-huggingface
3
+ Version: 0.1.0
4
+ Summary: Optional huggingface provider for PromptLedger
5
+ Author: PromptLedger Contributors
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/Ertugrulmutlu/promptledger
8
+ Project-URL: Documentation, https://github.com/Ertugrulmutlu/promptledger/blob/main/docs/plugin-sdk.md
9
+ Project-URL: Issues, https://github.com/Ertugrulmutlu/promptledger/issues
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: promptledger<0.9,>=0.8
14
+ Requires-Dist: huggingface_hub<2,>=0.30
15
+ Dynamic: license-file
16
+
17
+ # PromptLedger Hugging Face provider
18
+
19
+ Optional provider for PromptLedger 0.8.x (SDK v1).
20
+
21
+ Publish versioned prompt artifacts to an existing private dataset using huggingface_hub. Configure Hugging Face credentials separately. Repository visibility may change after upload; never publish sensitive prompts. Import is not supported.
22
+
23
+ ## Installation
24
+
25
+ ```sh
26
+ python -m pip install promptledger-huggingface
27
+ promptledger plugins conformance huggingface --confirm
28
+ ```
29
+
30
+ From a source checkout, install Core first and use `python -m pip install -e ./plugins/huggingface` instead.
31
+
32
+ ## Usage
33
+
34
+ Initialize a workspace and create the referenced prompt where required. Example:
35
+
36
+ ```sh
37
+ promptledger integrations hf-publish --id greeting --ref 1 --repo account/private-dataset --confirm
38
+ ```
39
+
40
+ ## Before publishing
41
+
42
+ Create a private dataset and configure Hugging Face credentials outside PromptLedger. Use a token with sufficient write permissions for the destination. Review the saved prompt before publication.
43
+
44
+ ```sh
45
+ promptledger plugins run huggingface healthcheck --confirm
46
+ ```
47
+
48
+ A healthcheck does not guarantee write access to the chosen dataset.
49
+
50
+ Providers are trusted Python code, not sandboxed. Explicit confirmation is required for network execution. No automatic synchronization or publication. Review the [SDK guide](https://github.com/Ertugrulmutlu/promptledger/blob/main/docs/plugin-sdk.md) for the trust boundary and provider options.
51
+
52
+ MIT license.
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/ledger_huggingface/__init__.py
5
+ src/promptledger_huggingface.egg-info/PKG-INFO
6
+ src/promptledger_huggingface.egg-info/SOURCES.txt
7
+ src/promptledger_huggingface.egg-info/dependency_links.txt
8
+ src/promptledger_huggingface.egg-info/entry_points.txt
9
+ src/promptledger_huggingface.egg-info/requires.txt
10
+ src/promptledger_huggingface.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [promptledger.plugins]
2
+ huggingface = ledger_huggingface:HuggingFacePlugin
@@ -0,0 +1,2 @@
1
+ promptledger<0.9,>=0.8
2
+ huggingface_hub<2,>=0.30