@@ -218,44 +218,3 @@ class DownloadManagerAdapter(DownloaderPort):
218218 """
219219
220220 pass
221-
222-
223- # -------------------------------------------------------------------------
224- # ---- MAIN FUNTION (mini-sandbox to try functionalities) ----
225- # -------------------------------------------------------------------------
226- if __name__ == '__main__' :
227- # Configure logging
228- logging .basicConfig (level = logging .DEBUG )
229-
230- # Define a directory to store all the downloads
231- cache = Path ('./data/in' )
232-
233- # Initialize a downloader object
234- downloader = PoochDownloaderAdapter (cache_dir = cache )
235-
236- # Functionality 1. Download from a URL
237- path_single_download = downloader .fetch_from_url (
238- url_ontology = 'https://purl.obolibrary.org/obo/ado.owl' ,
239- filename = 'adosdsdsds.owl' ,
240- )
241- print (f'Path single download: { path_single_download } ' )
242-
243- # Functionality 2. Download several resources from a catalog.
244- from ontograph .models import CatalogOntologies
245-
246- # Download automatically the catalog
247- catalog = CatalogOntologies (cache_dir = cache )
248- resources = [
249- {'name_id' : 'go' , 'format' : 'obo' },
250- {'name_id' : 'ado' , 'format' : 'owl' },
251- ]
252-
253- catalog = CatalogOntologies (cache_dir = cache )
254- paths_resources = downloader .fetch_from_catalog (
255- resources = resources , catalog = catalog
256- )
257- print (f'\n Paths multiple resources: { paths_resources } ' )
258-
259- print ('\n Print all the resources downloaded by the downloader' )
260- for name_id , path_resource in downloader .get_paths ().items ():
261- print (f'\t { name_id } : { path_resource } ' )
0 commit comments