semvec/pypi-packages huggingface dataset:
GPIO-Calculator 1.0.2
Simple GPIO calculator for libgpiod based on its chardev.
License: MIT
Requires Python: >=3.4.0


GPIO\_Calculator
================

Simple GPIO calculator for ``libgpiod`` based on its chardev using the formula
chardev = (alphabet_index - 1) * 32 + pin which is also used on ``sysfs``.

Installation
------------

.. code-block:: console

    pip install git+https://github.com/yeyeto2788/GPIO_Calculator

Usage
-----

.. code-block:: python

    from gpio_calculator import Calculator

    calculator = Calculator()

    # Get chardev based on pin letter and pin number.
    # Return should be 242
    calculator.get_chardev("H", 18)

    # Get chardev from list.
    # Returns a list of converted items [242, 243, 244].
    calculator.get_chardevs(["H18", "H19", "H20"])

    # Get pin from chardev.
    # Returns the pin number H18.
    calculator.get_pin(242)

    # Get all pins from chardevs.
    # Returns all pins found H18, H19, H20.
    calculator.get_pins([242, 243, 244])


Contributing
------------

**All contributions, pull requests and comments are welcome!**

When contributing it is important to test the module in order to make sure
everything is working as expected. For that install dependencies to run the tests.

.. code-block:: console

   pip install pytest pytest-cov mock pylint

Running tests and see coverage.

.. code-block:: console

   py.test --cov -v --cov-config=.coveragerc --cov-report=html

This will generate a report with the coverage which is at **98%** now, let's try to keep
it at the same percentage.
Utils-Config 1.0.0
Library to use .json files as configuration objects using namedtuple.
License: MIT
Requires Python: >=3.5.0


Utils-Config
============

Library to use .json files as configuration objects using namedtuple.

This library let’s you use ``.json`` files as “objects” within your
code.

Installation
------------

.. code-block:: console

   pip install git+https://github.com/yeyeto2788/Utils-Config


Usage
-----

Create a file called `config.json` (you can change the name to
something you like) and add some content to it.

In this demo we add the following data.

.. code-block:: json

   {
     "temperature": 30,
     "screen": {
       "width": 640,
       "height": 480
     },
     "name": null,
     "id": "4V3RYCR4ZY1D"
   }


Now let’s head over Python and test the module and its functions.

Importing the module and loading our `.json` file.

.. code-block:: python

   import utils_config
   config_file="./config.json"
   config = utils_config.load_config(config_file)


Now let’s see what we’ve got in the `config` variable, serializing it
into a dictionary.

.. code-block:: python

   utils_config.serialize_config(config)

Let’s access to its keys/attributes.

.. code-block:: python

   config.temperature
   config.screen.width
   config.name
   config.id

Edit the current configuration (Take into account that this function
will return a new `configuration` namedtuple)

.. code-block:: python

   config = utils_config.edit_config(config, {"id": "another_id"})
   config.id

Save the configuration to a file.

.. code-block:: python

   utils_config.save_config(config_file, config)

Contributing
------------

**All contributions, pull requests and comments are welcome!**

When contributing it is important to test the module in order to make sure everything is working as expected. For that install dependencies to run the tests.

.. code-block:: console

   pip install pytest pytest-cov mock pylint

Running tests and see coverage.

.. code-block:: console

   py.test --cov -v --cov-config=.coveragerc --cov-report=html

This will generate a report with the coverage which is at **100%** now,
let’s try to keep it at the same percentage.