| Name | auto-impl JSON |
| Version |
0.1.3
JSON |
| download |
| home_page | None |
| Summary | Automatically implements functions using ChatGPT. |
| upload_time | 2024-08-14 12:58:36 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.8 |
| license | MIT License Copyright (c) 2024 Harry T. Ma Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# auto_impl
Automatically implements functions using the [llm](https://llm.datasette.io/) toolkit.
## Install
pip install auto_impl --upgrade
## Usage
First install `llm`. Follow the instructions from the llm site to set it up. For example, use `llm keys set openai` to set up a ChatGPT API key and `llm "Ten fun names for a pet pelican"` to test it.
### @auto
Usage:
```python
@auto($prompt)
$function
```
where `$prompt` is a prompt string literal, and `$function` is the target function.
Example:
```python
from auto_impl import auto
@auto("Return fizz if the number is divisible by 3, buzz if the number is divisible by 5, and fizzbuzz if the number is divisible by both 3 and 5.")
def fizzbuzz(n: int) -> str:
pass
def test_fizzbuzz():
assert fizzbuzz(3) == "fizz"
assert fizzbuzz(5) == "buzz"
assert fizzbuzz(15) == "fizzbuzz"
assert fizzbuzz(1) == "1"
test_fizzbuzz() # Doesn't raise exceptions
```
## Acknowledgement
- Idea originated from [retrage/gpt-macro](https://github.com/retrage/gpt-macro), which is under the MIT license.
## License
auto_impl is released under the MIT license.
Raw data
{
"_id": null,
"home_page": null,
"name": "auto-impl",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "\"Harry T. Ma\" <harrymaofshs@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/96/2f/9659912064c875640264f9b32cd383166899956cd1f9bdcf261d414aaebe/auto_impl-0.1.3.tar.gz",
"platform": null,
"description": "# auto_impl\r\n\r\nAutomatically implements functions using the [llm](https://llm.datasette.io/) toolkit.\r\n\r\n## Install\r\n\r\n pip install auto_impl --upgrade\r\n\r\n## Usage\r\n\r\nFirst install `llm`. Follow the instructions from the llm site to set it up. For example, use `llm keys set openai` to set up a ChatGPT API key and `llm \"Ten fun names for a pet pelican\"` to test it.\r\n\r\n### @auto\r\n\r\nUsage:\r\n\r\n```python\r\n@auto($prompt)\r\n$function\r\n```\r\n\r\nwhere `$prompt` is a prompt string literal, and `$function` is the target function.\r\n\r\nExample:\r\n\r\n```python\r\nfrom auto_impl import auto\r\n\r\n\r\n@auto(\"Return fizz if the number is divisible by 3, buzz if the number is divisible by 5, and fizzbuzz if the number is divisible by both 3 and 5.\")\r\ndef fizzbuzz(n: int) -> str:\r\n pass\r\n\r\n\r\ndef test_fizzbuzz():\r\n assert fizzbuzz(3) == \"fizz\"\r\n assert fizzbuzz(5) == \"buzz\"\r\n assert fizzbuzz(15) == \"fizzbuzz\"\r\n assert fizzbuzz(1) == \"1\"\r\n\r\n\r\ntest_fizzbuzz() # Doesn't raise exceptions\r\n```\r\n\r\n## Acknowledgement\r\n\r\n- Idea originated from [retrage/gpt-macro](https://github.com/retrage/gpt-macro), which is under the MIT license.\r\n\r\n## License\r\n\r\nauto_impl is released under the MIT license.\r\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Harry T. Ma Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Automatically implements functions using ChatGPT.",
"version": "0.1.3",
"project_urls": {
"Bug Tracker": "https://github.com/HarryTMa/auto_impl/issues",
"Homepage": "https://github.com/HarryTMa/auto_impl",
"repository": "https://github.com/HarryTMa/auto_impl"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6aa84a99b62f650cf779c3dc1683ef43c76362aa276838cee907118ea9b6b013",
"md5": "dc8cc0049c6876161064f626364699d4",
"sha256": "43ce933679a08b78b71b5919108802c817ece678335a5623e6b77ffe81938783"
},
"downloads": -1,
"filename": "auto_impl-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dc8cc0049c6876161064f626364699d4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4608,
"upload_time": "2024-08-14T12:58:35",
"upload_time_iso_8601": "2024-08-14T12:58:35.012004Z",
"url": "https://files.pythonhosted.org/packages/6a/a8/4a99b62f650cf779c3dc1683ef43c76362aa276838cee907118ea9b6b013/auto_impl-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "962f9659912064c875640264f9b32cd383166899956cd1f9bdcf261d414aaebe",
"md5": "8d2358b401efcf181e3920e38e78aa65",
"sha256": "6110f8d572e15bb7a27ad39d496004d1b5a58b7f91439b00ecd82368bdc5710d"
},
"downloads": -1,
"filename": "auto_impl-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "8d2358b401efcf181e3920e38e78aa65",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3908,
"upload_time": "2024-08-14T12:58:36",
"upload_time_iso_8601": "2024-08-14T12:58:36.776748Z",
"url": "https://files.pythonhosted.org/packages/96/2f/9659912064c875640264f9b32cd383166899956cd1f9bdcf261d414aaebe/auto_impl-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-14 12:58:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "HarryTMa",
"github_project": "auto_impl",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "auto-impl"
}