{"id":18395832,"url":"https://github.com/deepset-ai/prompthub-py","last_synced_at":"2025-04-07T03:35:16.994Z","repository":{"id":163543833,"uuid":"617380973","full_name":"deepset-ai/prompthub-py","owner":"deepset-ai","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-01T09:13:04.000Z","size":42,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-09-19T01:49:24.375Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepset-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-22T09:19:06.000Z","updated_at":"2023-10-11T13:39:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"e4afa793-a092-4283-977d-2dee9ba9c0ef","html_url":"https://github.com/deepset-ai/prompthub-py","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fprompthub-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fprompthub-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fprompthub-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepset-ai%2Fprompthub-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepset-ai","download_url":"https://codeload.github.com/deepset-ai/prompthub-py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223271116,"owners_count":17117303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T02:12:02.033Z","updated_at":"2024-11-06T02:12:02.107Z","avatar_url":"https://github.com/deepset-ai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prompt Hub Python Client\n\n[![PyPI - Version][pypi-badge]][pypi-project] [![Tests][tests-badge]][tests-workflow]\n\nA simple client to fetch prompts from [Prompt Hub][prompt-hub] using its REST API.\n\n## Usage\n\nFirst step is obviously installation:\n\n```\npip install prompthub-py\n```\n\nThen you can import `Prompt`, that class is all you're going to need.\n\n```python\nimport prompthub\n\n# To load from a JSON file\np = prompthub.from_json(\"./path/to/my/prompt.json\")\n\n\n# To load from a YAML file\np = prompthub.from_yaml(\"./path/to/my/prompt.yaml\")\n\n\n# To load from Prompt Hub\np = prompthub.fetch(\"deepset/question-answering\")\n\n# To get the prompt text (see Prompt class)\np.text\n```\n\nIf you want to use a different Prompt Hub you must set the `PROMPTHUB_MAIN_ENDPOINT` environment variable to your main endpoint.\n\nIf the environment variable is not set the default `api.prompthub.deepset.ai` will be used.\n\n## Testing\n\nTo run tests locally first install dev dependencies, we use [`poetry`][python-poetry] to manage our dependencies:\n\n```\npoetry install --with=dev\n```\n\nRun Prompt Hub locally with a set of fake prompts:\n\n```\ndocker run -p80:80 --volume $PWD/test/fake_prompts:/prompts deepset/prompthub\n```\n\nAnd then run tests:\n\n```\npoetry run pytest test\n```\n\n[pypi-badge]: https://img.shields.io/pypi/v/prompthub-py.svg\n[pypi-project]: https://pypi.org/project/prompthub-py\n[prompt-hub]: https://prompthub.deepset.ai/\n[python-poetry]: https://python-poetry.org/\n[tests-badge]: https://github.com/deepset-ai/prompthub-py/actions/workflows/test.yml/badge.svg\n[tests-workflow]: https://github.com/deepset-ai/prompthub-py/actions/workflows/test.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepset-ai%2Fprompthub-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepset-ai%2Fprompthub-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepset-ai%2Fprompthub-py/lists"}