Changeset 38791
- Timestamp:
- 2024-02-26T00:44:26+13:00 (3 months ago)
- Location:
- other-projects/metadata-encoding/py
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/metadata-encoding/py/comparisonTest/get_unicode_blocks.py
r38442 r38791 1 1 #!/usr/bin/env PYTHONIOENCODING=utf-8 python 2 2 # encoding: utf-8 3 4 # Created by Chris Adams, source (https://gist.github.com/acdha/49a610089c2798db6fe2) 3 5 4 6 from __future__ import absolute_import, print_function, unicode_literals -
other-projects/metadata-encoding/py/comparisonTest/pyicu-unicode-block-names.py
r38442 r38791 1 # Created by Chris Adams, source (https://gist.github.com/acdha/49a610089c2798db6fe2) 2 1 3 import icu 2 4 -
other-projects/metadata-encoding/py/comparisonTest/sanitise.py
r38473 r38791 1 # unfinished experimental function that was supposed to be a part of the equivalence "comparison" test between different academic databases 2 # for cleaning titles with obviously stupid things in them to test if they WOULD be the same without them 3 1 4 import re, sys, argparse 2 5 -
other-projects/metadata-encoding/py/using-api/blockBlockAnalysis.py
r38771 r38791 1 # Function to take a sample of articles from CrossRef and display information about the percentage of "Pure Latin" in the titles 2 1 3 from habanero import Crossref 2 4 import get_unicode_blocks -
other-projects/metadata-encoding/py/using-api/compareTitlesWithSubtitlesEquivalence.py
r38772 r38791 1 #compare titles of openalex and xref, checking to see if the subtitle matters 1 # compare titles of openalex and xref, checking to see if the subtitle matters 2 # would probably work a lot better if openalex was in a database. major bottleneck on api wait times 2 3 3 4 import sys, pymongo, json -
other-projects/metadata-encoding/py/using-api/getData.py
r38773 r38791 1 1 # Program to get data from CrossRef, and OpenAlex formatted in a nice JSON file. 2 # Was supposed to be a replacement for another function pre-mongo. 2 3 3 4 # Crossref API library … … 32 33 33 34 34 35 36 37 35 # Unfinished and not worth continuing 38 36 39 37 if __name__ == "__main__": -
other-projects/metadata-encoding/py/using-api/get_unicode_blocks.py
r38772 r38791 2 2 # encoding: utf-8 3 3 4 # This is code from (somewhere) github4 # This is code from Chris Adams, source https://gist.github.com/acdha/49a610089c2798db6fe2 5 5 6 6 from __future__ import absolute_import, print_function, unicode_literals -
other-projects/metadata-encoding/py/using-api/graphTest.py
r38773 r38791 1 # slight messing around with plotting library to test suitablility 2 1 3 import matplotlib as mpl 2 4 import matplotlib.pyplot as plt -
other-projects/metadata-encoding/py/using-api/pyicu-unicode-block-names.py
r38773 r38791 1 # Created by Chris Adams, source (https://gist.github.com/acdha/49a610089c2798db6fe2) 2 1 3 import icu 2 4 -
other-projects/metadata-encoding/py/using-api/testSubtitles.py
r38773 r38791 1 # test to retrieve subtitles 2 1 3 from habanero import Crossref 2 4 from diophila import OpenAlex -
other-projects/metadata-encoding/py/using-mongodb/graphSampleError.py
r38773 r38791 1 1 #!/usr/bin/env python3 2 3 # Script to generate a time series graph of percentage of & errors in CrossRef titles 4 # Does not generate a data file! Graphing is handled by matplotlib. 2 5 3 6 import pymongo -
other-projects/metadata-encoding/py/using-mongodb/mongoAnalysis.py
r38773 r38791 1 1 # function to display cool(?) statistics about the subtitle 2 2 3 import datetime 3 4 from dateutil.relativedelta import relativedelta … … 10 11 11 12 def main(): 13 # Connect to database 12 14 mClient = MongoClient("mongodb://localhost:27017/") 13 15 mDatabase = mClient["test"] 14 16 mCollection = mDatabase["crossref"] 15 17 16 getMinDateQuery = "asdas" 17 18 # Get minimum date 18 19 minimumDateQuery = mCollection.find().sort("dateCreated").limit(1) 20 # Get documents sorted by date 19 21 sortedCollectionQuery = mCollection.find().sort("dateCreated") 22 # And the count 20 23 countQuery = mCollection.estimated_document_count() 21 24 … … 53 56 #increase currentdate by a month 54 57 58 # currently unfinished. Need to finish the statistics insertion part of the method, and actually do something with that data. 59 55 60 main()
Note:
See TracChangeset
for help on using the changeset viewer.