Skip to main content

README FILE

This library has only 3 files, but only one is suppose to use: gCentralComponent (gCeCo)

This file has 3 main function which

  1. gives it access to the information in the database in general
  2. gives it access to the information in the database by ID
  3. gives it access to the information in the database by dataType

Database with just the information for the inverters

Read Me File

How does this library works?

In the library there are 3 types of folders:

  • The "g" type
  • The "s" type
  • The "w" type

Brief Explanation:

The "g" files are files that are the gateway to the database itself. These files helps us to make use of the database as simple as possible. These type of files include one file which is the "gCentralCompenent" and, as the name suggests, is the center of all of the operation in the database and access to it.

The "s" files are the struture and architecture of each of the tables of the database, for example, sMeasure and sService arbitrage. In these files, there are fucntions to access the small tables for each "dataType".

The "w" files, the last type, is for web files. These type of files are the gateway to access and write in the database through the help of the Flask library. With these files, we can write, read and manipulate data from the database using the application layer protocol (get, post, put, delete, ...).

The "g" files:

gBaseDB:

This file has the code to implement and create the database. Its only funtion is to create the data base and the architecture

gCentralComponent:

This is the cerebro or the brain of all of the action. This file is the most important file of all.

This file is compost out of 5 blocks:

    1- The imports and data types
    2- The Strucutre of the main table (this table have the information of all tables) 
    3- The List functions
    4- The manipulate functions
    5- And the new Information funtions


1) First, it is imported the files to have access to the other tables and the functions to use it. The it has a list of dataTypes that are available to use. 

2) Second tge declaration of tha main table. It has the follwing data

    id = Column(Integer, primary_key=True)
    topic = Column(String)
    iotDeviceID = Column(String)
    dataType = Column(String)

    id - Every record or row in the table has its id. This is how the table controls all the flow of information

    topic - this information should be blank if it was sent throught the internet protocol but it is automatically filled if it was recived through mqtt because every information is sent linked to a topic

    iotDeviceID - this is the id of the "person" or device who is sending the information. It should be unique for every person

    dataType -  is the the name of the table that the information should be write on

    dataTypesAvailable = [
        "bessMeasurementData",
        "bessSetPointDataDB",
        "measurementData",
        "pVGeneratorData",
        "pVGeneratorSetPoint",
        "serviceArbitrage",
        "ServicePeakShaving",
        "serviceSelfConsumption",
        "inverterData",
               ]

3) The list functions, includes to gather all information by ID, by topic or all the information 

4) These block has 3 main functions:

    - deleteEntryByID which deletes rows, giving an ID
    - Tranforms the entry/row into a dictionary form
    - Tranforms a group of rows into a dictionary form
    
    WARNING: If it is more than one row or a list of one element, IT HAS to be used the table2dict fucntion instead of the row2dict function

5) This function is used to create a new entry in the main table and this fucntion is in charge of forward the information to the correct table. 
It has to be given a topic (even if there is blank), and ID, a dataType that is in the dataTypes availables and the data in the correct format.

This format is decrbied in  another document

The "s" files:

This files are not to be used directly.

They store and manipulate the information of each table that is related to the each table

The "w" files:

As mentioned above this files are the gateway of the database. It can be access through the internet.

To run the the server thorught the RESTFul, we need to run the funciton launchDataBase()

To run throught MQTT, we need to run the laucnhMQTT()

Then, everytime someone publishes a message, it automatically saves in the server's database.

Everytime someone POST or GET thourght an URL available, it saves info in the database or retrieve data from the database (so far):

URL's Available:

GATEDATASERVICE = "http://localhost:8000" is the Base URL

then we add /info/example to get have access to the funtions we get

http://localhost:8000/info/example

routes available:

/API/data Methods: [GET,POST]

Description: If Get, ir returns all the information in the central database If POST, reads the information in the body and creates a record of that data (creates a row in the database)

/API/data/ID/path:dataID Methods: [GET]

Description: Gets a specific row with that id

Example: /API/data/ID/4 gives the data realted to the entry with 4 as an ID

/API/data/dataType/path:dataType Methods: [GET]

Description: Gets all the records within that dataType. It returns a dictionary with all the information

Metadata

Release files for InverterDB 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for InverterDB 0.1.0
File Size Uploaded Provenance Actions
inverterdb-0.1.0.tar.gz 8.3 MB Without provenance Details for inverterdb-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for InverterDB 0.1.0
File Interpreter ABI Platform Actions
inverterdb-0.1.0-py3-none-any.whl Python 3 none any Details for inverterdb-0.1.0-py3-none-any.whl

Total release size: 15.2 MB

Release files / inverterdb-0.1.0.tar.gz

Download URL inverterdb-0.1.0.tar.gz
Size 8.3 MB
Tags Source
SHA-256 checksum
How to use checksums
39b1b6e913baea6ce67dde43972bad2b80f426283cb5e830f495b55e85cc1042
BLAKE2b-256 checksum
How to use checksums
a9699d1c554a3215c8847c6fef3be8be9821bb63c8f5def7700c03f757021083
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / inverterdb-0.1.0-py3-none-any.whl

Download URL inverterdb-0.1.0-py3-none-any.whl
Size 6.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0cb73d87681eb30c472551b4b491c13e9f82e68519aad0db08efc2d4ab154595
BLAKE2b-256 checksum
How to use checksums
51a81de1ba5ac307295b87b6e0d6cee72b67627eff00938110428550dd62ce06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Security for InverterDB 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page