mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-10-30 18:26:58 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			658 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			658 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from datahub.ingestion.run.pipeline import Pipeline
 | |
| 
 | |
| # The pipeline configuration is similar to the recipe YAML files provided to the CLI tool.
 | |
| pipeline = Pipeline.create(
 | |
|     {
 | |
|         "source": {
 | |
|             "type": "mysql",
 | |
|             "config": {
 | |
|                 "username": "user",
 | |
|                 "password": "pass",
 | |
|                 "database": "db_name",
 | |
|                 "host_port": "localhost:3306",
 | |
|             },
 | |
|         },
 | |
|         "sink": {
 | |
|             "type": "datahub-rest",
 | |
|             "config": {"server": "http://localhost:8080"},
 | |
|         },
 | |
|     }
 | |
| )
 | |
| 
 | |
| # Run the pipeline and report the results.
 | |
| pipeline.run()
 | |
| pipeline.pretty_print_summary()
 | 
