Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

dvcw.py 759 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  1. import sys
  2. from dvc.main import main
  3. from docopt import docopt
  4. import yaml
  5. def clean_yaml(args):
  6. file = args[0]
  7. with open(file, 'r') as rf:
  8. obj = yaml.load(rf, Loader=yaml.CSafeLoader)
  9. if 'md5' in obj:
  10. del obj['md5']
  11. if 'deps' in obj:
  12. for dep in obj['deps']:
  13. if 'md5' in dep:
  14. del dep['md5']
  15. if 'outs' in obj:
  16. for out in obj['outs']:
  17. if 'md5' in out:
  18. del out['md5']
  19. yaml.dump(obj, sys.stdout)
  20. if __name__ == '__main__':
  21. if sys.argv[1] == '_clean_yaml':
  22. clean_yaml(sys.argv[2:])
  23. else:
  24. try:
  25. from bookdata import dvcpatch
  26. dvcpatch.patch()
  27. except ImportError:
  28. pass
  29. main()
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...