mirror of
				https://github.com/Unstructured-IO/unstructured.git
				synced 2025-10-31 18:14:51 +00:00 
			
		
		
		
	
		
			
	
	
		
			18 lines
		
	
	
		
			506 B
		
	
	
	
		
			Python
		
	
	
	
	
	
		
		
			
		
	
	
			18 lines
		
	
	
		
			506 B
		
	
	
	
		
			Python
		
	
	
	
	
	
|   | import sys | ||
|  | 
 | ||
|  | from unstructured.partition.auto import partition | ||
|  | 
 | ||
|  | if __name__ == "__main__": | ||
|  |     if len(sys.argv) < 3: | ||
|  |         print( | ||
|  |             "Please provide the path to the file as the first argument and the strategy as the " | ||
|  |             "second argument.", | ||
|  |         ) | ||
|  |         sys.exit(1) | ||
|  | 
 | ||
|  |     file_path = sys.argv[1] | ||
|  |     strategy = sys.argv[2] | ||
|  |     result = partition(file_path, strategy=strategy) | ||
|  |     # access element in the return value to make sure we got something back, otherwise error | ||
|  |     result[1] |