convertanything is a Python package that allows you to convert any text into a structured format according to the schema provided.
Project description
convertanything
convertanything
is a simple way to convert any unstructured texts into pydantic models in Python with the use of language models. See the examples notebook for more details.
Installation
pip install convertanything
Usage
from convertanything import convertanything
from pydantic import BaseModel
from typing import List
class Person(BaseModel):
name: str
age: int
email: str
interests: List[str]
response = convertanything(
input_string="Hi my name is John Doe, I am 30 years old, my email is johndoe@example.com . I like to go fishing.",
model=Person,
api_key="Your OpenAI API Key",
)
print(response)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
convertanything-0.0.13.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for convertanything-0.0.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 855cde396a3f077e4970a7d64907e7bb6db728174511c041422d884c4c470c27 |
|
MD5 | c3257999f03f66d2965756cb09f2c406 |
|
BLAKE2b-256 | 688396f17c04d9c047a0d07248f34189273af2ebcf380a45d077e7069b38e2ca |