Name | olangfuse JSON |
Version |
0.1.2
JSON |
| download |
home_page | None |
Summary | A wrapper for Langfuse to manage Trace with full CRUD operations. |
upload_time | 2024-07-19 03:34:56 |
maintainer | None |
docs_url | None |
author | Trinh Do Duy Hung |
requires_python | None |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Open Langfuse
Open Langfuse is your ultimate tool for seamless Trace management, offering comprehensive operations like Download, Create, Update, and the unique DELETE feature. Simply log in to Langfuse and experience hassle-free access without needing to revisit the website. Enjoy the ease and efficiency of this powerful library.
## Usage
To begin, ensure you log in to your Langfuse host at least once each time you start or restart your computer.
Next, install the library by running the <b>setup.py</b> file. Use the following command:
```bash
pip install -r requirements.txt
python setup.py install
```
When completed, you can use the library by importing it in your code:
```python
from olangfuse import OpenLangfuse
open_langfuse = OpenLangfuse()
def dowload_traces():
# Download traces from Langfuse in the last 24 hours
time_start = (datetime.now() - timedelta(days=1)).strftime("%d/%m/%Y")
time_end = datetime.now().strftime("%d/%m/%Y")
traces = open_langfuse.download_traces(
time_start=time_start,
time_end=time_end,
)
return traces
def delete_traces():
open_langfuse.delete_traces(
trace_ids=[trace.id for trace in traces]
project_id=traces[0].projectId
)
print("Delete traces successfully")
print(download_traces())
delete_traces()
```
But before run code, you must setup environment variables:
```bash
export LANGFUSE_HOST="<YOUR_LANGFUSE_URL>"
export LANGFUSE_PUBLIC_KEY="pk-lf-<YOUR_PUBLIC_KEY>"
export LANGFUSE_SECRET_KEY="sk-lf-<YOUR_SECRET_KEY>"
```
Other, we also support you setup some optional environment variables:
| Environment Variable | Description | Default Value |
|----------------------|-------------|---------------|
| LANGFUSE_FLUSH_AT | The maximum number of events to batch up before sending. | 150 |
| LANGFUSE_THREADS | The number of threads to use for sending events. | 10 |
| LANGFUSE_TIMEOUT | The timeout for sending events. | 10 |
| LANGFUSE_MAX_RETRIES | The maximum number of retries to send events. | 3 |
| LANGFUSE_FLUSH_INTERVAL | The maximum time to wait before sending a batch. | 0.5 |
| LANGFUSE_VERIFY_SSL | Whether to verify the SSL certificate. | True |
| COOKIE_AUTH | The cookie auth to login into Langfuse. | Auto find |
## Support browser
Due to we use 3rd party library to fetch cookie auth, so we only support some browser:
| Browser | Support | Tested |
|---------|---------|--------|
| Chrome | ✅ | ✅ |
| Firefox | ✅ | ✅ |
## Support OS
OS we support: In this version, we only support Ubuntu 20.04 LTS.
## License
[MIT](https://choosealicense.com/licenses/mit/)
## Contributing
I really need your help to make this project better. Reverse engineering is hard and time-consuming work. So I really appreciate any help you can provide.
If you would like to contribute to the project, please follow the following steps:
1. Fork the repository
2. Clone the project to your local machine
3. Create a new branch
4. Make your changes and create tests for those changes
5. Run the tests and make sure they all pass
6. Run pre-commit hooks
7. Commit your changes and push to your branch
8. Create a pull request
## Contact
If you have any questions, feel free to contact me at [email](mailto:hung.trinh@paradox.ai) or [slack](https://aiolivia.slack.com/team/U062J5DQ76U)
Thank you for your interest in this project!
Raw data
{
"_id": null,
"home_page": null,
"name": "olangfuse",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Trinh Do Duy Hung",
"author_email": "trinhhungsss492@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/84/2d/c015058a72c581007682c7b6f62c942773b3708ec3d55c251c4bdc2d9d7b/olangfuse-0.1.2.tar.gz",
"platform": null,
"description": "# Open Langfuse\nOpen Langfuse is your ultimate tool for seamless Trace management, offering comprehensive operations like Download, Create, Update, and the unique DELETE feature. Simply log in to Langfuse and experience hassle-free access without needing to revisit the website. Enjoy the ease and efficiency of this powerful library.\n\n## Usage\nTo begin, ensure you log in to your Langfuse host at least once each time you start or restart your computer.\n\nNext, install the library by running the <b>setup.py</b> file. Use the following command:\n```bash\npip install -r requirements.txt\npython setup.py install\n```\n\nWhen completed, you can use the library by importing it in your code:\n```python\nfrom olangfuse import OpenLangfuse\n\nopen_langfuse = OpenLangfuse()\n\n\ndef dowload_traces():\n # Download traces from Langfuse in the last 24 hours\n time_start = (datetime.now() - timedelta(days=1)).strftime(\"%d/%m/%Y\")\n time_end = datetime.now().strftime(\"%d/%m/%Y\")\n traces = open_langfuse.download_traces(\n time_start=time_start,\n time_end=time_end,\n )\n return traces\n\ndef delete_traces():\n open_langfuse.delete_traces(\n trace_ids=[trace.id for trace in traces]\n project_id=traces[0].projectId\n )\n print(\"Delete traces successfully\")\n\nprint(download_traces())\ndelete_traces()\n```\n\nBut before run code, you must setup environment variables:\n```bash\nexport LANGFUSE_HOST=\"<YOUR_LANGFUSE_URL>\"\nexport LANGFUSE_PUBLIC_KEY=\"pk-lf-<YOUR_PUBLIC_KEY>\"\nexport LANGFUSE_SECRET_KEY=\"sk-lf-<YOUR_SECRET_KEY>\"\n```\n\nOther, we also support you setup some optional environment variables:\n| Environment Variable | Description | Default Value |\n|----------------------|-------------|---------------|\n| LANGFUSE_FLUSH_AT | The maximum number of events to batch up before sending. | 150 |\n| LANGFUSE_THREADS | The number of threads to use for sending events. | 10 |\n| LANGFUSE_TIMEOUT | The timeout for sending events. | 10 |\n| LANGFUSE_MAX_RETRIES | The maximum number of retries to send events. | 3 |\n| LANGFUSE_FLUSH_INTERVAL | The maximum time to wait before sending a batch. | 0.5 |\n| LANGFUSE_VERIFY_SSL | Whether to verify the SSL certificate. | True |\n| COOKIE_AUTH | The cookie auth to login into Langfuse. | Auto find |\n\n## Support browser\n\nDue to we use 3rd party library to fetch cookie auth, so we only support some browser:\n\n| Browser | Support | Tested |\n|---------|---------|--------|\n| Chrome | \u2705 | \u2705 |\n| Firefox | \u2705 | \u2705 |\n\n## Support OS\nOS we support: In this version, we only support Ubuntu 20.04 LTS.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n\n\n## Contributing\n\nI really need your help to make this project better. Reverse engineering is hard and time-consuming work. So I really appreciate any help you can provide.\nIf you would like to contribute to the project, please follow the following steps:\n1. Fork the repository\n2. Clone the project to your local machine\n3. Create a new branch\n4. Make your changes and create tests for those changes\n5. Run the tests and make sure they all pass\n6. Run pre-commit hooks\n7. Commit your changes and push to your branch\n8. Create a pull request\n\n## Contact\nIf you have any questions, feel free to contact me at [email](mailto:hung.trinh@paradox.ai) or [slack](https://aiolivia.slack.com/team/U062J5DQ76U)\n\nThank you for your interest in this project!\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A wrapper for Langfuse to manage Trace with full CRUD operations.",
"version": "0.1.2",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c1520aa43d93b72bd75701ecc340de2de3f551c668acded8793a260b4e85b8e4",
"md5": "ed51a8a974393b34860d126efa2c720d",
"sha256": "bb9465059adcc436c8e0cdeb6e42be1f99486de538ceca6df9a1e8b1ded577f9"
},
"downloads": -1,
"filename": "olangfuse-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ed51a8a974393b34860d126efa2c720d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10032,
"upload_time": "2024-07-19T03:34:55",
"upload_time_iso_8601": "2024-07-19T03:34:55.057446Z",
"url": "https://files.pythonhosted.org/packages/c1/52/0aa43d93b72bd75701ecc340de2de3f551c668acded8793a260b4e85b8e4/olangfuse-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "842dc015058a72c581007682c7b6f62c942773b3708ec3d55c251c4bdc2d9d7b",
"md5": "5fd7a1f88f160b644bb887d43439a61a",
"sha256": "355ee451b26d798d806aec2de0a8dfee79e72e4b39f96543879cbac28e1af28a"
},
"downloads": -1,
"filename": "olangfuse-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "5fd7a1f88f160b644bb887d43439a61a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10509,
"upload_time": "2024-07-19T03:34:56",
"upload_time_iso_8601": "2024-07-19T03:34:56.859332Z",
"url": "https://files.pythonhosted.org/packages/84/2d/c015058a72c581007682c7b6f62c942773b3708ec3d55c251c4bdc2d9d7b/olangfuse-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-19 03:34:56",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "olangfuse"
}