tum-esm-lowcost-metadata


Nametum-esm-lowcost-metadata JSON
Version 0.6.0 PyPI version JSON
download
home_pagehttps://github.com/tum-esm/lowcost-metadata
SummarySingle source of truth for ESM's lowcost measurement logistics
upload_time2023-09-22 08:13:36
maintainer
docs_urlNone
authorMoritz Makowski
requires_python>=3.9,<4.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Lowcost Metadata

This repository handles the metadata around the lowcost sensor network in Munich.<br/>
We selected this format over putting it in a database due to various reasons:

-   Easy to read, modify and extend by selective group members using GitHub permissions
-   Changes to this are more obvious here than in database logs
-   Versioning (easy to revert mistakes)
-   Automatic testing of the files integrities
-   Easy import as a statically typed Python library

<br/>

## What does this data look like?

There is a set of **`JSON`** files in the data folder holding the follwing information:

- **`SENSORS.json`**<br/>
This files contains basic information about the sensors in use in the monitoring network.
```json
{
    "13077": {
        "sensor_type": "LP8",
        "sensor_make": "Decentlab",
        "sensor_model": "DL-LP8",
        "start_up_date": "2022-08-01T08:00:00+00:00",
        "shut_down_date": null,
        "comment": ""
    },
}
```
- **`SITES.json`**<br/>
This file contains basic information about the sites/locations where sensors have been installed.

```json
{
    "FREV": {
        "site_type": "individual",
        "site_lat": 48.1615591,
        "site_lon": 11.5860387,
        "elevation": 514,
        "comment": "Lamp post ids:55.0"
    },
}
```
- **`SAMPLING.json`**<br/>
This file contains basic information on which site, at which time, which sensors measured at which configuration.

```json
[
    {
        "site_id": "HANV",
        "sensor_ids": [
            13171,
            13147
        ],
        "sampling_start": "2023-05-02T12:30+02:00",
        "sampling_end": null,
        "orientation": 0,
        "elevation_ag": 3,
        "comment": ""
    },
]
```

<br/>

## How to add new measurement days?

1. Possibly add new sensor in `data/SENSORS.json`
2. Possibly add new site in `data/SITES.json`
2. Add a new sampling event to `data/SAMPLING.json`

<br/>

## How can I know whether my changes were correct?

Whenever you make changes in the repository on GitHub, the integrity of the files will automatically be checked. You can check whether all tests have passed [here](https://github.com/tum-esm/lowcost-metadata/actions).

A list of all integrity checks can be found in [`tests/README.md`](https://github.com/tum-esm/lowcost-metadata//tree/main/tests).

<br/>

## How to use it in your codebase?

1. Install python library

```bash
poetry add tum_esm_lowcost_metadata
# or
pip install tum_esm_lowcost_metadata
```

2. Create a personal access token for a GitHub account that has read access to the metadata repository: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

3. Use the metadata anywhere

```python
import tum_esm_lowcost_metadata

lowcost_metadata_interface = tum_esm_lowcost_metadata.load_from_github(
    github_repository = "org-name/repo-name",
    access_token = "ghp_..."
)

metadata = lowcost_metadata_interface.get(
    sensor_id = "13077", date = pendulum.datetime(2023, 6, 6)
)  # is of type list[tum_esm_lowcost_metadata.types.SensorDataContext]

metadata = interface.get(sensor_id = '13155', timestamp=pendulum.datetime(2023, 6, 6))
interfaces.print_beautiful(metadata))
```

... prints out:

```
Metadata for Sensor 13155, located at MOSV.
---
Sensor type:            Decentlab DL-LP8
Site coordinates:       48.1870436 lat
                        11.5622708 lon
                        508.0 m a.s.l.
Orientation             0.0°
Elevation above ground: 3.0 m
Comment:                Lamp post ids:32.0

---
```

<br/>

## For Developers: Publish the Package to PyPI

```bash
poetry build
poetry publish
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tum-esm/lowcost-metadata",
    "name": "tum-esm-lowcost-metadata",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Moritz Makowski",
    "author_email": "moritz.makowski@tum.de",
    "download_url": "https://files.pythonhosted.org/packages/79/52/e14c0fee8e57c170ac8afc8d37125273ca4af573d8899fb92d7f45e8b3d2/tum_esm_lowcost_metadata-0.6.0.tar.gz",
    "platform": null,
    "description": "# Lowcost Metadata\n\nThis repository handles the metadata around the lowcost sensor network in Munich.<br/>\nWe selected this format over putting it in a database due to various reasons:\n\n-   Easy to read, modify and extend by selective group members using GitHub permissions\n-   Changes to this are more obvious here than in database logs\n-   Versioning (easy to revert mistakes)\n-   Automatic testing of the files integrities\n-   Easy import as a statically typed Python library\n\n<br/>\n\n## What does this data look like?\n\nThere is a set of **`JSON`** files in the data folder holding the follwing information:\n\n- **`SENSORS.json`**<br/>\nThis files contains basic information about the sensors in use in the monitoring network.\n```json\n{\n    \"13077\": {\n        \"sensor_type\": \"LP8\",\n        \"sensor_make\": \"Decentlab\",\n        \"sensor_model\": \"DL-LP8\",\n        \"start_up_date\": \"2022-08-01T08:00:00+00:00\",\n        \"shut_down_date\": null,\n        \"comment\": \"\"\n    },\n}\n```\n- **`SITES.json`**<br/>\nThis file contains basic information about the sites/locations where sensors have been installed.\n\n```json\n{\n    \"FREV\": {\n        \"site_type\": \"individual\",\n        \"site_lat\": 48.1615591,\n        \"site_lon\": 11.5860387,\n        \"elevation\": 514,\n        \"comment\": \"Lamp post ids:55.0\"\n    },\n}\n```\n- **`SAMPLING.json`**<br/>\nThis file contains basic information on which site, at which time, which sensors measured at which configuration.\n\n```json\n[\n    {\n        \"site_id\": \"HANV\",\n        \"sensor_ids\": [\n            13171,\n            13147\n        ],\n        \"sampling_start\": \"2023-05-02T12:30+02:00\",\n        \"sampling_end\": null,\n        \"orientation\": 0,\n        \"elevation_ag\": 3,\n        \"comment\": \"\"\n    },\n]\n```\n\n<br/>\n\n## How to add new measurement days?\n\n1. Possibly add new sensor in `data/SENSORS.json`\n2. Possibly add new site in `data/SITES.json`\n2. Add a new sampling event to `data/SAMPLING.json`\n\n<br/>\n\n## How can I know whether my changes were correct?\n\nWhenever you make changes in the repository on GitHub, the integrity of the files will automatically be checked. You can check whether all tests have passed [here](https://github.com/tum-esm/lowcost-metadata/actions).\n\nA list of all integrity checks can be found in [`tests/README.md`](https://github.com/tum-esm/lowcost-metadata//tree/main/tests).\n\n<br/>\n\n## How to use it in your codebase?\n\n1. Install python library\n\n```bash\npoetry add tum_esm_lowcost_metadata\n# or\npip install tum_esm_lowcost_metadata\n```\n\n2. Create a personal access token for a GitHub account that has read access to the metadata repository: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token\n\n3. Use the metadata anywhere\n\n```python\nimport tum_esm_lowcost_metadata\n\nlowcost_metadata_interface = tum_esm_lowcost_metadata.load_from_github(\n    github_repository = \"org-name/repo-name\",\n    access_token = \"ghp_...\"\n)\n\nmetadata = lowcost_metadata_interface.get(\n    sensor_id = \"13077\", date = pendulum.datetime(2023, 6, 6)\n)  # is of type list[tum_esm_lowcost_metadata.types.SensorDataContext]\n\nmetadata = interface.get(sensor_id = '13155', timestamp=pendulum.datetime(2023, 6, 6))\ninterfaces.print_beautiful(metadata))\n```\n\n... prints out:\n\n```\nMetadata for Sensor 13155, located at MOSV.\n---\nSensor type:            Decentlab DL-LP8\nSite coordinates:       48.1870436 lat\n                        11.5622708 lon\n                        508.0 m a.s.l.\nOrientation             0.0\u00b0\nElevation above ground: 3.0 m\nComment:                Lamp post ids:32.0\n\n---\n```\n\n<br/>\n\n## For Developers: Publish the Package to PyPI\n\n```bash\npoetry build\npoetry publish\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Single source of truth for ESM's lowcost measurement logistics",
    "version": "0.6.0",
    "project_urls": {
        "Homepage": "https://github.com/tum-esm/lowcost-metadata",
        "Repository": "https://github.com/tum-esm/lowcost-metadata"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c30f23d162404c09468da7775d5643064ccc6f64004329efeaf4fc4ab514ee1c",
                "md5": "6ef8f228c615d208a585685aecd9edb6",
                "sha256": "b44eeb37bb3429eb24ea21b00654be44712993956275f181afe0f59c7995529e"
            },
            "downloads": -1,
            "filename": "tum_esm_lowcost_metadata-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6ef8f228c615d208a585685aecd9edb6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 5773,
            "upload_time": "2023-09-22T08:13:33",
            "upload_time_iso_8601": "2023-09-22T08:13:33.669369Z",
            "url": "https://files.pythonhosted.org/packages/c3/0f/23d162404c09468da7775d5643064ccc6f64004329efeaf4fc4ab514ee1c/tum_esm_lowcost_metadata-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7952e14c0fee8e57c170ac8afc8d37125273ca4af573d8899fb92d7f45e8b3d2",
                "md5": "bfda6ecebac38fe9845467270ed0ad38",
                "sha256": "aab83b82307b93464eb97e92a894e8457cfdb7a22ea492830d65ff0123560fda"
            },
            "downloads": -1,
            "filename": "tum_esm_lowcost_metadata-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "bfda6ecebac38fe9845467270ed0ad38",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 5694,
            "upload_time": "2023-09-22T08:13:36",
            "upload_time_iso_8601": "2023-09-22T08:13:36.192849Z",
            "url": "https://files.pythonhosted.org/packages/79/52/e14c0fee8e57c170ac8afc8d37125273ca4af573d8899fb92d7f45e8b3d2/tum_esm_lowcost_metadata-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-22 08:13:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tum-esm",
    "github_project": "lowcost-metadata",
    "github_not_found": true,
    "lcname": "tum-esm-lowcost-metadata"
}
        
Elapsed time: 0.14855s