<commit_before>chip_python_aREST
============================
A REST API for controlling CHIP GPIO

Manual::

For Python2.7::

    sudo apt-get update
    sudo apt-get install git build-essential python-dev python-pip flex bison python-flask -y
    git clone git://github.com/xtacocorex/chip_python_aREST.git
    cd chip_python_aREST
    sudo python setup.py install

For Python3::

    sudo apt-get update
    sudo apt-get install git build-essential python3-dev python3-pip flex bison python-flask -y
    git clone git://github.com/xtacocorex/chip_python_aREST.git
    cd chip_python_aREST
    sudo python3 setup.py install

CHIP_IO is required to use this library, code and instructions are here: https://github.com/xtacocorex/CHIP_IO

Usage
--------

TBD

REST API
---------

**Basics**

  +------------------+-------------------------------+------------------------------------------------------+
  | **Method**       | **Command**                   | **Description**                                      |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /                             | Basic Info                                           |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /id                           | Basic Info                                           |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /debug                        |  Dump all data                                       |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /<variablename>               | Get value of <variablename>                          |
  +------------------+-------------------------------+------------------------------------------------------+
  | PUT, POST        | /<variablename>?value=<value> | Set <variablename> to <value>                        |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /<functionname>               | Get value of <functionname>                          |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /<functionname>?value=<value> | Get value of <functionname> with <value> as input    |
  +------------------+-------------------------------+------------------------------------------------------+

**GPIO**

**PWM**

TBD

**Software PWM**

TBD

**LRADC**

**Utilities**


Credits
--------

<NAME> for the original pi-aREST node.js code that was used as a basis for this code.
(https://github.com/marcoschwartz/pi-aREST)

License
-------

CHIP Python aREST by <NAME>, released under the MIT License.
<commit_msg>More updating the README for #5: added GPIO, LRADC, and Utilities<commit_after>chip_python_aREST
============================
A REST API for controlling CHIP GPIO

Manual::

For Python2.7::

    sudo apt-get update
    sudo apt-get install git build-essential python-dev python-pip flex bison python-flask -y
    git clone git://github.com/xtacocorex/chip_python_aREST.git
    cd chip_python_aREST
    sudo python setup.py install

For Python3::

    sudo apt-get update
    sudo apt-get install git build-essential python3-dev python3-pip flex bison python-flask -y
    git clone git://github.com/xtacocorex/chip_python_aREST.git
    cd chip_python_aREST
    sudo python3 setup.py install

CHIP_IO is required to use this library, code and instructions are here: https://github.com/xtacocorex/CHIP_IO

Usage
--------

TBD

REST API
---------

**Basics**

  +------------------+-------------------------------+------------------------------------------------------+
  | **Method**       | **Command**                   | **Description**                                      |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /                             | Basic Info                                           |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /id                           | Basic Info                                           |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /debug                        | Dump all data                                        |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /<variablename>               | Get value of <variablename>                          |
  +------------------+-------------------------------+------------------------------------------------------+
  | PUT, POST        | /<variablename>?value=<value> | Set <variablename> to <value>                        |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /<functionname>               | Get value of <functionname>                          |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /<functionname>?value=<value> | Get value of <functionname> with <value> as input    |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /version                      | Get current CHIP_IO version                          |
  +------------------+-------------------------------+------------------------------------------------------+

**GPIO**

  +------------------+-------------------------------+------------------------------------------------------+
  | **Method**       | **Command**                   | **Description**                                      |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET, PUT, POST   | /digital/<pinname>/[0,1]      | Digital Write 0 or 1 to <pinname>                    |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /digital/<pinname>            | Digital Read <pinname>                               |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /digital/<pinname>/r          | Digital Read <pinname>                               |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /digital/cleanup              | Cleanup all GPIO Pins                                |
  +------------------+-------------------------------+------------------------------------------------------+
  | GET              | /digital/cleanup/<pinname>    | Cleanup only GPIO Pin: <pinname>                     |
  +------------------+-------------------------------+------------------------------------------------------+

**PWM**

TBD

**Software PWM**

TBD

**LRADC**

  +------------------+-------------------------------------------+------------------------------------------------------+
  | **Method**       | **Command**                               | **Description**                                      |
  +------------------+-------------------------------------------+------------------------------------------------------+
  | GET, PUT, POST   | /analog/sample_rate/[32.25,62.5,125,250]  | Set LRADC Sample Rate to 32.25, 62.5, 125, or 250    |
  +------------------+-------------------------------------------+------------------------------------------------------+
  | GET              | /analog/sample_rate                       | Get currrent LRADC Sample Rate                       |
  +------------------+-------------------------------------------+------------------------------------------------------+
  | GET              | /analog/scale_factor                      | Get LRADC Scale Factor                               |
  +------------------+-------------------------------------------+------------------------------------------------------+
  | GET              | /analog/raw/[0,1]                         | Get raw LRADC output for channel 0 or 1              |
  +------------------+-------------------------------------------+------------------------------------------------------+
  | GET              | /analog/full/[0,1]                        | Get full LRADC output for channel 0 or 1             |
  +------------------+-------------------------------------------+------------------------------------------------------+

  **Utilities**

  +------------------+-------------------------------------------+------------------------------------------------------+
  | **Method**       | **Command**                               | **Description**                                      |
  +------------------+-------------------------------------------+------------------------------------------------------+
  | GET, PUT, POST   | /1v8_pin/enable/[1.8,2.0,2.6,3.3]         | Enable 1.8V Pin to output 1.8, 2.0, 2.6, or 3.3V     |
  +------------------+-------------------------------------------+------------------------------------------------------+
  | GET              | /1v8_pin/voltage                          | Get currrent 1.8V Pin voltage setting                |
  +------------------+-------------------------------------------+------------------------------------------------------+
  | GET              | /1v8_pin/disable                          | Disable 1.8V Pin                                     |
  +------------------+-------------------------------------------+------------------------------------------------------+
  | GET              | /unexport_all                             | Backup function to unexport all GPIO                 |
  +------------------+-------------------------------------------+------------------------------------------------------+

Credits
--------

<NAME> for the original pi-aREST node.js code that was used as a basis for this code.
(https://github.com/marcoschwartz/pi-aREST)

License
-------

CHIP Python aREST by <NAME>, released under the MIT License.

{'fraction_non_alphanumeric': 0.47222747024371814, 'fraction_numerical': 0.007462686567164179, 'mean_word_length': 0.48568621947796803, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '40015', 'n_tokens_mistral': 2030, 'n_tokens_neox': 1817, 'n_words': 459}