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

viaf.py 529 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
  1. from invoke import task
  2. import support as s
  3. @task
  4. def init(c):
  5. "Initialize the VIAF schema"
  6. print('initializing VIAF schema')
  7. c.run('psql -f viaf-schema.sql')
  8. @task(s.build, init, name='import')
  9. def import_viaf(c, date='20181104'):
  10. "Import VIAF data"
  11. infile = s.data_dir / f'viaf-{date}-clusters-marc21.xml.gz'
  12. print('importing VIAF data from %s', infile)
  13. s.pipeline([
  14. [s.bin_dir / 'parse-marc', '--line-mode', infile],
  15. ['psql', '-c', '\\copy viaf_marc_field FROM STDIN']
  16. ])
Tip!

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

Comments

Loading...