|
| 1 | +# Ethoscope metadata db |
| 2 | +This is a package that can be used to organise your ethoscope database. |
| 3 | +The core of the package is ethoscope_metadata_db which takes care of |
| 4 | + - building an internal representation of the ethoscope data |
| 5 | + - handle metadata file associating them to experiments |
| 6 | + - collect information regarding a metadata file and its db dependencies |
| 7 | + - export that information |
| 8 | + |
| 9 | + A typical use case is to recover all the ethoscope dbs associated to a certain metadata file so that the user can collate them and upload them to a public dataset repository, such as Zenodo. |
| 10 | + |
| 11 | +For instance: |
| 12 | +'''' |
| 13 | +from ethoscope_metadata_db import db_organiser, metadata_handler |
| 14 | + |
| 15 | +metadata_filename = 'all_metadata.csv' |
| 16 | +datapath = "/mnt/ethoscope_results" |
| 17 | + |
| 18 | +#refresh the content of the ethoscope dbs |
| 19 | +db = db_organiser(datapath, refresh=True, csv_path="/opt/ethoscope_metadata/") |
| 20 | + |
| 21 | +#find the relevant files associated to our metadata - this will take a few seconds |
| 22 | +meta = metadata_handler(metadata_filename, project='Joyce_2024', authors=['Joyce', 'Blackhurst', 'Falconio', 'French'] ) |
| 23 | +meta.associate_to_db(db) |
| 24 | + |
| 25 | +#Give me a summary of what you found. Useful to know the size of the whole dataset. |
| 26 | +meta.summary |
| 27 | + |
| 28 | +#The followind dbs were not found on our machine |
| 29 | +#This usually indicates that the ethoscope had failed but was not removed from the metadata |
| 30 | +meta.list_dbs(notfound=True) |
| 31 | + |
| 32 | +#Save to a txt file only the databases we have actually found |
| 33 | +meta.export('Joyce_2024_only_dbs.txt') |
| 34 | + |
| 35 | +#Saves all the info for our convenience |
| 36 | +meta.export('Joyce_2024_only_dbs.txt', verbose=True) |
| 37 | +'''' |
| 38 | + |
| 39 | +The other class is the metadata_db_server which runs a web based UI |
| 40 | +Instructions on to set it up and run it can be found here: https://www.notion.so/giorgiogilestro/The-Metadata-Database-Server-cafac3d16ca04c0b8d4364e7624d7151 |
0 commit comments