New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nibeuplink

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nibeuplink

A python wrapper around Nibe Uplink REST API

  • 1.3.0
  • PyPI
  • Socket score

Maintainers
1

Nibe Uplink Communciation Module


Module

The module is an asyncio driven interface to nibe uplink public API. It is throttled to one http request every 4 seconds so try to make the most of your requests by batching requests.

Status


.. image:: https://github.com/elupus/nibeuplink/actions/workflows/python-package.yml/badge.svg :target: https://github.com/elupus/nibeuplink/actions/workflows/python-package.yml

.. image:: https://codecov.io/gh/elupus/nibeuplink/branch/master/graph/badge.svg?token=WZy5CcdYom :target: https://codecov.io/gh/elupus/nibeuplink

Example


.. code-block:: python

def token_read():
    return None

def token_write(token):
    pass

async def run():
    async with nibeuplink.Uplink(client_id         = 'XXX',
                                 client_secret     = 'YYY',
                                 redirect_uri      = 'ZZZ',
                                 access_data       = token_read(),
                                 access_data_write = token_write,
                                 scope             = 'READSYSTEM') as uplink:

        if not uplink.access_data:
            auth_uri = uplink.get_authorize_url()
            print(auth_uri)
            result = input('Enter full redirect url: ')
            await uplink.get_access_token(uplink.get_code_from_url(result))

        # Request all systems
        print(uplink.get_systems())


        # Request data for specific system
        print(uplink.get_system(12345))

        # Request data for parameters. Note request them in paralell using gather semantics
        # that way, the module with batch up the requests into a single request to api 
        print(await asyncio.gather(uplink.get_parameter(12345, 11111),
                                   uplink.get_parameter(12345, 22222)))




loop = asyncio.get_event_loop()
loop.run_until_complete (run())

Console

The module contains a commandline utility to test and request data from Nibe Uplink called nibeuplink, it will store token information in a file in the current directory called nibeuplink.json

Example


Help for utility

.. code-block:: bash

nibeuplink -h

Request all systems

.. code-block:: bash

nibeuplink --client_id 'XXX' --client_secret 'YYY' --redirect_uri 'ZZZ'

Request data for specific system

.. code-block:: bash

nibeuplink --client_id 'XXX' --client_secret 'YYY' --redirect_uri 'ZZZ' --system 12345

Request data for parameters

.. code-block:: bash

nibeuplink --client_id 'XXX' --client_secret 'YYY' --redirect_uri 'ZZZ' --system 12345 --parameter 11111 22222

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc