Complete reference documentation for PyCharter's Python API. PyCharter is organized around three domains — Pipelines, Contracts, and Ontology — each with a dedicated storage layer. The data contract is the single source of truth for validation, pipeline load checks, and quality monitoring; contracts are stored in the Contract Store by contract name and version.
# Core classesfrompycharterimportPipeline,Validator,QualityCheck# Data contract (single source of truth)frompycharterimport(DataContract,ContractArtifacts,parse_contract_file,parse_contract,build_contract,build_contract_from_store,)# ETL componentsfrompycharterimport(HTTPExtractor,FileExtractor,DatabaseExtractor,CloudStorageExtractor,Rename,Filter,AddField,Drop,Select,Convert,CustomFunction,PostgresLoader,FileLoader,CloudStorageLoader,PipelineResult,)# Contract store (schema registry; keyed by contract name and version)frompycharterimport(InMemoryContractStore,SQLiteContractStore,PostgresContractStore,MongoDBContractStore,RedisContractStore,)# Pipeline store (pipeline registry) and Semantic store (ontology) — also available via API dependenciesfrompycharter.pipeline_storeimportPipelineStoreClient,PostgresPipelineStore,SQLitePipelineStore,InMemoryPipelineStorefrompycharter.semantic_storeimportSemanticStoreClient,PostgresSemanticStore,SQLiteSemanticStore,InMemorySemanticStore# Validation and qualityfrompycharterimport(validate,validate_batch,validate_with_contract,validate_with_store,get_model_from_contract,get_model_from_store,check_quality,check_quality_with_store,QualityCheckOptions,QualityReport,)# Schema → Pydantic and backfrompycharterimportfrom_dict,from_file,from_json,to_dict,to_file,to_json,model_to_schema# Errorsfrompycharter.shared.errorsimport(PyCharterError,ConfigError,ConfigValidationError,ExpressionError,)
importasynciofrompycharterimportPipeline# From scriptresult=asyncio.run(pipeline.run())# From async functionasyncdefmain():result=awaitpipeline.run()returnresult
See the Async Execution Model guide for detailed guidance on running pipelines from scripts, FastAPI, notebooks, and Celery.