Coder Social home page Coder Social logo

metbril / pyluchtmeetnet Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 65 KB

A python package to use the Luchtmeetnet 2020 OpenAPI.

Home Page: https://pypi.org/project/pyluchtmeetnet/

License: MIT License

Python 100.00%
air air-quality airquality api api-wrapper health pypi pypi-package python python3

pyluchtmeetnet's Introduction

Hi there ๐Ÿ‘‹

pyluchtmeetnet's People

Contributors

dependabot[bot] avatar marcvdsluys avatar metbril avatar

Watchers

 avatar  avatar

Forkers

marcvdsluys

pyluchtmeetnet's Issues

Supported Python versions

Add some logic or documentation to be able to test (with CI/CD) which versions are supported and working

https://devguide.python.org/versions/

The library should at least support any supported Python version (with security fixes) and possible the next prerelease (to see in advance if any modifications are required).

Return latest measurements only

In #16 I discovered that the get_latest_station_measurements method does return all measurements instead of just the latest. The method should return only the most recent measurement for each component.

Does not work on station NL54004.

Describe the bug
When using pyluchtmeetnet to obtain the data from my location, connecting to station NL54004, I receive an error.

When debugging your code, I can see that this station provides data on the following components: ['FN', 'NO', 'NO2', 'PM10']
But when collecting the related data, only data for FN and PM10 are returned.

Your present code:

        data = []
        for component in components:
            json_component = [
                meas for meas in measurements if meas["formula"] == component
            ]
            element = {
                component: json_component[0]["value"],
                "timestamp": json_component[0]["timestamp_measured"],
            }
            data.append(element)

fails on this returned data.

When I change to code to this:

        data = []  
        for component in components:
            for meas in measurements:
                if meas["formula"] == component:
                    json_component = [meas]
                    element = {
                        component: json_component[0]["value"],
                        "timestamp": json_component[0]["timestamp_measured"],
                    }
                    data.append(element)

it works on the returned data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.