Metadata-Version: 2.1
Name: visualist
Version: 0.1.0
Summary: A simple library to visualize lists.
Home-page: UNKNOWN
Author: Thiago Nepomuceno
Author-email: thi.nepo@gmail.com
License: UNKNOWN
Description: # AutoIoT Framework
        
        AutoIoT is a framework to generate the server-side software of IoT applications. Based on a model represented as JSON, AutoIoT can generate different components of IoT applications; each component is generated by a different _Specialized Builder_ (generators in the AutoIoT project).
        
        ### Install
        
        To install AutoIoT from this repository, clone the repository and run:
        
        ```
        pip install dist/autoiot-0.1.0-py3-none-any.whl
        ```
        
        ### Usage
        
        To use AutoIoT you need to create a JSON file containing the description of your IoT project, like the one presented below.
        
        In the future this JSON file will be generated by a Web Graphical User Interface (GUI).
        
        ```json
        {
            "name": "My IoT Project",
            "description": "This is a sample project to show how to use AutoIoT Specialized Builders.",
            "devices": [
                {
                    "name": "Raspberry Pi",
                    "description": "A small single-board computer.",
                    "attributes": [
                        {
                            "name": "room",
                            "type": "String"
                        },
                        {
                            "name": "model version",
                            "type": "Integer"
                        }
                    ],
                    "sensors": [
                        {
                            "name": "DHT11",
                            "attributes": [
                                {
                                    "name": "temperature unit",
                                    "type": "String"
                                }
                            ],
                            "data": [
                                {
                                    "name": "temperature",
                                    "type": "Float"
                                },
                                {
                                    "name": "humidity",
                                    "type": "Integer"
                                }
                            ]
                        },
                        {
                            "name": "GPS",
                            "attributes": [
                                {
                                    "name": "model",
                                    "type": "String"
                                }
                            ],
                            "data": [
                                {
                                    "name": "position",
                                    "type": "GPS"
                                }
                            ]
                        }                            
                    ]
                }
            ]
        }
        ```
        
        The types of data supported by AutoIoT in the description of the system are: **String**, **Integer**, **Float**, **Boolean**, **GPS**, **Position**.
        
        _Attributes_ represent features of devices and sensors and usually do not change very often, while _data_ represent the data sent regularly from devices to the server application.
        
        Now you can import this file into your code and generate the application's source code by choosing one of the available **Specialized Builders**. In this example we are going to use the _SimpleDeviceAPI_ builder that is packed inside this module (others **Specialized Builders** need to be installed separately).
        
        ```python
        from autoiot.AutoIoT import AutoIoT
        from autoiot.SimpleDeviceAPI import SimpleDeviceAPI
        
        autoiot = AutoIoT()
        
        autoiot.load_project_from_file('project.json')
        
        autoiot.build(SimpleDeviceAPI, 'output')
        ```
        
        The generated source code is written in the folder called "output".
        
        Optionally, your can use the command line interface. Just open a command line in a folder type the following command: 
        
        ```
        autoiot -p project.json -o output
        ```
        
        This will generate an IoT system based in your project.json file in the "output" folder.
        
        #### SimpleDeviceAPI Builder
        
        The system generated by **SimpleDeviceAPI** is a ready-to-use project written in Python using the [FastAPI](https://github.com/tiangolo/fastapi) framework, it provide the abstraction of **one** IoT device and allow you to store and retrieve sensor data and the device information.
        
        To make this example the simplest possible, we choose to avoid databases that require installation and configuration (e.g., PostgreSQ:, MySQL and MongoDB). The system created by this builder uses the [tinyDB](https://github.com/msiemens/tinydb) database.
        
        To setup the generated system you need to navegate to its root folder (the "output" folder if you are following the example) and run the following commands:
        
        ```
        pip install -r requirements.txt
        uvicorn main:app
        ```
        
        Your **SimpleDeviceAPI** system will be running in _http://localhost:8000_. To access its **OpenAPI GUI** you should use _http://localhost:8000/docs_, where you can try some requests and see the system in action.
        
        The main idea behind this **Specialized Builder** is to be a Blueprint that shows how a **Specialized Builder** can be created. It is not intended to be used in production and provide very limited features.
        
        ### Contributing to the project
        
        #### Tests
        
        This project uses [pytest](https://github.com/pytest-dev/pytest). To run the tests use:
        
        First, you need to install the _pytest-cov_ library to do coverage test:
        
        ```
        pip install pytest-cov
        ```
        
        and then run the tests:
        
        ```
        pytest --cov-report html --cov=autoiot autoiot/tests/
        ```
        
        #### Building the library
        
        To build the library you need the **wheel** module:
        
        ```
        pip install wheel
        ```
        
        and run the following command:
        
        ```
        python setup.py sdist bdist_wheel
        ```
        
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
