Complete reference documentation for PyCharter's Python API. PyCharter is organized around three pillars — Pipeline, Contract, and Vocabulary — 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 (vocabulary) — also available via API dependenciesfrompycharter.pipeline_storeimport(PipelineStoreClient,PostgresPipelineStore,SQLitePipelineStore,InMemoryPipelineStore,)frompycharter.semantic_storeimport(SemanticStoreClient,PostgresSemanticStore,SQLiteSemanticStore,InMemorySemanticStore,)# Validation and qualityfrompycharterimport(Validator,validate,validate_batch,get_model_from_contract,get_model_from_store,check_quality,QualityCheckOptions,QualityReport,)# Schema → Pydantic and backfrompycharter.pydantic_generatorimportfrom_dict,from_filefrompycharter.json_schema_converterimportto_dict,model_to_schemafrompycharterimportfrom_json,to_file,to_json# Errorsfrompycharter.shared.errorsimport(PyCharterError,ConfigError,ConfigValidationError,ExpressionError,)
importasynciofrompycharterimportPipeline# From scriptresult=asyncio.run(pipeline.run())# From async functionasyncdefmain():result=awaitpipeline.arun()returnresult
See the Async Execution Model guide for detailed guidance on running pipelines from scripts, FastAPI, notebooks, and Celery.