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

loc.py 488 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
  1. from invoke import task
  2. import support as s
  3. @task
  4. def init(c):
  5. "Initialize the LOC schema"
  6. c.run('psql -f loc-schema.sql')
  7. @task(s.build, init, name='import')
  8. def import_loc(c):
  9. "Import the LOC data"
  10. loc = s.data_dir / 'LOC'
  11. files = list(loc.glob('BooksAll.2014.part*.xml.gz'))
  12. print('importing LOC data from', len(files), 'files')
  13. s.pipeline([
  14. [s.bin_dir / 'parse-marc'] + files,
  15. ['psql', '-c', '\\copy loc_marc_field FROM STDIN']
  16. ])
Tip!

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

Comments

Loading...