ValidEx is a Python library designed to simplify the retrieval and extraction of structured data from unstructured sources. With features like heuristic data cleaning, concurrency support, and model creation, it empowers users to efficiently manage data sources while minimizing errors and enhancing data quality.
ValidEx is a comprehensive Python library designed to streamline the retrieval, extraction, and training of structured data from various unstructured sources. This powerful tool is ideal for developers and data scientists looking to automate and enhance their data extraction processes from a multitude of formats, including web pages, text files, PDFs, and more.
To demonstrate its functionality, here is a simple usage example:
import validex
from pydantic import BaseModel
class Superhero(BaseModel):
name: str
age: int
power: str
enemies: list[str]
def main():
app = validex.App()
app.add("https://www.britannica.com/topic/list-of-superheroes-2024795")
superheroes = app.extract(Superhero)
print(f"Extracted superheroes: {list(superheroes)}")
if __name__ == "__main__":
main()
This code initializes the ValidEx app, adds a URL for extraction, and outputs the extracted superhero data, showcasing the library's straightforward approach to data retrieval.
ValidEx also supports experimental features such as data export and local model training:
app.export_jsonl("fine_tune.jsonl")
app.fit()
app.save("state.validex")
Additionally, the library allows for multi-model extraction to handle various data structures in a single call:
multi_results = app.multi_extract(Superhero, Superhero2)
print(f"Multi-extraction results: {multi_results}")
Contributions to ValidEx are encouraged. Prospective contributors should fork the repository, create a new branch, commit their changes, and open a pull request. Please refer to the contributing guidelines for detailed steps.
No comments yet.
Sign in to be the first to comment.