Saravanan666/pypi-org huggingface dataset:
Package: huehush
Hue HushThis Python module performs K-means clustering on an image to segment it into a specified number of clusters.InstallationYou can install the module via pip:pipinstallhuehush==0.0.1Usagefromhuehushimportcluster_image# Example usage:cluster_image('input_image.jpg',num_clusters=5,save_path='clustered_image.jpg')How it WorksThecluster_imagefunction takes an input image, the number of clusters (K) to create, and an optional path to save the resulting clustered image. It applies K-means clustering to the colors in the image, replacing each pixel's color with the nearest cluster center.ExampleHere's an example of usingcluster_imagefunction:cluster_image('input_image.jpg',num_clusters=5,save_path='clustered_image.jpg')This would read the 'input_image.jpg', perform K-means clustering with 5 clusters, and save the resulting clustered image as 'clustered_image.jpg'.LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.Creditsnumpymatplotlibscikit-learnPillowAuthorAravind.M.S
Package: huekit
HueKitHuekit is a simple package which lets you style and color text. Unlike colorama and other python text color-izers, huekit also lets you style text, and has more color variety than colorama.How To UseThe following is a code block which will later be explained, showing how to use huekit:fromhuekitimporthuekitprint(huekit.color("red")+huekit.bgcolor("blue")+"This text is red (with a blue background),"+huekit.style("bold")+" And this text is bold!")from huekit import huekit: import the library.huekit.color("red")": this is huekit's color function. For a full list of the avaliable colors, please runhuekit.colors().huekit.bgcolor("blue"): this is huekit's background color function. For a full list of the avaliable background colors, please runhuekit.bgcolors().huekit.style("bold"): this is huekit's style function. For a full list of the avaliable styles, please runhuekit.styles().Noteshuekit.color("white")resets all effects, doesn't just change the color to white.You can concatenate styles, background colors and colors together.If you just want to fix the Windows (10) terminal ANSI support, runhuekit.fix_windows_please(). It is safe to run this multiple times and run this on other OSes (this won't do anything).WarningsThis has not been tested on Windows versions below Windows 10.When this module is imported,fix_windows_please()is automatically called.Be cautious of these factors. These are most probably not going to be fixed.
Package: huelights
huelightsA Python wrapper to interact with Philips Hue smart lightsInstallationInstall from PyPI:pip install huelightsExampleA small example for interacting with your Philips Bridge to manipulate Philips Hue smart lights:fromhuelights.bridgeimportBridgebridge=Bridge('username')lights=bridge.get_lights()forlightinlights:light.effect='colorloop'
Package: huemon
HuemonZabbix monitoring with low-level discovery for Philips Hue networks.RequirementsZabbix server 5.0+Zabbix agent 5.0+Python 3.8+ on Zabbix agent machineInstallationpip3installhuemonConfigurationCopyconfig.example.ymlfromsrc/huemonto/path/to/config.ymlMake necessary changesProvide the path through environment variableHUEMON_CONFIG_PATHPluginsCreate a command or discovery plugin by implementingHueCommandorDiscoveryrespectively and copy the file to the configured path inplugins.commands.pathorplugins.discoveries.pathof the configuration file.Zabbix agent configuration# file:/path/to/zabbix/agent/conf.d/hue.conf

UserParameter=hue.discovery[*],HUEMON_CONFIG_PATH=/path/to/config.yml python3 -m huemon discover $1
UserParameter=hue.value[*],HUEMON_CONFIG_PATH=/path/to/config.yml python3 -m huemon $1 $2 $3Or Docker# file:/path/to/zabbix/agent/conf.d/hue.conf

UserParameter=hue.discovery[*],docker-compose run huemon discover $1
UserParameter=hue.value[*],docker-compose run huemon $1 $2 $3Oragent mode# file:/path/to/zabbix/agent/conf.d/hue.conf

UserParameter=hue.discovery[*],curl http://127.0.0.1:8000/discover?q=$1
UserParameter=hue.value[*],curl http://127.0.0.1:8000/$1?q=$2\&q=$3Configure Systemd serviceAn installer that configures Huemon as a Systemd service is included in this repository. It uses/etc/huemon/config.ymlas the configuration path.assets/service-installer.shinstallUsageShellHUEMON_CONFIG_PATH=/path/to/config.ymlpython3-mhuemondiscoverlightsOragent modeHUEMON_CONFIG_PATH=/path/to/config.ymlpython3-mhuemonagentstartDockerProvide a configuration path for thehuemon-configvolume indocker-compose.ymlbefore running the commands below.docker-composerunhuemondiscoverlightsOragent modedocker-composeup-dScreenshotsDashboardsDiscoveriesTemplateContributingSee thecontributing guideto learn how to contribute to the  repository and the development workflow.Code of ConductContributor Code of Conduct. By participating in this project you agree to abide by its terms.LicenseMPL-2.0
Package: hueprint
HueprintSummaryHueprint is a simple package that allows the usage of colour and text effects in Python console applications.Data TypesThe package introduces two simple enums:EColourandEEffect.Functionscprint: allows usingEColourandEEffectfor easy text style customization.sprint: "success" style; green, no effect.eprint: "error" style; red, no effect.wprint: "warning" style; yellow, no effect.nprint: "notification" style; blue, no effect.iprint: a wrapper to thepprintfunction (from thepprintpackage).Examplecprintis the only function that differs fromprintin terms of number or arguments required, so this example will focus on that:fromhueprintimportcprintfromhueprint.typesimportEColour,EEffecttext="Hello, World!"colour=EColour.CYANeffect=EEffect.ITALICcprint(text,colour,effect)# This will print the specified text in cyan and italic.
Package: hue-py
hue_apiThis is a simple Python API client for Philips Hue lights.First time SetupTo use this api client for the first time, use:from hue_api import HueApi
api = HueApi()
api.create_new_user(bridge_ip_address)Where the bridge IP address is the addres on the local network of your Philips Hue bridge. For this to succeed, you must first press the link button on the bridge.The response will be saved to the module's install directory, and you can subsequently callapi.load_existing()to access that saved user and IP address the next time you instantiate aHueApiobject.Lights APIThis client provides functionality to control lights currently linked to the hue bridge. Callingapi.fetch_lights()populates an array ofHueLightobjects stored inapi.lights.You can then callapi.list_lights()to get a list of the lights available on the network.Seedocumentationfor details on what controls are available.
Package: hues
# Hues
This is the 90s and your terminal can display _16_ glorious colors. Your Python scripts deserve the some color love.Huesmakes printing to console in color easy. Just grab the package fromPIP, and your monochromatic days will be a thing of past!## QuickstartGo, grab the latest version from PIP. Run:`bash pip install hues `Then, in your scripts, do this:`python >>> import hues >>>hues.log('42')>>>hues.info('42')`### Configuration[TODO]_whoa!_All the colors, styles and backgrounds are available as object attributes. The chainable syntax is optimized deterministically using a push down automaton, so when you’re being particularly indecisive, you can:`python >>>print(hue('MONDAY!').bold.red.bg_green.underline.bright_yellow)`and there won’t be a single trace ofredin yourbright yellowmessage to mondays.Eachhuestring is self closing, so you can’t accidentally color your whole terminal yellow because you forgot theresetescape sequence.## ColorsAll 16 glorious ANSI colors are available for both background and foreground. Assorted text styles such as`bold`,italics`_ and <u>`underline`</u> are also available. Too many colors? Worry not fam, go to town with `resetattribute.## Todo
- [ ] Expand this readme.
- [ ] Add screenshots!
- [ ] Unicorns required.> Back in my days, we didn’t even have colors!
Package: hue-shift
Hue ShiftThis repository contains a Python function that generates random colors and displays them in compatible terminals using ANSI escape codes.InstallationNo external libraries are required. The function uses the built-incolorsysandrandomPython modules.pip install hue_shiftUsageImport:fromhue_shiftimportreturn_color,resetTo use the random color generator, simply call thereturn_color()function:print(f"{return_colour()}This is a random colour")To reset back to the terminal's default color:print(f"{reset()}Default color :) ")NoteNot all terminals support this wide color range!
Package: hue-snek-channel42
hue_snekA python Library for the Philips Hue APIAbouthue_snek is a python library for the Philips Hue API, that allows for easy API integration into other projects. The goal of this library is to provide the basic functions needed to interact with the Hue API, without unecessary functions.I will add more documentation and progress reports in the following days.Featuresconnect to bridgeget light information (name, state, modelname, etc.)set light parameters  (on/off, brightness, hue, etc.)get group information (name, on/off, colormode, etc.)set group parameters  (on/off, brightness, hue, etc.)get scene information (name, assigned group(s), etc.)set scene for group   (via scene name)get bridge information (name, mac, api-version, etc.)WIPDocumentationExampleBasic usage of this library:fromhue_snekimportHue,Light#setup bridgeh=Hue('your.ip.here','generic-username')#to check the connection to the bridge use:h.checkup()#returns 0 if connection and username OK#to get Light information use either the Light or Hue class#LightLight(1,h).name#(light id, bridge)Light(1,h).brightness#properties: name, brightness, hue, saturation, state#Hueh.get_light(2,'name')#parameters: see hue apih.get_lights('id')#modes: obj (default, id, name, modelidh.get_group(1,'name')#parameters: see hue apih.get_groups('name')#modes: all (default), name, type#to set lights or groups use either the Light or Hue Class#LightLight(2,h).set('bri','124')#Hueh.set_light(1,'on','true')h.set_group(1,'on','true')#scenes can be accessed and set like this:h.get_scenes('name')#modes: all (default), name, grouph.set_scene(1,'Chill')#(group id, scene name)info=h.get_bridge_info()forparam,valueininfo.items():print(param,value)NotesThis project was inspired by. Check it out :)
Package: hue-sunrise
Hue sunriseEnjoy waking up more gently by having yourphilips huelights simulate a sunrise.Installationpipinstallhue-sunriseUsageFirst register your Hue bridge interactivelyhue-sunriseregisterThen simply call it withhue-sunriserunAnd view the config usinghue-sunriseconfigshowIf you want to change the configuration usehue-sunriseconfigip# IP address of your Hue bridgehue-sunriseconfiglights# lights which should participatehue-sunriseconfigscene-length# how many minutes the sunrise should takehue-sunriseconfigafterglow# how many minutes to stay lit after the sunriseor, if you want to change where the configuration files are stored use the following environment variablesHS_CONFIG_PATH
HS_LOG_PATHAnd finally if anything failed an you need to manually switch of the lights usehue-sunriseshutdownThanksThe beautiful CLI is due totyper.
Package: hueText
This is an easy to use Python library which allows you to make your terminal outputs more colorful and therefore easier to read and understand.It currently only works with Python3The creator and maintainer is Engr. Mubashir Hussain (mubashir)GitHub:https://github.com/mubashir6u/hueTextPyPi:https://pypi.org/project/hueText/Contributing
If you've found a bug or a typo, feel free to open an Issue on GitHub. Already have a solution? Make a Pull request and I'll take a look at your changes. Please make sure a similar Issue/Pull request doesn't already exist.Installation
This library is hosted on pypi.org. You can install it with pip:pip install hueTextUsage
To use this library, you first have to import it:import hueText
To print colored text do the following:print(hueText.color("GREEN","green"))           # 'GREEN' will be green
print(hueText.color("Red","red"))               # 'Red' will be redYou can also use special 'pre-fixes':This library was published under the GNU General Public License. For more information take a look at the LICENSE file.
Package: huetui
huetuia tui for Philips HueAbouthuetuiis aterminaluserinterface that allows for easy control of your Philips Hue lights. It uses the officialHue-Bridge-APIto communicate with the lights andpy_cuifor the front-end.InstallationAURAnAUR packageis available for installation via an AUR helper:paru-SyyhuetuipipInstall huetui with:pipinstallhuetuiThis should fetch all the necessary dependencies. Nevertheless, make sure that all dependencies are installed.Launch huetui by typinghuetuiinto your terminal.Should you get the errorcommand not found: huetui, try restarting your terminal. Also, in case your upgrading from v1.0 to v2.0, please make sure to remove the old version before upgrading, as described below.Important notice for upgrading from v1.0 to v2.0Should you have a previous version of huetui installed,please remove it from your system before upgrading, either by runningpipuninstallhuetuior deleting the script manuallycd~&&rm.local/bin/huetuiDependenciesThese dependencies are needed for installing and running huetui.python3pipThe following dependencies are downloaded automatically when installing via pip. If you're cloning the repo, make sure to install them manually.py_cuicolorthiefpip-Uinstallpy-cuicolorthiefSetup processhuetuineeds to be provided thebridge's IPand an authorizedAPI user.Determine the bridge's IP, e.g. by opening your router's network tab and looking for a device with "Phillips-hue" as its hostname.Obtain an API user by following theofficial guide.Runhuetuiand input the information.Using huetuiThe status bar will show helpful information about navigation and keybindings.Navigationis done using the arrow keys. You'll see a cursor move to the bottom right of the modules.Selectingmodules or items is done by pressing ENTER. The selected option will highlighted.Light/group operations. Move to the desired light or group and:toggle on/off:ENTERdecrease brightness:jincrease brightness:kchange color:cToexit a modulepress ESC.Toquit the programsimply press q while in the main overview (i.e. not inside a module).Extra featuresToset wallpaper colorspresswwhile in the main overview.Configuring huetuiThe colors as well as other settings can be changed in huetui's config file~/.config/huetui/config.py. Here are all the available settings:# sample config. Edit to your liking.importpy_cui.colorsascolorsfromhuetui.backend.utilsimportConfigc=Config()c.ip="192.168.178.75"c.api_user="O4qAaBl9LaXonrNlAu0Pzei3ianWAJuUzYuZpC2I"c.tui_settings={"unicode":True,"wallpaper":"~/Path/To/Wallpaper.jpg","uicolors":{"main_ui":colors.WHITE_ON_BLACK,"selected":colors.CYAN_ON_BLACK,"border":colors.MAGENTA_ON_BLACK,"logo":colors.CYAN_ON_BLACK,"status_bar":colors.BLACK_ON_MAGENTA,"title_bar":colors.BLACK_ON_MAGENTA,},}
Package: huex
Huex - Control your Conbee II via CLI (Alpha Version!)What is Huex?Huex is a command line based tool to control the devices you have configured in your Conbee II.This tool utilizes theConbee II REST API.SetupInstallationInstall Huex using the following command:pip install huexAPI SetupWhen you execute a Huex command for the first time, it will fetch your Conbee II data from thediscover page.Example:huex showAfter this is done, Huex will prompt you to click ENTER once you've allowed authentication on your Conbee II dashboard.Click enter once you do so and Huex should automatically create your API key and save it.Once this is done, you can use Huex.FeaturesHuex is in alpha version, there will be many more features to come.Here are the current features:Show state of all lights:huex showTurn lights on/offhuex control [device_id] [action]
Package: huey
a lightweight alternative.huey is:a task queue (2019-04-01:version 2.0 released)written in python (2.7+, 3.4+)clean and simple APIredis, sqlite, file-system, or in-memory storageexample code.read the documentation.huey supports:multi-process, multi-thread or greenlet task execution modelsschedule tasks to execute at a given time, or after a given delayschedule recurring tasks, like a crontabautomatically retry tasks that failtask prioritizationtask result storagetask expirationtask lockingtask pipelines and chainsAt a glancefromhueyimportRedisHuey,crontabhuey=RedisHuey('my-app',host='redis.myapp.com')@huey.task()defadd_numbers(a,b):returna+b@huey.task(retries=2,retry_delay=60)defflaky_task(url):# This task might fail, in which case it will be retried up to 2 times# with a delay of 60s between retries.returnthis_might_fail(url)@huey.periodic_task(crontab(minute='0',hour='3'))defnightly_backup():sync_all_data()Calling atask-decorated function will enqueue the function call for
execution by the consumer. A special result handle is returned immediately,
which can be used to fetch the result once the task is finished:>>>fromdemoimportadd_numbers>>>res=add_numbers(1,2)>>>res<Result: task 6b6f36fc-da0d-4069-b46c-c0d4ccff1df6>>>>res()3Tasks can be scheduled to run in the future:>>>res=add_numbers.schedule((2,3),delay=10)# Will be run in ~10s.>>>res(blocking=True)# Will block until task finishes, in ~10s.5For much more, check out theguideor take a look at theexample code.Running the consumerRun the consumer with four worker processes:$huey_consumer.pymy_app.huey-kprocess-w4To run the consumer with a single worker thread (default):$huey_consumer.pymy_app.hueyIf your work-loads are mostly IO-bound, you can run the consumer with threads
or greenlets instead. Because greenlets are so lightweight, you can run quite a
few of them efficiently:$huey_consumer.pymy_app.huey-kgreenlet-w32StorageHuey’s design and feature-set were informed by the capabilities of theRedisdatabase. Redis is a fantastic fit for a
lightweight task queueing library like Huey: it’s self-contained, versatile,
and can be a multi-purpose solution for other web-application tasks like
caching, event publishing, analytics, rate-limiting, and more.Although Huey was designed with Redis in mind, the storage system implements a
simple API and many other tools could be used instead of Redis if that’s your
preference.Huey comes with builtin support for Redis, Sqlite and in-memory storage.DocumentationSee Huey documentation.Project pageSee source code and issue tracker on Github.Huey is named in honor of my cat:
Package: huey-django-orm
huey_django_ormA module to use Django ORM for storage withhueyThis project originally started because I wanted to just updatehuey-pg. That
proved to be more of a full rewrite than just an update.Anyway, I didn't want to use SqliteHuey, or FileHuey, since I already have a perfectly good data store in my Django
project.So, I took a copy of SqliteHuey, and re-implemented the class functionality using Django ORM.Huey doesn't do anything too crazy, so it should work with any database backend supported by Django. We also don't use
any non-standard Django stuff, so it should work with any modern Django version.InstallationInstall with pippipinstallhuey-django-ormsettings.pyAdd to INSTALLED_APPSINSTALLED_APPS=["...","huey_django_orm","...",]Configure Huey to use DjangoORMHueyfromhuey_django_orm.storageimportDjangoORMHueyHUEY=DjangoORMHuey()or if you need other optionsHUEY={"...":"...",'huey_class':'huey_django_orm.storage.DjangoORMHuey',"......":"...",}Run Migrationspythonmanage.pymigratehuey_django_ormThat's it!  Now you can use Huey just like you normally would.AdminSince this project is specific to Django, and will likely never be used without it, you get a few Django goodies rolled
right in.Each Model has a ModelAdminThere is an auto_now_add field in each model so we can see when an object was created within the adminOrdering is defined at the model level, so objects will appear in the admin in the same way they will be processed.
Package: huey-drf-api
A DRF API for HueyDocumentationThe full documentation is athttps://huey-drf-api.readthedocs.io. (Except it isn’t, not yet.)QuickstartInstall Huey DRF API:pip install huey-drf-apiAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'hueydrfapi',...)Add Huey DRF API’s URL patterns:urlpatterns=[...path('',include('hueydrfapi.urls',namespace='hueydrfapi')),...]FeaturesTODORunning TestsTODO: write testsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2019-04-03)First release on PyPI.
Package: huey-pg
=====================================huey-pg -- Postgres Broker for Huey=====================================huey_ is a simple task queue implementation for Python. huey-pg provides aPostgres-based implementation of a huey storage.**The project is not feature complete yet.**Features========- Super simple deployment.- Stores messages in a single table.- All data are wrapped in a dedicated schema.- Uses LISTEN/NOTIFY to keep worker sync. No polling.- Reliable thanks to Postgres MVCC.- Using plain psycopg2. No ORM.Installation============- Install huey-pg package from PyPI::pip install huey-pg- Apply ``huey-pg.sql`` file in your database::psql -f huey-pg.sql- Then use ``PostgresHuey`` class:import psycopg2.poolfrom huey_pg import PostgresHueypool = psycopg2.pool.ThreadedConnectionPool(0, 4, conninfo)huey = Postgres(connection_pool=pool))@huey.taskdef hello(name):print(f"Hello {name}!")Roadmap=======- Process missed notifies while resuming worker.- Functionnal tests.- Result storage.- Delayed & scheduled task... _huey:: https://huey.rtfd.io/
Package: huffman
Generate Huffman codebooks!Huffman codesare the optimal way to compress individual symbols into a binary sequence that can be unambiguously decoded without inter-symbol separators (it is “prefix-free”).Provided an iterable of 2-tuples in(symbol, weight)format, generate a Huffman codebook, returned as a dictionary in{symbol: code,...}format.>>> huffman.codebook([('A', 2), ('B', 4), ('C', 1), ('D', 1))
{'A': '10', 'B': '0', 'C': '110', 'D': '111'}If you have an iterable of symbols, thecollections.Counteris a handy way to tally them up.>>> huffman.codebook(collections.Counter('man the stand banana man').items())
{' ': '111',
 'a': '10',
 'b': '0100',
 'd': '0110',
 'e': '11010',
 'h': '0101',
 'm': '1100',
 'n': '00',
 's': '11011',
 't': '0111'}
Package: huffman-algorithm
huffman-algorithmHuffman algorithm is a python implementation of thehuffman algorithmit's an efficient encoding algorithm for text.✨ Key featuresCount lettersTree generationDictionary generationLetter frequency calculationString encodingString decodingTree visualisationIt works with python 3.12 or later🔧 InstallationIt should work on any python3 version after the 1.10 but it's always good to have the latest version since it will be the one I'm sure it works on :)⚙ Using PyPi$pipinstallhuffman-algorithm📚 Usage📕 Dictionary generationfromhuffmanimportHuffmandictionary=Huffman.generate_dictionary("Hello World")# How to see the dictionary ?print(dictionary)# Output: {'W': '000', 'd': '001', 'e': '010', 'r': '011', 'l': '10', 'o': '110', ' ': '1110', 'H': '1111'}🌳 Tree generationfromhuffmanimportHuffmantree=Huffman.generate_tree("Hello World")# How to see the tree ?print(tree)# Output: Node(character=None, frequency=11, children=[Node(character=None, frequency=4, children=[...]])🔢 Letter frequency calculationfromhuffmanimportHuffmanfrequencies=Huffman.get_letters_frequency("Hello World")# How to see the encoded string ?print(frequencies)# Output: {' ': 1, 'H': 1, 'W': 1, 'd': 1, 'e': 1, 'r': 1, 'o': 2, 'l': 3}⚙️ String encodingfromhuffmanimportHuffmanencoded=Huffman.encode("Hello World")# How to see the encoded string ?print(encoded)# Output: '11110101010110111000011001110001'⚙️ String decodingfromhuffmanimportHuffmanencoded=Huffman.encode("Hello World")dictionary=Huffman.generate_dictionary("Hello World")decoded=Huffman.decode(encoded,dictionary)# How to see the decoded string ?print(decoded)# Output: 'Hello World'🍕 ContributingAll contribution are welcomed so consider looking at the source code onGitHub🛡 LicenseThis project is licensed under theMIT License