Name | pypeprompts JSON |
Version |
0.0.7
JSON |
| download |
home_page | None |
Summary | A simple tracker for OpenAI API calls for Pype App |
upload_time | 2024-09-10 16:40:17 |
maintainer | None |
docs_url | None |
author | dhruv |
requires_python | <4.0,>=3.8.1 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pypeprompts
[![PyPI version](https://badge.fury.io/py/pypeprompts.svg)](https://badge.fury.io/py/pypeprompts)
[![Python Versions](https://img.shields.io/pypi/pyversions/pypeprompts.svg)](https://pypi.org/project/pypeprompts/)
[![Downloads](https://pepy.tech/badge/pypeprompts)](https://pepy.tech/project/pypeprompts)
A Python SDK for tracking and sending analytics data to Pype App.
## Important Notice
This package is designed to send data to Pype App, a SaaS application. By using this package, you agree to the terms of service of Pype App. Please ensure you have the necessary rights and permissions to send this data.
## Installation
You can install `pypeprompts` using pip:
```bash
pip install --upgrade pypeprompts
```
Or if you prefer using Poetry:
```bash
poetry add pypeprompts
```
## Requirements
- Python 3.8.1 or higher
## Obtaining Your Project Token
To use `pypeprompts`, you'll need a project token. This token is used to authenticate your requests and associate the analytics data with your account. You can obtain your project token by following these steps:
1. Visit [pypeai.com](https://www.pypeai.com) and log in to your account.
2. Create a project.
3. Click on Publish to generate the token.
If you encounter any issues or need assistance obtaining your project token, please contact dhruv@pypeai.com
## Usage
Here's a quick example of how to use `pypeprompts`:
```python
from pypeprompts import PromptAnalyticsTracker
# Initialize the tracker with your project token from pypeai.com
tracker = PromptAnalyticsTracker(project_token="your_project_token")
# Track an event and get the promptId
prompt_id = tracker.track("workflow_name", {
"prompt": "Your input prompt",
"output": "Generated output",
"processingTime": 1.5,
"tags": ["tag1", "tag2"],
"attributes": {"key": "value"}
})
print(f"Prompt ID: {prompt_id}")
# Async tracking
import asyncio
async def async_track():
prompt_id = await tracker.track_async("async_workflow", {
"prompt": "Async input prompt",
"output": "Async generated output",
"processingTime": 0.8,
"tags": ["async", "example"],
"attributes": {"async_key": "async_value"}
})
print(f"Async Prompt ID: {prompt_id}")
asyncio.run(async_track())
```
## Features
- Simple API for tracking and sending analytics data to Pype App
- Synchronous and asynchronous tracking methods
- Returns a unique `promptId` for each tracked event
- Customizable logging
- Error handling and reporting
## Configuration
You can configure the `PromptAnalyticsTracker` with the following parameters:
- `project_token` (required): Your project token for authentication (obtained from pypeai.com)
- `enabled` (optional): Set to `False` to disable tracking (default: `True`)
## Error Handling
The package uses a custom `PromptAnalyticsError` for error handling. Make sure to catch this exception in your code for proper error management.
## Logging
`pypeprompts` uses Python's built-in `logging` module. Logs are written to both a file (`prompt_analytics.log`) and the console. You can adjust the log level as needed.
## Data Privacy and Security
This package sends data to Pype App. Please ensure you comply with all applicable data protection laws and regulations when using this package. Do not send sensitive or personal information unless you have the necessary permissions and security measures in place.
## License
This project is proprietary software. All rights reserved. You are granted a limited license to use this software in conjunction with Pype App services, subject to the terms of service of Pype App.
## Support
If you encounter any problems or have any questions, please open an issue on the GitHub repository or contact the author at dhruv@pypeai.com.
Raw data
{
"_id": null,
"home_page": null,
"name": "pypeprompts",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8.1",
"maintainer_email": null,
"keywords": null,
"author": "dhruv",
"author_email": "dhruv@pypeai.com",
"download_url": "https://files.pythonhosted.org/packages/7f/07/e4e02d7448f2e63f50fd83f4b637091d6e9832c55546d7e7cb0fb9fcb064/pypeprompts-0.0.7.tar.gz",
"platform": null,
"description": "# pypeprompts\n\n[![PyPI version](https://badge.fury.io/py/pypeprompts.svg)](https://badge.fury.io/py/pypeprompts)\n[![Python Versions](https://img.shields.io/pypi/pyversions/pypeprompts.svg)](https://pypi.org/project/pypeprompts/)\n[![Downloads](https://pepy.tech/badge/pypeprompts)](https://pepy.tech/project/pypeprompts)\n\nA Python SDK for tracking and sending analytics data to Pype App.\n\n## Important Notice\n\nThis package is designed to send data to Pype App, a SaaS application. By using this package, you agree to the terms of service of Pype App. Please ensure you have the necessary rights and permissions to send this data.\n\n## Installation\n\nYou can install `pypeprompts` using pip:\n\n```bash\npip install --upgrade pypeprompts\n```\n\nOr if you prefer using Poetry:\n\n```bash\npoetry add pypeprompts\n```\n\n## Requirements\n\n- Python 3.8.1 or higher\n\n## Obtaining Your Project Token\n\nTo use `pypeprompts`, you'll need a project token. This token is used to authenticate your requests and associate the analytics data with your account. You can obtain your project token by following these steps:\n\n1. Visit [pypeai.com](https://www.pypeai.com) and log in to your account.\n2. Create a project.\n3. Click on Publish to generate the token.\n\nIf you encounter any issues or need assistance obtaining your project token, please contact dhruv@pypeai.com\n\n## Usage\n\nHere's a quick example of how to use `pypeprompts`:\n\n```python\nfrom pypeprompts import PromptAnalyticsTracker\n\n# Initialize the tracker with your project token from pypeai.com\ntracker = PromptAnalyticsTracker(project_token=\"your_project_token\")\n\n# Track an event and get the promptId\nprompt_id = tracker.track(\"workflow_name\", {\n \"prompt\": \"Your input prompt\",\n \"output\": \"Generated output\",\n \"processingTime\": 1.5,\n \"tags\": [\"tag1\", \"tag2\"],\n \"attributes\": {\"key\": \"value\"}\n})\nprint(f\"Prompt ID: {prompt_id}\")\n\n# Async tracking\nimport asyncio\n\nasync def async_track():\n prompt_id = await tracker.track_async(\"async_workflow\", {\n \"prompt\": \"Async input prompt\",\n \"output\": \"Async generated output\",\n \"processingTime\": 0.8,\n \"tags\": [\"async\", \"example\"],\n \"attributes\": {\"async_key\": \"async_value\"}\n })\n print(f\"Async Prompt ID: {prompt_id}\")\n\nasyncio.run(async_track())\n```\n\n## Features\n\n- Simple API for tracking and sending analytics data to Pype App\n- Synchronous and asynchronous tracking methods\n- Returns a unique `promptId` for each tracked event\n- Customizable logging\n- Error handling and reporting\n\n## Configuration\n\nYou can configure the `PromptAnalyticsTracker` with the following parameters:\n\n- `project_token` (required): Your project token for authentication (obtained from pypeai.com)\n- `enabled` (optional): Set to `False` to disable tracking (default: `True`)\n\n## Error Handling\n\nThe package uses a custom `PromptAnalyticsError` for error handling. Make sure to catch this exception in your code for proper error management.\n\n## Logging\n\n`pypeprompts` uses Python's built-in `logging` module. Logs are written to both a file (`prompt_analytics.log`) and the console. You can adjust the log level as needed.\n\n## Data Privacy and Security\n\nThis package sends data to Pype App. Please ensure you comply with all applicable data protection laws and regulations when using this package. Do not send sensitive or personal information unless you have the necessary permissions and security measures in place.\n\n## License\n\nThis project is proprietary software. All rights reserved. You are granted a limited license to use this software in conjunction with Pype App services, subject to the terms of service of Pype App.\n\n## Support\n\nIf you encounter any problems or have any questions, please open an issue on the GitHub repository or contact the author at dhruv@pypeai.com.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A simple tracker for OpenAI API calls for Pype App",
"version": "0.0.7",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c6a952ad01226df0b0fe21c89b9e40af4fb82b2169cf30a007e5418d0231e1cb",
"md5": "82cdf35c27a1b500d862c5e64110af46",
"sha256": "0502633742069aafff43c32f040e61cc80b5ae332a20c8a68a68461ac7da57c3"
},
"downloads": -1,
"filename": "pypeprompts-0.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "82cdf35c27a1b500d862c5e64110af46",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8.1",
"size": 5974,
"upload_time": "2024-09-10T16:40:16",
"upload_time_iso_8601": "2024-09-10T16:40:16.091936Z",
"url": "https://files.pythonhosted.org/packages/c6/a9/52ad01226df0b0fe21c89b9e40af4fb82b2169cf30a007e5418d0231e1cb/pypeprompts-0.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7f07e4e02d7448f2e63f50fd83f4b637091d6e9832c55546d7e7cb0fb9fcb064",
"md5": "a99d09914257ef05b6f181b6cdc17198",
"sha256": "d5f25f6dc4a19d663a5377f1770d59f9b85d8325964075c4b1d4d25df31ef928"
},
"downloads": -1,
"filename": "pypeprompts-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "a99d09914257ef05b6f181b6cdc17198",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8.1",
"size": 5250,
"upload_time": "2024-09-10T16:40:17",
"upload_time_iso_8601": "2024-09-10T16:40:17.240465Z",
"url": "https://files.pythonhosted.org/packages/7f/07/e4e02d7448f2e63f50fd83f4b637091d6e9832c55546d7e7cb0fb9fcb064/pypeprompts-0.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-10 16:40:17",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pypeprompts"
}