Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /DS4SD_deepsearch-toolkit /deepsearch /cps /cli /elastic_data.py
| import typer | |
| from deepsearch.core.cli.utils import cli_handler | |
| from deepsearch.core.util.cli_output import OutputEnum, OutputOption, cli_output | |
| from deepsearch.cps.client.api import CpsApi | |
| from deepsearch.cps.client.components.elastic import ElasticDataCollectionSource | |
| app = typer.Typer(no_args_is_help=True) | |
| def list( | |
| domain: str = typer.Option("all"), | |
| output: OutputEnum = OutputOption, | |
| ): | |
| api = CpsApi.from_env() | |
| collections = api.elastic.list(domain=domain) | |
| results = [ | |
| { | |
| "name": c.name, | |
| "instance": ElasticDataCollectionSource.model_validate(c.source).elastic_id, | |
| "index": c.source.index_key, | |
| "domains": c.metadata.domain, | |
| "documents": c.documents, | |
| "created": c.metadata.created, | |
| } | |
| for c in collections | |
| ] | |
| # TODO: fix JSON serialize of datetime | |
| cli_output(results, output, headers="keys") | |
| if __name__ == "__main__": | |
| app() | |
Xet Storage Details
- Size:
- 1.05 kB
- Xet hash:
- fbfa34cac191b3a46b9de51f8b06bea0a9a4b635989b81d3a6c8b019a4cf8e75
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.