{"id":19310202,"url":"https://github.com/cedadev/stac-generator-example","last_synced_at":"2025-04-22T13:33:50.368Z","repository":{"id":37956406,"uuid":"411337034","full_name":"cedadev/stac-generator-example","owner":"cedadev","description":"Example repo to demonstrate the STAC Generator framework","archived":false,"fork":false,"pushed_at":"2023-02-22T10:51:09.000Z","size":57,"stargazers_count":1,"open_issues_count":0,"forks_count":5,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-09-22T00:05:40.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cedadev.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-28T15:24:28.000Z","updated_at":"2023-04-14T19:06:37.000Z","dependencies_parsed_at":"2023-01-24T02:15:29.082Z","dependency_job_id":null,"html_url":"https://github.com/cedadev/stac-generator-example","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedadev%2Fstac-generator-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedadev%2Fstac-generator-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedadev%2Fstac-generator-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedadev%2Fstac-generator-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedadev","download_url":"https://codeload.github.com/cedadev/stac-generator-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223898826,"owners_count":17221833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T00:23:06.554Z","updated_at":"2024-11-10T00:23:07.006Z","avatar_url":"https://github.com/cedadev.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"**********************\nSTAC Generator Example\n**********************\n\n.. image:: https://mybinder.org/badge_logo.svg\n :target: https://mybinder.org/v2/gh/cedadev/stac-generator-example/HEAD\n.. image:: https://github.com/cedadev/stac-generator-example/actions/workflows/tests.yaml/badge.svg\n :target: https://github.com/cedadev/stac-generator-example/actions/workflows/tests.yaml\n\nThis repo serves as a basic example to provide a working introduction to the\n`stac-generator`_ framework. It uses an intake catalog to provide URLs to public\ndata in an S3 Object Store. These are then turned into a STAC Catalog of Assets,\nItems, and Collections.\n\nGetting Started\n================\n\nYou can either run locally or launch in Binder:\n \nRunning in Binder\n-----------------\n\nClick \n\n.. image:: https://mybinder.org/badge_logo.svg\n :target: https://mybinder.org/v2/gh/cedadev/stac-generator-example/HEAD\n\nTo just run it and see the example output, open ``example_notebook.ipynb``.\n\n\nLocal deployment\n-----------------\n\n1. Install the requirements\n\n    .. code-block::\n\n        pip install -r requirements.txt\n\n2. Run the `asset-generator`_\n\n    .. code-block::\n\n        stac_generator conf/asset-generator.yaml\n\n3. Run the `item-generator`_\n\n    .. code-block::\n\n        stac_generator conf/item-generator.yaml\n\n3. Run the `collection-generator`_\n\n    .. code-block::\n\n        stac_generator conf/collection-generator.yaml\n\nInputs Explained\n================\n\nThe yaml files in conf setup the input and outputs for the script. In this case, the input is an intake-esm catalog and the output is the terminal.\n\nThe file in collection-descriptions, describes the workflow to extract the facets.\n\n.. code-block:: yaml\n\n    paths:\n  - https://cmip6-zarr-o.s3-ext.jc.rl.ac.uk/CMIP6.CMIP.MOHC.UKESM1-0-LL\n\n    asset:\n    # The default asset id is a hash of the assets uri\n    extraction_methods:\n        # - method: posix_stats\n        - method: regex\n        inputs:\n            regex: 'https://cmip6-zarr-o.s3-ext.jc.rl.ac.uk\\/(?P\u003cmip_era\u003e\\w+)\\.(?P\u003cactivity_id\u003e\\w+)\\.(?P\u003cinstitution_id\u003e[\\w-]+)\\.(?P\u003csource_id\u003e[\\w-]+)\\/(?P\u003cexperiment_id\u003e[\\w-]+)\\.(?P\u003cmember_id\u003e\\w+)\\.(?P\u003ctable_id\u003e\\w+)\\.(?P\u003cvar_id\u003e\\w+)\\.(?P\u003cgrid_label\u003e\\w+)\\.(?P\u003cversion\u003e\\w+)'\n\n    item:\n    # The default item id is a hash of the collection id\n    id:\n        method: hash\n        inputs:\n        terms:\n            - mip_era\n            - activity_id\n            - institution_id\n            - source_id\n            - table_id\n            - var_id\n            - version\n    extraction_methods:\n        - method: json_file\n        inputs:\n            filepath: tests/file-io/assets.json\n            terms:\n            - mip_era\n            - activity_id\n            - institution_id\n            - source_id\n            - table_id\n            - var_id\n            - version\n\n    collection:\n    # The default collection id is \"undefined\"\n    id:\n        method: default\n        inputs:\n        value: cmip6\n    extraction_methods:\n        - method: json_file\n        inputs:\n            filepath: tests/file-io/items.json\n            terms:\n            - mip_era\n            - activity_id\n            - institution_id\n            - source_id\n            - table_id\n            - var_id\n            - version\n\n\nOutputs Explained\n=================\n\nAsset Generator\n---------------\n\nThe asset-generator outputs:\n\n.. code-block:: python\n\n    {\n        'id': 'c4b8f1578ed806f080f62470ebce2dcd',\n        'body': {\n            'type': 'asset',\n            'properties': {\n                'media_type': 'OBJECT_STORE',\n                'filepath_type_location': 'http://cmip6-zarr-o.s3-ext.jc.rl.ac.uk/CMIP6.CMIP.MOHC.UKESM1-0-LL/historical.r4i1p1f2.Amon.tas.gn.v20190502.zarr',\n                'filename': 'historical.r4i1p1f2.Amon.tas.gn.v20190502.zarr',\n                'extension': '.zarr',\n            },\n            'categories': ['data']\n        }\n    }\n\nItem Generator\n--------------\n\nThe item-generator outputs:\n\n.. code-block:: python\n\n\n    {\n        'id': '4dfbda18d335385742738fad6314450d',\n        'body': {\n            'item_id': '4dfbda18d335385742738fad6314450d',\n            'type': 'item',\n            'properties': {\n                'mip_era': 'CMIP6',\n                'activity_id': 'CMIP',\n                'institution_id': 'MOHC',\n                'source_id': 'UKESM1-0-LL',\n                'experiment_id': 'historical',\n                'member_id': 'r4i1p1f2',\n                'table_id': 'Amon',\n                'variable_id': 'tas',\n                'grid_label': 'gn',\n                'version': 'v20190502'\n            }\n        }\n    }\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n.. _`stac-generator`: https://cedadev.github.io/stac-generator/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedadev%2Fstac-generator-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedadev%2Fstac-generator-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedadev%2Fstac-generator-example/lists"}