conda2req/cvt.py

10 lines
354 B
Python

import yaml
import sys
with open(sys.argv[1]) as file_handle:
environment_data = yaml.load(file_handle)
with open("requirements.txt", "w") as file_handle:
for dependency in environment_data["dependencies"]:
package_name, package_version = dependency.split("=")
file_handle.write("{} == {}".format(package_name, package_version))