Saravanan666/pypi-org huggingface dataset:
Package: hasse
hassePython library for representing Partially Ordered sets via Hasse Diagrams.Table of ContentsInstallationUsageInstallationIf you just need to usehasse, you can just run:$ pip install hasseFor developers, note that this project uses thepoetrypython package/dependency
management tool. Please familarize yourself with it and then
run:$ poetry installUsagehasseis centered around thehasse.PoSetclass.  An example is
given below.importhasseposet=hasse.PoSet.from_chains([1,2,4],# 1 < 2 < 4[1,3,4],# 1 < 3 < 4)# Test membership and size.assert2inposetassertlen(poset)==4assertset(poset)=={1,2,3,4}# Perform pair wise comparison.assertposet.compare(1,1)=='='assertposet.compare(1,4)=='<'assertposet.compare(4,2)=='>'assertposet.compare(2,3)=='||'# Add an edge.poset2=poset.add([2,1])poset2.compare(1,2)=='='
Package: hassfeld
hassfeld is a module primarily aimed to integrated Teufel Smart Speaker (aka Raumfeld Multiroom) intohttps://www.home-assistant.io/. However, the design is not tailored to Home Assistant and can be used as a module to any Pyhton program to control the Teufel Smart Speaker. The module also provides corresponding asyncio methods.Look how it is to use with asyncrhonous I/O:import asyncio
import aiohttp
import hassfeld


async def main():
    host = "teufel-host.example.com"
    port = 47365
    session = aiohttp.ClientSession()
    raumfeld = hassfeld.RaumfeldHost(host, port, session=session)

    asyncio.create_task(raumfeld.async_update_all(session))
    await raumfeld.async_wait_initial_update()

    zone = ["Master Bedroom"]

    media_info = await raumfeld.async_get_media_info(zone)
    print(f"Media info: {media_info}")

    await session.close()


asyncio.run(main())The use with blocking I/O was supported too but is currently broken:import hassfeld
raumfeld_host = "teufel-host.example.com"
zone = [ "Living room", "Kitchen" ]
raumfeld = hassfeld.RaumfeldHost(raumfeld_host)
raumfeld.start_update_thread()
raumfeld.search_and_zone_play(zone, 'raumfeld:any contains "Like a Rolling Stone"')FeaturesManagement and snapshot of zones.Search and play songs.Install hassfeld by running:python3 -m pip install hassfeldContributeIssue Tracker:https://github.com/B5r1oJ0A9G/hassfeld/issuesSource Code:https://github.com/B5r1oJ0A9G/hassfeldLicenseThe project is licensed under the GNU General Public License v3 (GPLv3).
Package: hass-flair-api
Flair API Client (Python)This package provides a very simple API client for theFlair API. Since the Flair API uses theJSON-APIstandard, this client is just a very thin wrapper around a JSON API client, but provides hooks for a extending it with custom models.InstallationEventually this will be released on PyPi, for now you'll need to install via githubpip install git+git://github.com/flair-systems/flair-api-client-py.gitThis package depdends onrequests, and requires Python 3.5 or greater.Usagefromflair_apiimportmake_clientclient=make_client(client_id,client_secret,'https://api.flair.co/')# retrieve a list of structures available to this accountstructures=client.get('structures')# get a single room by idroom=client.get('rooms',id="1")# fetch vents in a roomvents=room.get_rel('vents')# delete a roomroom.delete()# update a roomroom.update(attributes={'name':'Master Bedroom'},relationships=dict(structure=structures[0],vents=vents))# create a ventvent=c.create('vents',attributes={'name':'North Vent'},relationships=dict(room=room))# Add a vent to a roomroom.add_rel(vents=vent)# Update vent relationship for a roomroom.update_rel(vents=[vent])# Delete a vent relationship for a roomroom.delete_rel(vents=vent)AuthorizationAt the moment, this package only supports authenticating to the Flair API using a client credentials request. This will give access to resources owned by the user to whom the credentials were issued. Support for other OAuth flow will be coming in future releases.ExtensionIf, instead of having requests initialize or update the default Resource object, you'd like to use your own classes you can initialize the client with a mapper:fromflair_apiimportmake_client,ResourceclassUser(Resource):def__init__(*args,**kwargs):self.__super__.init(*args,**kwargs)def__str__(self):return"User: "+self.attributes['name']client=make_client(client_id,client_secret,'https://api.flair.co/',mapper={'users':User})users=client.get('users')foruserinusers:print(user)# "User: Edward", "User: Kenny", "User: Danimal"ContributingContributions are welcome by anyone. To get started,sign the Contributor License Agreement.LicenseCopyright 2016 by Standard Euler, IncLicensed under theApache Public License 2.0. See LICENSE.
Package: hass-inspirair
hass-inspirairA python application that connects to the ventilation systemInspirAir® HomefromAldesvia ModBus and exposes it as a device forHome Assistant.Schematics of dataflowgraph LR
    P(hass-inspirair) <-- MQTT --> M(MQTT Broker)
    I[InspirAir Home] <-- ModBus --> P
    HM(Home Assistant \n MQTT Integration) <--MQTT--> M
    H[Home Assistant] <----> HMOnly the ventilation mode is currently writable. However, it takes some time before the value changes after a write command.
Since the register will stay at its previous value until the target state is reached.Following features are implemented:1. Register after starting upsequenceDiagram
    participant H as Home Assistant(MQTT)
    participant L as hass-inspirair
    participant I as InspirAir
    
    
    L->>+I: read_holding_registers
    activate L
    L-->>L: creat config
    
    L->>-H: register <prefix>/<sensor_type>/<object_id>/<device_serial>/config2. Continues updatessequenceDiagram

    participant H as Home Assistant(MQTT)
    participant L as hass-inspirair
    participant I as InspirAir


    L->>I: read_holding_registers
    activate L
    L->>L: parse result
    L->>H: publish <prefix>/climate/<device_serial>/state
    L->>L: sleep for <polling interval>
    deactivate L3. React on Home Assistant InputssequenceDiagram
    participant H as Home Assistant(MQTT)
    participant L as hass-inspirair
    participant I as InspirAir

    H->>L: publish "<prefix>/select/<object_id>/<device_serial>/set"
     activate L
    L->>I: write_registers
    L->>I: read_holding_registers

    L->>L: parse result
    L->>H: publish <prefix>/climate/<device_serial>/state
    deactivate L4. React on Home Assistant MQTT lifecycle eventssequenceDiagram

    participant H as Home Assistant(MQTT)
    participant L as hass-inspirair
    participant I as InspirAir

    H->>L: publish "<prefix>/status" payload: "online"
    activate L
    L->>+I: read_holding_registers

    L-->>L: creat config

    L->>-H: register <prefix>/<sensor_type>/<object_id>/<device_serial>/config5. Multilanguage SupportDefault language is german, however, an english translation is available.Supported ModelsIn theory this application should work with anyInspirAir® HomeVentilation system.Currently, only the following was actually tested:InspirAIR Home SC 370UsageConfigure aconfig.inifile based on your requirements (or use environment variables) .
Seeconfig.inifor configuration options which can also be set via environment variablesConfig Values.pipintallhass-inspirair
ha-inspirair-c./config.iniFor are more exhaustive usage tutorial seedocs/tutorial/index.md.Simulator/TestingThe compose stack includes a simulator that exposes the relevante registers via Modbus-TCP. The presented values are a pure mock.
However, this stack can be used to try out the behavior of the MQTT discovery.Rundocker-compose upgotohttp://localhost:8123Setup a userAdd the MQTT Integration (host=mqtt, no further credentials)A device should show up
Package: hassmpris-client
Simple client to control the MPRIS multimedia agentThis package contains a simple command-line utility that allows you to pair
and then control any computer with the MPRIS Linux desktop agent.It also contains an asyncio-based client class that permits your Python
programs to control media players on computers running the desktop agent.
This class is used in Home Assistant to provide access to media players via
the Home Assistant user interface.SetupServerInstall theMPRIS Linux desktop agenton the computer you want to control remotely.This packageInstall this package on the computer you want to control other machines from.
You'll find the programhassmpris-clientinstalled here.Troubleshooting and helpLook at your system logs (e.g. if running this under Home Assistant, look at the
Home Assistant logs).  You should make a copy of any traceback of interest.Found a bug or a traceback?Please report it in theproject's issue tracker.
Package: hasspad
hasspadA macropad interface for Home Assistant using the Pimoroni KeybowInstallationFirst, provision the device. Flashraspiosand ensuresshand WiFi access are enabled.
This can be done by writing a blanksshfile and awpa_supplicant.conffile to the BOOT mount.Once you are able to login to the device, perform some basic setup to set the hostname and enable SPI:sudo raspi-config nonint do_hostname hasspad
sudo raspi-config nonint do_spi 1
sudo rebootInstalldockeranddocker-compose:curl -sSL https://get.docker.com | sh
sudo usermod -aG docker pi

sudo apt-get install -y libffi-dev libssl-dev python3 python3-pip
sudo pip3 install docker-composeThe last thing you need to do is ensure environment variables are set that are used to authenticate with Home Assistant.
You can also pass these in as flags or modifydocker-compose.yml:export HASSPAD_URI="ws://homeassistant.local:8123/api/websocket"
export HASSPAD_ACCESS_TOKEN="abcd"Finally, just rundocker-compose up.
Package: hass-smartthings-remove
hass_smartthings_removeUtility that removes SmartApps/Automations created by the Home Assistant SmartThings integrationInstallationpipinstallhass_smartthings_removeUsagehass_smartthings_removePERSONAL_ACCESS_TOKENPERSONAL_ACCESS_TOKENis the token created and used in the Home Assistant integration.This command will remove all SmartApps/Automations for all Home Assistant integrations.
Package: hass-splunk
Splunk HEC for Home AssistantA Splunk HTTP Event Collector library that follows best practices by opening a single connection to Splunk, and reuses it. When sending large or high volumes of events, or Splunk is slow, the events are batched together. This also allows events to be resent in the case of failures, as they are simply returned to the queue.Requires you create an aiohttp Client Session, or reuse your applications existing one. From Home Assistant this would behomeassistant.helpers.aiohttp_client.async_get_clientsessionMethodshass_splunk(session,token,host,port=8088,use_ssl=True,verify_ssl=True,endpoint="collector/event",timeout=5)Session, token, and host are required, all other parameters are optional, and will be set to defaults shown.check(connectivity=True, token=True, busy=True)Returns True if the parameter conditions are okay, False if any fail or any other error is raised. You can selectively ignore certain conditions by setting them to False.queue(payload, send=True)The String or Dictionary to be sent to Splunk. By default it will be sent as soon as possible, but you can instead set send=False and it only be queued.send()The sends whatever data is in the queue, is what queue() uses internally when send=True.Exampleimport asyncio
import aiohttp
import time
from hass_splunk import hass_splunk


async def main():
    async with aiohttp.ClientSession() as session:
        splunk = hass_splunk(
            session=session,
            host="http-inputs-stack.splunkcloud.com",
            use_ssl=True,
            verify_ssl=True,
            token="private",
        )
        print(await splunk.check(connectivity=True, token=True, busy=True))
        await splunk.queue(
            {
                "time": time.time(),
                "host": "name",
                "event": {
                    "meta": "TEST",
                },
            },
            send=False,
        )
        await splunk.send()

asyncio.run(main())
Package: hass-websocket-client
hass-clientHome Assistant async API wrapperAPI DocumentationExample Usage:fromhass_wsimportHassWSasyncdefmain():client=awaitHassWS("wss://server.hass","token")print(awaitclient.fetch_states())# Displays all HASS statesprint(awaitclient.call_service("light","turn_on"))# Turns on all lightsasyncwithclient.listen_event(type="call_service")aslistener:asyncforiinlistener:print(i)awaitclient.close()HassWS Interface:awaitHassWS(server:str,token:str)server: Required, str. Base server URL of HASS instance, includingwss://orws://protocol specifier.token: Required, str. Long-lived HASS access token.Properties/Members:HassWS().ready: Boolean value,Trueif the client is ready to send commands.HassWS().meta:HassMeta, server metadata.Noneif not connected.Methods:await HassWS().close(): Closes the currently active connection. To reconnect, callawait HassWS().authenticate()await HassWS().fetch_states() -> HassEntity[]: Returns current states of all entities.await HassWS().fetch_config() -> HassConfig: Returns current server configawait HassWS().fetch_services() -> {domain: {service: HassService}}: Returns all available servicesawait HassWS().fetch_panels() -> {name: HassPanel}: Returns all UI panelsawait HassWS().call_service(domain: str, service: str, target: HassServiceTarget = {}, data: dict = {}) -> bool: Calls a service, returning boolean success value.async with HassWS().listen_event(type: str = None) -> AsyncIterator: Subscribes to an event (or all events, iftype = None), and returns an asynchronous iterator for them.
Package: hastebiny
hastebinyAn unofficial hastebin module.pip install hastebinyThis is a simpe module that allows you to create and recieve hastebins. There are two functionssendandget. Using thesendfunction, you can send data (text) to hastebins server and store it there, the function will return a key to access this data.
Thegetfunction will return the data (text) attributed to a key.# Example codefromhastbinyimporthbkey=hb.send("My hastebin content :)")print(key)print(hb.get(key))
Package: haste-client
A simple client forHaste
serverwritten in Python.InstallationUse pip or easy_install:pip install haste-clientGentoo users can usehaste-clientebuild fromCVUT Overlay.Haste client needs Python 2.6+ or 3.x (it was tested on 2.7, 3.3 and
3.4) and following modules:requestsdocopt>= 0.3.0UsageText can be passed tohastevia stdin or a file. TTY is also
supported.haste FILE
cat FILE | hasteURL of the created entry is then printed to STDOUT.ConfigurationHaste client reads configuration variables from~/.hastecand/etc/hastec.conf(in this order, first wins). When no such file or
the particular variable exists, then default values are used:server_url = http://hastebin.com
timeout = 3LicenseThis project is licensed underMIT
license.
Package: hastl
HaSTL [ˈheɪstiɛl]: A fast GPU implementation of batched Seasonal and Trend
decomposition using Loess (STL) [1] with missing values and support for both
CUDA and OpenCL (C and multicore backends are also available).
Loosely based onstlplus, a
popular library for the R programming language. The GPU code is written inFuthark, a functional language that compiles
to efficient parallel code.RequirementsYou would need a working OpenCL or CUDA installation/header files, C compiler and these Python packages:futhark-ffi==0.14.2wheelInstallationYou may want to run the program in a Python virtual environment. Create it via:python -m venv envThen, activate the virtual environment via:. env/bin/activateUpgrade pip via:pip install --upgrade pipThen select the backends (choose from opencl, cuda, c and multicore) that you wish to build by setting the environment variable:export HASTL_BACKENDS="opencl multicore c"If no environmental variable is set, only the sequential c backend would be compiled.The package can then be easily installed using pip. This will take a while, since we need
to compile the shared libraries for your particular system, Python implementation and all selected backends:pip install hastlTo install the package from the sources, first get the current stable release via:git clone https://github.com/mortvest/hastlInstall the dependencies via:pip install -r requirements.txtAfterwards, you can install the package. This can also take a while:python setup.py sdist bdist_wheel
pip install .UsageExamples of HaSTL usage can be found in the examples/ direcotry. The simplest snippet should contain:from hastl import STL
stl = STL(backend=..)
seasonal, trend, remainder = stl.fit(data, n_p=.., q_s=..)References[1] Cleveland, Robert B., et al. “STL: A seasonal-trend decomposition.” J. Off. Stat 6.1 (1990): 3-73.
Package: hasts-plugins
ha-sts-plugin-libraryThis is the library that should be imported when writing a plugin for the ha-sts server.FIXME: Write a readme about the library, not how to build it.Commands to build and push to PyPi:Install build dependencies:pip install --upgrade -r requirements.txtRun tests and such:python ./analysis_pylint.py
python ./analysis_coverage.py
python ./analysis_radon.pyBuild and upload:rm -rf dist/*
python -m build
twine upload --config-file .pypirc dist/*
Package: hasty
Python library for the Hasty API.Installationpip install hastyUsage ExampleEstablish initial connection with Hasty:fromhastyimportClientAPI_KEY="your_key"h=Client(api_key=API_KEY)Get projectsprojects=h.get_projects()print(projects)>>['Project(id="9a5ac730-9b08-477d-8f20-e7245baf0e29", name="African Wildlife")']Create datasetbuffalo_ds=project.create_dataset("buffalo")print(buffalo_ds)>>Dataset(id="66ee13d5-aaf7-4fac-862c-45f44eff802a",name="buffalo")Upload imageimg=project.upload_from_file(buffalo_ds,"./buffalo/001.jpg")print(img)>>Image(id="ebf88007-134b-4bce-9799-995504b2b0ee",dataset_name="buffalo",name="001.jpg")For more information check ourdocumentation
Package: hastygram
hastygramA lightweight frontend for Instagram. No fuss, just navigate to/<username>and enjoy the content.
This supports images, videos and "groups" thereof – Instagram call themsidecars.Click on a media to enlarge it to its original resolution. No more ridiculously small pictures!UsageYou need an account, otherwise Instagram will quickly rate-limit your anonymous session.Connect to Instagram using thewebsite, then using the browser devtools, copy thesessionidcookie value to the clipboard.On your Hastygram frontend, use theAuthenticatebutton to paste the cookie value. This is necessary only once.If you encounter errors after a while, follow the same procedure again with a freshsessionidcookie.Building and deployingSee/examplefor an example deployment using Nginx.# The frontend:# You'll have to serve the resulting web/build/ directory as static files.$(cdweb&&yarnrunbuild)# The Python backend:# You'll have to reverse-proxy :8000 in location /_.$pipinstallhastygram'uvicorn[standard]'$uvicornhastygram.app:app--port8000LicenseGNU General Public License v3.0Screenshot
Package: hasy
Please refer to theHASY paperfor details
about the dataset. If you want to report problems of the HASY dataset, please
send an email toinfo@martin-thoma.deor file an issue athttps://github.com/MartinThoma/HASYErrata are listed in the git repository as well as the actualhasypackage.ContentsThe contents of theHASYv2 datasetare:hasy-data: 168236 png images, each 32px x 32pxhasy-data-labels.csv: Labels for all images.classification-task: 10 folders (fold-1, fold-2, ..., fold-10) which
contain atrain.csvand atest.csveach. Every line of the csv files
points to one of the png images (relative to itself). If those files are
used, then thehasy-data-labels.csvis not necessary.verification-task: Atrain.csvand three different test files. All files
should be used in exactly the same way, but the accuracy should be reported
for each one.
The task is to decide for a pair of two 32px x 32px images if they belong
to the same symbol (binary classification).symbols.csv: All classesREADME.txt: This fileHow to evaluateClassification TaskUse the pre-defined 10 folds for 10-fold cross-validation. Report the
average accuracy as well as the minumum and maximum accuracy.Verification TaskUse thetrain.csvfor training. Usetest-v1.csv, test-v2.csv,test-v3.csv` for evaluation. Report TP, TN, FP, FN and accuracy for each
of the three test groups.hasy packagehasycan be used in two ways: (1) as a shell script (2) as a Python
module.If you want to get more information about the shell script options, execute$ hasy --help
usage: hasy [-h] [--dataset DATASET] [--verify] [--overview] [--analyze_color]
            [--class_distribution] [--distances] [--pca] [--variance]
            [--correlation] [--count-users] [--analyze-cm CM]

optional arguments:
  -h, --help            show this help message and exit
  --dataset DATASET     specify which data to use (default: None)
  --verify              verify PNG files (default: False)
  --overview            Get overview of data (default: False)
  --analyze_color       Analyze the color distribution (default: False)
  --class_distribution  Analyze the class distribution (default: False)
  --distances           Analyze the euclidean distance distribution (default:
                        False)
  --pca                 Show how many principal components explain 90% / 95% /
                        99% of the variance (default: False)
  --variance            Analyze the variance of features (default: False)
  --correlation         Analyze the correlation of features (default: False)
  --count-users         Count how many different users have created the
                        dataset (default: False)
  --analyze-cm CM       Analyze a confusion matrix in JSON format. (default:
                        False)If you want to usehasyas a Python package, seepython -c "import hasy.hasy_tools;help(hasy.hasy_tools)"Changelog14.05.2020, hasy Python package: Major refactoring of this repository24.01.2017, HASYv2: Points were not rendered in HASYv1; improved hasy_toolshttps://doi.org/10.5281/zenodo.25944418.01.2017, HASYv1: Initial uploadhttps://doi.org/10.5281/zenodo.250239
Package: hasy-tools
hasy_toolshasy_toolsis a support package for the HASY dataset. The dataset is
described inThe HASYv2 dataset.The HASY dataset contains handwritten symbols obtained viaDetexifyandwrite-math.com. The data was rendered and is similar
to MNIST.Installation$pipinstallgit+https://github.com/MartinThoma/hasy_tools.gitIt can, of course, also be installed via PyPI.Usage>>> import hasy_tools
>>> data = hasy_tools.load()
>>> data.keys()
dict_keys(['x_train', 'y_train', 'x_test', 'y_test', 's_train', 's_test', 'labels'])
>>> len(data['labels'])
369
>>> data['x_train'].shape
(151241, 32, 32, 1)
>>> x_train = hasy_tools.preprocess(data['x_train'])
>>> y_train = np.eye(hasy_tools.n_classes)[y_train.squeeze()]