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

schema.py 703 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
  1. """
  2. Data schema information for the book data tools.
  3. """
  4. import pandas as pd
  5. class NS:
  6. def __init__(self, name, num):
  7. self.name = name
  8. self.code = num
  9. self.offset = num * 100000000
  10. ns_work = NS('OL-W', 1)
  11. ns_edition = NS('OL-E', 2)
  12. ns_loc_rec = NS('LOC', 3)
  13. ns_gr_work = NS('GR-W', 4)
  14. ns_gr_book = NS('GR-B', 5)
  15. ns_loc_work = NS('LOC-W', 6)
  16. ns_loc_instance = NS('LOC-I', 7)
  17. ns_isbn = NS('ISBN', 9)
  18. numspaces = [
  19. ns_work, ns_edition,
  20. ns_loc_rec,
  21. ns_gr_work, ns_gr_book,
  22. ns_loc_work, ns_loc_instance,
  23. ns_isbn
  24. ]
  25. src_labels = pd.Series(dict((_ns.name, _ns.code) for _ns in numspaces))
  26. src_label_rev = pd.Series(src_labels.index, index=src_labels.values)
Tip!

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

Comments

Loading...