Skip to main content

import aindapy import random import time import json import datetime

from numpy.core.numeric import _correlate_dispatcher

import logging

import http.client as http_client

http_client.HTTPConnection.debuglevel = 1

logging.basicConfig()

logging.getLogger().setLevel(logging.DEBUG)

requests_log = logging.getLogger("requests.packages.urllib3")

requests_log.setLevel(logging.DEBUG)

requests_log.propagate = True

aindapy.config(logLevel=1)

auth = aindapy.Auth( apiUrl='https://aindaanalytics.com/ainda/api/', userName='asdfasdfasdfsdfsdf', passWord='asdfasdfsdf' )

The datasource now accepts only the ids, so pls check what is the correct id for it.

Demo WareHouse dataWareHouseId=7, dataSourceId=20

Ainda Packaging Line WareHouse dataWareHouseId=8, dataSourceId=22

dataSource = aindapy.DataSource( auth=auth, dataWareHouseId=7, dataSourceId=20 )

Generate Data for graphics that are not timeseries

data = aindapy.Data(auth=auth, dataSource=dataSource, bufferSize=1000)

Generate Data Sample for pie

data.deleteDataKeys([ 'basicdemo/pie1', 'basicdemo/pie2', 'basicdemo/bar1', 'basicdemo/bar2', 'basicdemo/bar10Columns', 'basicdemo/bar50Columns', 'basicdemo/scaleline250points', 'basicdemo/scaleline500points' ]) data.addToBuffer('basicdemo/pie1', random.randint(50, 150), 'Ilha 1') data.addToBuffer('basicdemo/pie1', random.randint(70, 180), 'Ilha 2') data.addToBuffer('basicdemo/pie1', random.randint(10, 75), 'Ilha 3') data.addToBuffer('basicdemo/pie1', random.randint(25, 45), 'Ilha 4')

data.addToBuffer('basicdemo/pie2', random.randint(50, 150), 'Ilha 1') data.addToBuffer('basicdemo/pie2', random.randint(70, 180), 'Ilha 2') data.addToBuffer('basicdemo/pie2', random.randint(10, 75), 'Ilha 3') data.addToBuffer('basicdemo/pie2', random.randint(25, 45), 'Ilha 4') data.addToBuffer('basicdemo/pie2', random.randint(25, 45), 'Ilha 4') data.addToBuffer('basicdemo/pie2', random.randint(25, 45), 'Ilha 4') data.addToBuffer('basicdemo/pie2', random.randint(25, 45), 'Ilha 4')

Generate Data Sample for one bar graphic with 10 columns

for step in range(10): data.addToBuffer('basicdemo/bar10Columns', random.randint(50, 150), step)

Generate Data Sample for one bar graphic with 50 columns

for step in range(50): data.addToBuffer('basicdemo/bar50Columns', random.randint(50, 150), step)

Generate Data Sample for line

for step in range(250): data.addToBuffer('basicdemo/scaleline250points', random.randint(50, 150), step)

for step in range(500): data.addToBuffer('basicdemo/scaleline500points', random.randint(50, 150), step)

data.commit()

Generate data for one timeseries datatag. This data we can not deleted what was added before

If the tag do not exist, the code create this tag inside our system.

stag1 = aindapy.SensorTag(auth=auth, dataSource=dataSource, channel='1', datatag='XRND1', tag='Random Value 1', tag_unit='KG', tag_updaterate=1000) stag2 = aindapy.SensorTag(auth=auth, dataSource=dataSource, channel='1', datatag='XRND2', tag='Random Value 2', tag_unit='KG', tag_updaterate=1000)

tdata = aindapy.DataTimeSeries(auth=auth, dataSource=dataSource, bufferSize=1000) for step in range(10000): tdata.addToBuffer(sensorTag=stag1, timeStamp=datetime.datetime.now(), value=random.randint(45,90))

# if you do not pass timestamp, we will generate internaly
tdata.addToBuffer(sensorTag=stag2, value=random.randint(45,90))

tdata.commit()

Metadata

Release files for aindapy 0.0.14

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

Built distribution (wheel)

Table of built distributions (wheels) for aindapy 0.0.14
File Interpreter ABI Platform
aindapy-0.0.14-py3-none-any.whl Python 3 none any Details

Release files / aindapy-0.0.14-py3-none-any.whl

Download URL aindapy-0.0.14-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b502296942f86ac8915130c0d04409fd4dd00e6b3cd76e33df52c753fa4c528a
BLAKE2b-256 checksum
How to use checksums
3e9fb2c9820f0e28a20b955476d3ab3686bad3220fd14698b3502cf1f2c8c478
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.5

Security for aindapy 0.0.14

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.

Release history Release notifications | RSS feed

This release

0.0.14 This release

1 release file 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