Saravanan666/pypi-org huggingface dataset:
Package: python-hnvclient
Python client for the HNV (Hyper-V Network Virtualization) REST API.Free software: Apache licenseDocumentation:http://docs.openstack.org/developer/python-hnvclientSource:http://git.openstack.org/cgit/openstack/python-hnvclientBugs:http://bugs.launchpad.net/python-hnvclientFeaturesThe Python interface matches the underlying REST API and can be employed in 3rd party projects.>>>fromhnvclientimportclient>>>logical_networks=client.LogicalNetworks.get()>>>forlogical_networkinlogical_networks:...print(logical_network.resource_id)..."63606911-e053-42cf-842e-29f67c90d5c6""c4cd42ff-5efb-4006-ac56-479730557926""cd804db3-df59-4f57-8a7d-11cc3f3c4d98">>>logical_network=client.LogicalNetworks.get(resource_id="cd804db3-df59-4f57-8a7d-11cc3f3c4d98")>>>logical_network<hnvclient.client.LogicalNetworksobjectat0x7fcd79419910>>>>logical_network.provisioning_stateu'Succeeded'>>>logical_network.subnetworks[<hnvclient.client.LogicalSubnetworksobjectat0x7fcd79419150>]>>>logical_network.subnetworks[0].resource_idu'4390e3d8-c527-4534-882f-906c47ffd0bb'from__future__importprint_functionimportjsonimportsysfromhnvclientimportclientdefview_logical_networks():"""List all the available logical networks."""logical_networks=client.LogicalNetworks.get()print("Logical networks:")forlogical_networkinlogical_networks:print("\t- ",logical_network.resource_ref)print("\t\t","Logical subnetworks:")forlogical_subnetworkinlogical_network.subnetworks:print("\t\t-%s(%s)"%(logical_subnetwork.resource_id,logical_subnetwork.address_prefix))print("\t\t","Virtual networks:")forvirtual_networkinlogical_network.virtual_networks:print("\t\t-%s"%virtual_network.resource_ref)defcreate_virtual_network():"""Create a new virtual network on the first logical network."""print("Creating a new virtual network.")address_space=client.AddressSpace(address_prefixes=["192.168.133.0/24"])logical_network=client.Resource(resource_ref=client.LogicalNetworks.get()[0].resource_ref)virtual_network=client.VirtualNetworks(resource_id="hvn-test",address_space=address_space,logical_network=logical_network,)virtual_network.commit()print("The raw content of the new Virtual Network")print(json.dumps(virtual_network.dump(),indent=4))defremove_virtual_network():"""Remove the new virtual network."""print("Remove the new virtual network")client.VirtualNetworks.remove(resource_id="hvn-test")defmain():"""Logical networks sample entry point."""client.setup()view_logical_networks()create_virtual_network()view_logical_networks()remove_virtual_network()view_logical_networks()
Package: python-hologram-api
python-hologram-apiPython client forhttps://dashboard.hologram.io/api.Installationpip installpython-hologram-apiDocumentationPython API:https://python-hologram-api.readthedocs.io.HTTP API:https://hologram.io/docs/reference/cloud/http/UsageHologramClientis the main class you should use. Most of its methods are
sub-categorized based on the endpoint that the method interfaces with. For
example, user account management is underclient.user.To use python-hologram-api in a project:importosfrompython_hologram_api.clientimportHologramClientHOLOGRAM_API_KEY=os.environ.get('HOLOGRAM_API_KEY')client=HologramClient(HOLOGRAM_API_KEY)Example Usages:# List Devicesresp=client.devices.list()ifresp.get('success'):devices=resp.get('data')# Get a Devicedevice_id=1234resp=client.devices.get(device_id)ifresp.get('success'):device=resp.get('data')# Activate SIMssims=['99990000000012345678']plan=73tier=1resp=client.cell.activate_sims(sims,plan,tier)assertresp.get('success')isnotNoneThe following submodules are available:Device Managementclient.devicesclient.cellclient.tagsclient.data_plansHologram Cloudclient.csrclient.smsclient.cloudclient.spacebridgeAccount Managementclient.userclient.orgLicenseFree software: MIT licenseHistory0.1.6 (2017-10-27)Add coverage to travisAdd coveralls to travis and README0.1.5 (2017-10-27)Update README formatting/highlighting0.1.4 (2017-10-23)Addpython_hologram_api.rstto documentation0.1.3 (2017-10-23)Update documentation0.1.2 (2017-10-23)First release on PyPI.Implemented a Python wrapper forhttps://hologram.io/docs/reference/cloud/http/0.1.1 (2017-10-23)Travis Errors0.1.0 (2017-10-20)Mistakes were made.
Package: python-homeassistant-analytics
Python: Homeassistant analyticsAsynchronous Python client for Homeassistant analytics.AboutThis package allows you to fetch data from Homeassistant analytics.Installationpipinstallpython-homeassistant-analyticsChangelog & ReleasesThis repository keeps a change log usingGitHub's releasesfunctionality. The format of the log is based onKeep a Changelog.Releases are based onSemantic Versioning, and use the format
ofMAJOR.MINOR.PATCH. In a nutshell, the version will be incremented
based on the following:MAJOR: Incompatible or major changes.MINOR: Backwards-compatible new features and enhancements.PATCH: Backwards-compatible bugfixes and package updates.ContributingThis is an active open-source project. We are always open to people who want to
use the code or contribute to it.We've set up a separate document for ourcontribution guidelines.Thank you for being involved! :heart_eyes:Setting up development environmentThis Python project is fully managed using thePoetrydependency manager. But also relies on the use of NodeJS for certain checks during development.You need at least:Python 3.11+PoetryNodeJS 12+ (including NPM)To install all packages, including all development requirements:npminstall
poetryinstallAs this repository uses thepre-commitframework, all changes
are linted and tested with each commit. You can run all checks and tests
manually, using the following command:poetryrunpre-commitrun--all-filesTo run just the Python tests:poetryrunpytestAuthors & contributorsThe content is byJoost Lekkerkerker.For a full list of all authors and contributors,
checkthe contributor's page.LicenseMIT LicenseCopyright (c) 2024 Joost LekkerkerkerPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: python-homewizard-energy
HomeWizard Energy:python-homewizard-energyAsyncio package to communicate with HomeWizard Energy devices
This package is aimed at basic control of the device. Initial setup and configuration is assumed to done with the official HomeWizard Energy app.UsageInstantiate the HomeWizard class and access the API.For more details on the API see the API documentation for HomeWizard Energy onhttps://api-documentation.homewizard.comInstallationpython3-mpipinstallpython-homewizard-energyExampleimportasynciofromhomewizard_energyimportHomeWizardEnergyIP_ADDRESS="192.168.1.123"asyncdefmain():asyncwithHomeWizardEnergy(host=IP_ADDRESS)asapi:print(awaitapi.device())# Get device information, like firmware versionprint(awaitapi.data())# Get measurements, like power or water usageawaitapi.state_set(power_on=True)# Turn on the Energy Socket outletasyncio.run(main())Development and contributionPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.RequirementsPython 3.9 or higherPoetryInstallation and setuppoetryinstall
poetryshell
pre-commitinstallYou can now start developing. The pre-commit hooks will run automatically when you commit your changes. Please note that a failed pre-commit hook will prevent you from committing your changes. This is to make sure that the code is formatted correctly and that the tests pass.
Package: pythonhost
pythonhostis a toolbox for thehttps://pythonhost.ircommunity.Installpip3 install pythonhostUsageimport pythonhostimport pythonhost as phconnect to ftp server
ph.connect(USER='pythonho', PASS='@UNknown13#',PATH='')upload fileph.upload('manage.py')
# or
ph.upload('*')download fileph.download('manage.py')
# or
ph.download('*')View existing filesph.ls()print working directoryph.pwd()get Information from pythonhostph.authorph.websiteph.version
Package: python-hostsresolver
[![Build Status](https://travis-ci.org/internap/python-hostsresolver.svg?branch=master)](https://travis-ci.org/internap/python-hostsresolver)
[![PyPI version](https://badge.fury.io/py/python-hostsresolver.svg)](http://badge.fury.io/py/python-hostsresolver)Translate ephemeral virtual machines names into IP addresses for python
projects without requiring any modification to the libraries or any
external domain name server.BackgroundWhen performing integration testing using ephemeral virtual machines,
it is not always convenient to have a real domain name server to
resolve the IP address of each virtual machine, especially if multiple
instances of this test is to be ran simultaneously on the same host.In most of the cases, it is possible to use directly the IP addresses
of the virtual machines but in some other cases the domain name must
be used.  This is the case for Openstack Keystone where the catalog
contains the URL of the services.Supported setupThis project is specifically designed for python projects interacting
with Openstack virtual machines managed by Vagrant.  It is however
possible to make it resolve any name by providing the content of a
hosts file.Usage### Standard setup ###The IP addresses of Vagrant managed virtual machines will be mapped to
the name provided to Vagrant as if it was a hostname.vagrant ssh-configwill be used internally to fetch the IP address.>>> from hostsresolver import vagrant_source as resolver
>>> resolver.install('vagrant_project_folder/')### Using hostmanager plugin ###It is possible to specify the virtual machine used to download the
hostsfile.  If not provided, the first available virtual machine will
be used.  In this case, we will use/etc/hostsdownloaded fromdns.example.org.>>> from hostsresolver import vagrant_hostmanager_source as resolver
>>> resolver.install('vagrant_project_folder/', 'dns.example.org')### Using a custom hosts file ###To simply override some domain name addresses, a custom hosts file may
be loaded.>>> from hostsresolver import hostsfile_source as resolver
>>> resolver.install('my_project_folder/hosts')LicenceLicensed under the Apache License, Version 2.0ContributingFeel free to raise issues and send some pull request, we’ll be happy to
look at them!
Package: python-http-client
The default branch name for this repository has been changed to `main` as of 07/27/2020.Quickly and easily access any RESTful or RESTful-like API.If you are looking for the Twilio SendGrid API client library, please seethis repo.Table of ContentsInstallationQuick StartUsageHow to ContributeLocal Setup of the ProjectTroubleshootingAnnouncementsThanksAboutLicenseInstallationPrerequisitesPython version 2.7 or 3.4+Install Packagepipinstallpython_http_clientoreasy_installpython_http_clientAPI KeyStore your Twilio SendGrid API key in a.envfile.cp.env_sample.envEdit the.envfile and add your API key.Quick StartHere is a quick example:GET/your/api/{param}/callimportpython_http_clientglobal_headers={"Authorization":"Bearer XXXXXXX"}client=Client(host='base_url',request_headers=global_headers)client.your.api._(param).call.get()print(response.status_code)print(response.headers)print(response.body)POST/your/api/{param}/callwith headers, query parameters and a request body with versioning.importpython_http_clientglobal_headers={"Authorization":"Bearer XXXXXXX"}client=Client(host='base_url',request_headers=global_headers)query_params={"hello":0,"world":1}request_headers={"X-Test":"test"}data={"some":1,"awesome":2,"data":3}response=client.your.api._(param).call.post(request_body=data,query_params=query_params,request_headers=request_headers)print(response.status_code)print(response.headers)print(response.body)UsageExample CodeHow to ContributeWe encourage contribution to our projects, please see ourCONTRIBUTINGguide for details.Quick links:Feature RequestBug ReportsImprovements to the CodebaseReview Pull RequestsLocal Setup of the ProjectThe simplest local development workflow is by using docker.Install DockerRundocker-composebuild(this builds the container)Rundocker-composeup(this runs tests by default)TroubleshootingPlease see ourtroubleshooting guidefor any issues.AnnouncementsAll updates to this project is documented in ourCHANGELOG.ThanksWe were inspired by the work done onbirdyanduniversalclient.Aboutpython-http-clientis maintained and funded by Twilio SendGrid, Inc.
The names and logos forpython-http-clientare trademarks of Twilio SendGrid, Inc.LicenseThe MIT License (MIT)
Package: python-huawei-push-admin
HMS PushKit Python SeverdemoEnglish |中文Table of ContentsIntroductionInstallationConfigurationSupported EnvironmentsSample CodeLibrariesLicenseIntroductionPython sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs about quick access to HUAWEI Push Kit for your reference or usage.The following table describes packages of Python sample code.PackageDescriptionexamplesSample code packages. Each package can run independently.push_adminPackage where APIs of the HUAWEI Push Kit server are encapsulated.InstallationTo install pushkit-python-sample, you should extract the compressed ZIP file, execute the following command in the unzipped directory:python setup.py installSupported EnvironmentsFor pushkit-python-sample, We currently support Python 2.7/3.7 and JetBrains PyCharm are recommended.ConfigurationThe following table describes parameters of the initialize_app method.ParameterDescriptionappidApp ID, which is obtained from app information.appsecretSecret access key of an app, which is obtained from app information.token_serverURL for the Huawei OAuth 2.0 service to obtain a token, please refer toGenerating an App-Level Access Token.push_open_urlURL for accessing HUAWEI Push Kit, please refer toSending Messages.Sample CodePython sample code uses the Messaging structure in the push_admin package as the entry. Each method in the Messaging
structure calls an API of the HUAWEI Push Kit server.The following table describes methods in the Messaging structure.MethodDescriptionsend_messageSends a message to a device.subscribe_topicSubscribes to a topic.unsubscribe_topicUnsubscribes from a topic.list_topicsQueries the list of topics subscribed by a device.initialize_appInitializes the configuration parameters.Send an Android data message.
Code location: examples/send_data_message.pySend an Android notification message.
Code location: examples/send_notify_message.pySend a message by topic.
Code location: examples/send_topic_message.pySend a message by conditions.
Code location: examples/send_condition_message.pySend a message to a Huawei quick app.
Code location: examples/send_instance_app_message.pySend a message through the WebPush agent.
Code location: examples/send_webpush_message.pySend a message through the APNs agent.
Code location: examples/send_apns_message.pySend a test message.
Code location: examples/send_test_message.pyLibrariesLibrarySiterequestshttps://requests.readthedocs.io/en/master/sixhttps://six.readthedocs.io/Licensepushkit Python sample is licensed under theApache License, version 2.0.
Package: python-hue
Python client for the Philips Hue lighting system. I figured out almost all of
this by monitoring the traffic on my router. I then foundhttps://github.com/alistairg/IndigoHue/blob/master/Hue.indigoPlugin/Contents/Server%20Plugin/plugin.pywhich gave some clues about RGB support and the magic strings (select, lselect)
to send alerts.Sample Usage is not docs:from hue import Hue;
h = Hue(); # Initialize the class
h.station_ip = "192.168.1.222"  # Your base station IP
h.get_state(); # Authenticate, bootstrap your lighting system
l = h.lights.get('l3') # get bulb #3
l.bri(0) # Dimmest
l.bri(255) # Brightest
l.rgb(120, 120, 0) # [0-255 rgb values]
l.rgb("#9af703") # Hex string
l.on()
l.off()
l.toggle()
l.alert() # short alert
l.alert("lselect") # long alert
l.setState({"bri": 220, "alert": "select"}) # Complex sendHave fun! Let me know how you’re using it.
Package: python-hue-client
A full-featured Python client for the Philips Hue lighting system.InstallationInstallation using pip (recommended):pip install python-hue-clientInstallation using easy_install:easy_install python-hue-clientDocumentationDocumentation can be found athttp://python-hue-client.readthedocs.orgQuick StartThis library is modelled roughly on concepts borrowed from Django’s ORM.
There are someexamplesavailable in GitHub, but let’s dive in
with an example that list all the available lights:from pprint import pprint
from hueclient.api import hue_api
from hueclient.models.light import Light

if __name__ == '__main__':
    hue_api.authenticate_interactive(app_name='List Lights Example')

    for light in Light.objects.all():
        print(
            "Light {id} is named '{name}' and is {onoff} (brightness: {brightness})".format(
                id=light.id,
                name=light.name,
                onoff='on' if light.state.on else 'off',
                brightness=light.state.brightness,
            )
        )Here is an example which blinks a specific light:from time import sleep
from hueclient.api import hue_api
from hueclient.models.light import Light

# examples/blink_light.py
if __name__ == '__main__':
    # Make sure we are authenticated with the hue bridge.
    # You will be prompted if no username is found in ~/.python_hue
    hue_api.authenticate_interactive(app_name='Blink Light Example')

    # Get light ID 1
    light = Light.objects.get(id=1)

    # Loop forever
    while True:
        # Flip the on state from on -> off / off -> on
        light.state.on = not light.state.on

        # Save the state back to the bridge
        # (Note: required in order for your changes to take effect)

        light.state.save()

        # Pause here for a couple of seconds to create a slow blink
        # (Note: It is important to sleep here at least a little to
        # avoid overloading the bridge with API requests)
        sleep(2)For more information see thefull documentation.CreditsDeveloped byAdam Charnock, contributions very welcome!python-hue-client is packaged usingseed.
Package: python-hue-v2
Python Hue V2Python library to control the Philips Hue lighting system
forHue-V2API.FeaturesDesign for Hue API 2.0High Level ControlSimple Exampleimporttimefrompython_hue_v2importHue,BridgeFinderfinder=BridgeFinder()time.sleep(1)# wait for search# Get server by mdnshost_name=finder.get_bridge_server_lists()[0]# Here we use first Hue Bridge# or hue = Hue('ip address','app-key')hue=Hue(host_name,'hue app key')# create Hue instance# If you don't have hue-app-key, press the button and call bridge.connect() (this only needs to be run a single time)# hue = Hue(host_name)# app_key = hue.bridge.connect() # you can get app_key and storage on disklights=hue.lightsforlightinlights:print(light.on)light.on=Truelight.brightness=80.0ScenesYou can get scenes from hue bridge.frompython_hue_v2importHuehue=Hue('bridge-ip','app-key')scenes=hue.scenesforsceneinscenes:print(scene.id)print(scene.data_dict)Recall scene usingactive,dynamic_palette,static.scene=scenes[0]scene.recall(action='active')If you want create one scene with light actions in a room:frompython_hue_v2.sceneimportActionPost,ScenePostlight_id=[]lights=hue.lightsforlightinlights:light_id.append(light.light_id)actions=[]forridinlight_id:actions.append(ActionPost.create_by_parameters(target_rid=rid,target_rtype='light',on=True,brightness=50,color_xy=(0.1,0.3)# xy color tuple# mirek=200 % or use mirek))# Get all rooms, may be emptyrooms=hue.rooms# ScenePost should have a group property, here we bind with a room# refer to https://developers.meethue.com/develop/hue-api-v2/api-reference/#resource_scene_post# Group associated with this Scene. All services in the group are part of this scene.# If the group is changed the scene is update (e.g. light added/removed)scene_post:ScenePost=ScenePost.create_by_parameters(actions=actions,name='test',group_rid=rooms[0].id,group_rtype="room")hue.create_scene(scene_post)Also, you can delete scene by id.hue.delete_scene('scene-id-example')Grouped LightGet group Lights from hue.frompython_hue_v2importHuehue=Hue('bridge-ip','app-key')grouped_lights=hue.grouped_lightsforgroupingrouped_lights:print(group.type)group.on=TrueLow Level ControlAlso, you can use basic function in bridge class.importtimefrompython_hue_v2importHue# or hue = Hue('ip address','app-key')hue=Hue('host_name','hue app key')# create Hue instancebridge=hue.bridgebridge.get_lights()bridge.set_light('id',light_property_name='on',property_value={'on':True})bridge.get_zones()AttentionSome API may be de deprecated When major version updates.TODOZones Control Class
Package: python-huffman
✨ pyhuffman ✨The python binding forhuffman公开函数fromtypingimportIO,UnionfrompathlibimportPathInputType=Union[str,bytes,Path,IO]defencode_file(in_:InputType,out_:InputType)->int:...defdecode_file(in_:InputType,out_:InputType)->int:...defencode(data:bytes)->bytes:...defdecode(data:bytes)->bytes:...环境变量HFM_USE_CFFI强制使用cffi后端
Package: python-hush
hushA Python library that helps manage secrets using tools specified by plugin hooks.Badges 📛project status badges:version badges:tools / frameworks used by test suite (i.e. used bymake test):linters used to maintain code quality (i.e. used bymake lint):tools / frameworks used to render documentation (i.e used bymake build-docs):miscellaneous tools used to maintain this project:Installation 🗹To installpython-hushusingpip, run the following
commands in your terminal:python3-mpipinstall--userpython-hush# install hushIf you don't have pip installed, thisPython installation guidecan guide
you through the process.Useful Links 🔗API Reference: A developer's reference of the API exposed by this
project.cc-python: Thecookiecutterthat was used to generate this project.
Changes made to this cookiecutter are periodically synced with this project
usingcruft.CHANGELOG.md: We use this file to document all notable changes made to
this project.CONTRIBUTING.md: This document contains guidelines for developers
interested in contributing to this project.Create a New Issue: Create a new GitHub issue for this project.Documentation: This project's full documentation.Usage: How do I use Hush?Writing Plugins: How do I write my own plugins for Hush?
Package: python-hypertext-preprocessor
PyHP (Python Hypertext Preprocessor)PyHP is a Python script that can be used to write Python code in HTML, then execute it and render it to a page.Getting StartedInstallationTo use this project, install it using pip:pip install python-hypertext-preprocessorAlternatively, clone the repository and install the dependencies:git clone https://github.com/Benjymack/pyhp.git
cd pyhp
pip install -r requirements.txtRunning the example Flask serverTo run a simple Flask server with the pip installed version, use the following command:python -m pyhp server path/to/directoryIf you cloned from GitHub:python -m src.pyhp server examplesIn both cases, the server will be available athttp://localhost:5000/Running individual filesTo run an individual example file, use the following command:python -m pyhp file path/to/file.pyhp