build pickle file