Reference
Autogenerated API reference for the optimuskg Python client.
Client for the OptimusKG biomedical knowledge graph on Harvard Dataverse.
attribute__version__= '0.1.0'attribute__all__= ['__version__', 'get_cache_dir', 'get_doi', 'get_file', 'get_server', 'load_graph', 'load_networkx', 'load_parquet', 'set_cache_dir', 'set_doi', 'set_server']attributeDEFAULT_SERVER= 'https://dataverse.harvard.edu'attributeDEFAULT_DOI= 'doi:10.7910/DVN/IYNGEV'funcget_file(relative_path, *, force=False) -> PathReturn the local path to a parquet file, downloading from Dataverse if missing.
Paths mirror the layout under data/gold/kg/parquet/ in the source repo.
paramrelative_pathstrparamforcebool= FalseReturns
pathlib.Pathfuncload_parquet(relative_path, *, force=False, **read_parquet_kwargs) -> pl.DataFrameDownload (if needed) and read a parquet file as a Polars DataFrame.
paramrelative_pathstrparamforcebool= Falseparamread_parquet_kwargsAny= {}Returns
polars.polars.DataFramefuncload_graph(*, lcc=False, force=False) -> tuple[pl.DataFrame, pl.DataFrame]Return (nodes, edges) Polars DataFrames for the full graph or its LCC.
paramlccbool= Falseparamforcebool= FalseReturns
tuple[polars.polars.DataFrame, polars.polars.DataFrame]funcload_networkx(*, lcc=False, force=False, parse_properties=True) -> nx.MultiDiGraphReturn the graph as a nx.MultiDiGraph with properties loaded onto attrs.
paramlccbool= Falseparamforcebool= Falseparamparse_propertiesbool= TrueReturns
networkx.networkx.MultiDiGraphfuncget_server() -> strReturn the Dataverse server URL.
Returns
strfuncset_server(url) -> NoneOverride the Dataverse server URL for the current process.
paramurlstrReturns
Nonefuncget_doi() -> strReturn the persistent identifier for the OptimusKG dataset.
Returns
strfuncset_doi(doi) -> NoneOverride the dataset DOI for the current process.
paramdoistrReturns
Nonefuncget_cache_dir() -> PathReturn the root directory where downloaded files are cached.
Returns
pathlib.Pathfuncset_cache_dir(path) -> NoneOverride the local cache directory for the current process.
parampathstr | os.PathLike[str]Returns
None