pasta / convert.py
tobthecreator's picture
fuck this
d00dc6d
import yaml
def conda_to_pip(input_file, output_file):
with open(input_file, 'r') as file:
env = yaml.safe_load(file)
with open(output_file, 'w') as file:
for dep in env['dependencies']:
if isinstance(dep, str):
package_info = dep.split('=')
if len(package_info) >= 2:
file.write(f"{package_info[0]}=={package_info[1]}\n")
conda_to_pip('environment.yml', 'requirements.txt')