Saravanan666/pypi-org huggingface dataset:
Package: pyhip-interface
PyHIP - Python Interface ofHIPandhip-on-nvIntroductionThis small python lib which hooks into HIP library and provides pythonic interface to it.There are two parts of it, hip library and hiprtc library.This also works withhip-on-nv.InstallationPrerequisitesBefore installing pyhip-interface, please make sure you have the following prerequisites installed:The Heterogeneous Interface for Portability -HIP Installation GuideInstall with pipPyHIP can be installed using pip, a package manager for Python. Run the following command in your terminal to install:pip install pyhip-interfaceInstall from sourceAlternatively, you can install PyHIP from the source code. First, clone the repository from GitHub:git clone https://github.com/jatinx/PyHIPThen, navigate to the repository directory and run the following command to install:python setup.py installExample Usageimportctypesfrompyhipimporthip,hiprtcsource="""extern "C" __global__ void set(int *a) {*a = 10;}"""prog=hiprtc.hiprtcCreateProgram(source,'set',[],[])device_properties=hip.hipGetDeviceProperties(0)print(f"Compiling kernel for{device_properties.gcnArchName}")ifhip.hipGetPlatformName()=='amd':# offload arch is amd onlyhiprtc.hiprtcCompileProgram(prog,[f'--offload-arch={device_properties.gcnArchName}'])else:hiprtc.hiprtcCompileProgram(prog,[])code=hiprtc.hiprtcGetCode(prog)module=hip.hipModuleLoadData(code)kernel=hip.hipModuleGetFunction(module,'set')ptr=hip.hipMalloc(4)classPackageStruct(ctypes.Structure):_fields_=[("a",ctypes.c_void_p)]struct=PackageStruct(ptr)hip.hipModuleLaunchKernel(kernel,1,1,1,1,1,1,0,0,struct)res=ctypes.c_int(0)hip.hipMemcpy_dtoh(ctypes.byref(res),ptr,4)print(res.value)TestingTesting is in it's infancy. I'll try to add more as and when I get some time. Any help here is appreciated :)How to run testsMake sure you havepytestpackage installed.From the project folder runpytest ./tests/* -v -r AHelp neededIf you are an opensource developer and want to contribute to this project, I can use your help in several places depending on your skillset.Adding more tests to the projectAdding API documentation and samplesImproving HIP API coverage - adding meaningful APIs instead of direct mapping.Common ProblemsUnable to load hip or hiprtc library - OSError: libamdhip64.so: cannot open shared object file: No such file or directory.Make sure that LD_LIBRARY_PATH has hip path on it (/opt/rocm/lib or a custom installation path)Getting error and need to debugSet AMD_LOG_LEVEL=7 for maximum verbosity of HIP APIs (this only works on amd platform).
Package: pyhipku
A tiny python library to encode IPv6 and IPv4 addressed as haiku. This a
python port ofhipku(javascript).Install$ pip install pyhipkuUsageEncode the IP address to haiku>>> from pyhipku import encode
>>> print(encode('127.0.0.1'))
The hungry white ape
aches in the ancient canyon.
Autumn colors crunch.Decode haiku to IP address>>> from pyhipku import decode
>>> decode('The hungry white ape\naches in the ancient canyon.\nAutumn colors crunch.\n')
'127.0.0.1'Run the tests$ pip install nose coveralls
$ nosetests -v --with-coverage --cover-package=pyhipkuAbout the websiteThe source code for the demo ishere.LicenseMIT
Package: pyhipp
PyHIPP - Modern Python toolkit for HPCPyHIPP is a computational toolkit, designed mainly for astronomical researches.
We pre-release this package, as our other projects depend extensively on it.The package is still under active update, subjecting to structural changes and
functional extensions. The docs are still empty, and testings do not cover the
full source tree, which we will continue to complete.To installpyhippand automatically handle the dependencies, use:pipinstallpyhippInteresting FeaturesExtended HDF5 IO. Suppose you have a nested catalog data, e.g.,halo_cat={'Header':{'n_subhalos':10,'n_halos':5,'version':'1.0.0','source':'ELUCID simulation','last_update':'2023-08-17',},'Subhalos':{'id':np.arange(10),'x':np.random.uniform(size=(10,3)),'v':np.random.uniform(size=(10,3)),},'Halos':{'id':np.arange(5),'x':np.random.uniform(size=(5,3)),'v':np.random.uniform(size=(5,3)),},}Dump it recursively into a HDF5 file:frompyhipp.ioimporth5h5.File.dump_to(path,halo_cat)Load back all or a subset:halo_cat=h5.File.load_from(path)halos=h5.File.load_from(path,'Halos')Of course, you can open the file, and load datasets separately:withh5.File(path)asf:dsets=f['Halos'].datasetsx=dsets.x# load via attributes (Thanks Zhaozhou Li for the idea)id,v=dsets['id','v']# load via getitemhalos=f['Halos'].load()# load all halos as a dict-like objectx=halos['x']Schedulers for Parallel Computation. A MPI-based job pool can be used like:frompyhipp.mpiimportComm,Poolpool=Pool(Comm.world())ifpool.is_leader:foriinrange(100):# distribute workspool.assign_work(i)pool.join()print(pool.pop_replies())# see gathered resultselse:forworkinpool.works():i=work.content# receive assigned datawork.reply=np.sin(i)# make responseCosmological Computation. For example, the comoving distance at given redshifts
in a given cosmology:frompyhipp.astro.cosmologyimportmodelcosm=model.predefined['tng']z=[0.,1.,2.,3.,4.]d=cosm.distances.comoving_at(z)# => [0., 2300.371, 3597.988, ...]More is coming ...
Package: pyhirtlib
# Py HaloInfiniteResearch LibThis package contains scripts, models, tags and other files relating to the research of Halo Infinite’s tags and files.# LegalHalo Infinite Â© Microsoft Corporation. Py HaloInfiniteResearch Core was created under Microsoft’s “Game Content Usage Rules” using assets from Halo Infinite, and it is not endorsed by or affiliated with Microsoft.# Index>># Support Ushttps://www.patreon.com/fromb1t0lifehttps://www.paypal.com/donate/?hosted_button_id=C969993N2G68UChange Log0.0.1 (24/09/2023)First Release
Package: pyhist
A Python utility to automagically update the package version from the git history and generate the ChangelogOverviewPyhist is a Python utility to automagically update the package version from the git history and generate the Changelog. Inspired by theConventional Commitsspecification, this tool inspects the commits history and calculates the new version.First stepsInit: initializes the pyhist from the current git history and creates a.pyhistbinary file and creates a
versioning commit with the initialization of the utility.pyhist--initUpdate: triggers the version update (minor and/or patch). The command inspects the changes applied to the git history from the previous version update and performs the following changes:Updates the version in thesetup.pyGenerates aChangelog.mdwith the content of the version updates (or appends the changes if previously created)Updates the .pyhistAdds a versioning commit with the changes (i.e.versioning: Set version to 1.3.7)pyhist--updateMajor: triggers the version update in the major version. This command performs the equivalent steps to the update command.pyhist--majorInstallationPyhist requiresPython 3.7or higher.From PyPIpipinstallpyhistFrom the source codegitclonehttps://github.com/jgoodman8/pyhist.gitcdpyhist
pipinstall-e.Testsgitclonehttps://github.com/jgoodman8/pyhist.gitcdpyhist
pipinstall-e.
pipinstall-e.[tests]pytestpyhist/testsCommits specificationThis project is inspired by theConventional Commitsspecification. Given this, we establish the following rules.Major update:Explicitly called using thepyhist --majorcommand.Minor update:featPatch update:fixdocstestchoreperfrefactorstyle
Package: pyhistogram
===========pyhistogram===========**This is an early release which is not yet battle-nnnhardened. Please file an issue over at github if you encounter problems**What is pyhistogram===================pyhistogram is a pure python package for easy handling of histogram data. It offers much more functionality than pythons build-in 'collections' feature.pyhistogram interface is heavily inspired by the excellent rootpy package which, however, depends on the gigantic particle physics ROOT framework - an dependency hardly justifiable for small projects. At the moment pyhistogram has no dependencies at all. Matplotlib is optional if one wants to use the built in plotting features. Than also means that this packages performance is nowhere near to that of the rootpy/ROOT solution, but should be sufficient for most use cases. In any case, it is quite possible that numpy might be added as an dependency in the future to use some of its features and to give this package a performance boost.Currently, pyhistogram only supports one dimensional histograms but is designed with higher dimensions in mind.Taking it for a spin:=====================The following shows some, but by far not all features. A proper documentation is on the todo list but for now I can recommend tacking a look at the unittests.Installing pyhistogram:-----------------------::pip install pyhistogramCreating  histograms:---------------------::from pyhistogram import Hist1D# 1D histogram with fixed-width binsh1d = Hist1D(5, -2, 4)# variable-width binsh1d = Hist1D([-10, -3.2, 5.2, 35.])Histograms can be filled in loops:----------------------------------::>>> import random>>> h = Hist1D(10, -4, 12)>>> for i in xrange(1000):>>>     h.fill(random.gauss(4, 3))And one can easily iterate through all the bins:------------------------------------------------::>>> h = Hist1D(4, 0, 4)>>> h.fill(1)>>> [b.value for b in h.bins()][1, 0, 0, 0]A weight can be associated to each value in a 2-tuple:------------------------------------------------------::>>> h = Hist1D(4, 0, 4)>>> h.fill((1, weight=0.5)>>> [b.value for b in h.bins()][0.5, 0, 0, 0]datetime support is also no-brainer:------------------------------------::from datetime import datetimh = Hist1D(4, datetime(2014, 1, 1, 12, 0), datetime(2014, 1, 1, 16, 0))h.fill(datetime(2014, 1, 1, 13, 0))And even word frequencies (based on regex) are all there for your convenience:-------------------------------------------------------------::>>> hist = Hist1D(['My', 'name', 'is', 'Bond'])>>> [hist.fill(s) for s in ['James', 'Bond']]>>> [(b.x.regex, b.value) for b in self.hist.bins()][('My', 0), ('name', 0), ('is', 0), ('Bond', 1)]If matplotlib is available, a histogram can also be plotted conveniently:-------------------------------------------------------------------------::from pyhistogram import Hist1Dimport numpy as npimport matplotlib.pyplot as plth = Hist1D(20, -5, 5)sample = np.random.normal(size=500)for v in sample:h.fill(v)h.plot()plt.show()Running the included unit tests (for (pyhistogram) developers):::$ nosetests pyhistogram
Package: pyhistorian
The goal ofpyhistorianis to write an internal Given-When-Then template using Python.
The ideas came from JBehave, RBehave, Cucumber and others.It’s possible to write your stories in English and Portuguese, choose your preferred.A good example of use[en-us,by default]follows (call this filecalculator.py):from should_dsl import *
from pyhistorian import *

class Calculator(object):
    def sum(self, n1, n2):
        return n1+n2


class SpecifyingMyNewCalculator(Story):
    """As a lazy mathematician
       I want to use a calculator
       So that I don't waste my time thinking"""
    colored = True
    template_color = 'yellow'
    scenarios = ['SumScenario'] # optional


class SumScenario(Scenario):
    @Given('I have a calculator')
    def set_my_calculator(self):
        self.calculator = Calculator()

    @When('I enter with 1 + 1')
    def sum_one_to_one(self):
        self.result = self.calculator.sum(1, 1)

    @Then('I have $value as result', 2)
    def get_result(self, value):
        self.result |should_be| value


if __name__ == '__main__':
    SpecifyingMyNewCalculator.run()Running:$ python calculator.py
Story: Specifying my new calculator
As a lazy mathematician
I want to use a calculator
So that I don't waste my time thinking

Scenario 1: Sum of 1 and 1
  Given I have a calculator   ... OK
  When I enter with 1 + 1   ... OK
  Then I have 2 as result   ... OK

Ran 1 scenarios with 0 failures, 0 errors and 0 pending stepspyhistorian is at github.comDue to DVCS I moved pyhistorian fromGoogle Godetogithub.com.You can get it athere:http://github.com/hugobr/pyhistorian
Package: pyhistory
App to maintain history file for your project.Free software: BSD licenseSource:https://github.com/beregond/pyhistoryPyPI:https://pypi.python.org/pypi/pyhistoryPyHistoryPyHistory maintains history entries in distributed work environment, which
allows many developers to add/remove history entries between releases without
conflicts.InstallationpipinstallpyhistoryFeatures(All commands can start either withpyhistoryor shortcut -pyhi.)Add history entry:$pyhiadd'New feature'$pyhiaddSomethingList history entries:$pyhilist*Newfeature*SomethingUpdate your history file with entries for given release:$catHISTORY.rstmyproject==========0.4.1(2015-08-04)++++++++++++++++++*AddedPyHistorytoproject.*Improvedcodebase.*Otherfeatures.$pyhiupdate0.4.2$catHISTORY.rstmyproject==========0.4.2(2015-08-05)++++++++++++++++++*Bugfixes*ChangeinAPI*Removedoldfeatures0.4.1(2015-08-04)++++++++++++++++++*AddedPyHistorytoproject*Improvedcodebase*OtherfeaturesDelete selected entries:$pyhidelete1.Newfeature2.Something3.Anotherone4.Wrongone(Deletebychoosingentriesnumbers.)$pyhidelete24$pyhilist*Newfeature*AnotheroneClear all history:$pyhiclearDoyoureallywanttoremoveallentries?[y/N]:yOr without prompt:$pyhiclear--yesConfig fileYou can adjust Pyhistory behaviour to your needs bysetup.cfgfile. Just
putpyhistorysection in there:[pyhistory]history_dir=some_dir# 'history' by defaulthistory_file=myhistory.rst# 'HISTORY.rst' by defaultat_line=42# by default history will be injected after first headlineHistory2.2.0 (2022-04-04)Added support for python 3.7, 3.8, 3.9 and 3.10.Removed support for python 2.7, 3.3, 3.4, 3.5, 3.6 and pypy.2.1 (2017-09-29)Fixed error for empty file.Unpinned hard requirements for package.Added support for py35 and py36.2.0 (2015-08-07)Added line splitting.Moved CLI interface to Click library.Added ‘–yes’ flag for clear command.Removed ‘squash’ subcommand.Added microseconds to generated files.0 as at-line option in no longer valid.1.3 (2014-10-17)Timestamps are now in miliseconds (again).Added load config from file.1.2.1 (2014-08-06)Improved format of generated hash (no miliseconds now).1.2 (2014-07-22)Added delete command.1.1 (2014-07-15)Added timestamp to generated files, so now entries are properly ordered.Pyhistory traverses directory tree to find proper place for history directory.1.0.3 (2014-06-23)Added squash command (alias to update).1.0.2 (2014-06-22)Further bug fixing of start detecting.1.0.1 (2014-06-20)Fixed error raised byclearwhen history dir is absent.Fixedupdate- command will now try to find file start.1.0 (2014-06-20)First release on PyPI.
Package: py-hive-iomete
py-hive-iomete is a collection of PythonDB-APIandSQLAlchemyinterfaces foriomete hive.UsageDB-APIfrompyhiveimporthiveconnection=hive.connect(host="<data_plane_host>",port=<data_plane_port>,scheme="http",# or "https"lakehouse="<lakehouse_cluster_name>",database="default",username="<username>",password="<password>")cursor=connection.cursor()cursor.execute("SELECT * FROM my_awesome_data LIMIT 10")print(cursor.fetchone())print(cursor.fetchall())DB-API (asynchronous)frompyhiveimporthivefromTCLIService.ttypesimportTOperationStateconnection=hive.connect(host="<data_plane_host>",port=<data_plane_port>,scheme="http",# or "https"lakehouse="<lakehouse_cluster_name>",database="default",username="<username>",password="<password>")cursor=connection.cursor()cursor.execute("SELECT * FROM my_awesome_data LIMIT 10",async_=True)status=cursor.poll().operationStatewhilestatusin(TOperationState.INITIALIZED_STATE,TOperationState.RUNNING_STATE):logs=cursor.fetch_logs()formessageinlogs:print(message)# If needed, an asynchronous query can be cancelled at any time with:# cursor.cancel()status=cursor.poll().operationStateprint(cursor.fetchall())SQLAlchemyFirst install this package to register it with SQLAlchemy (seesetup.py).fromsqlalchemy.engineimportcreate_enginefromsqlalchemy.ormimportsessionmakerfromsqlalchemy.schemaimport*# Possible dialects (hive and iomete are both operate identically):# hive+http# hive+https# iomete+http# iomete+httpsengine=create_engine('iomete+https://<username>:<password>@<data_plane_host>:<data_plane_port>/<database>?lakehouse=<lakehouse_cluster_name>')# Alternatively, "hive" driver could be used as well# engine = create_engine(#    'hive+https://<username>:<password>@<data_plane_host>:<data_plane_port>/<database>?lakehouse=<lakehouse_cluster_name>')session=sessionmaker(bind=engine)()records=session.query(Table('my_awesome_data',MetaData(bind=engine),autoload=True))\.limit(10)\.all()print(records)Note: query generation functionality is not exhaustive or fully tested, but there should be no
problem with raw SQL.RequirementsInstall usingpip install'py-hive-iomete'for the DB-API interfacepip install'py-hive-iomete[sqlalchemy]'for the SQLAlchemy interfacepy-hive-iomete works withPython 2.7 / Python 3ChangelogSeehttps://github.com/iomete/py-hive-iomete/releases.ContributingChanges must come with tests, with the exception of trivial things like fixing comments. See .travis.yml for the test environment setup.Notes on project scope:This project is intended to be a minimal iomete (hive) client that does that one thing and nothing else.
Features that can be implemented on top of py-hive-iomete, such integration with your favorite data analysis library, are likely out of scope.We prefer having a small number of generic features over a large number of specialized, inflexible features.Updating TCLIServiceThe TCLIService module is autogenerated using aTCLIService.thriftfile. To update it, thegenerate.pyfile can be used:python generate.py <TCLIServiceURL>. When left blank, the
version for Hive 2.3 will be downloaded.
Package: py-hiverunner
py-hiverunnerLibrary provides python API forKlarna's HiveRunner.InstallInstallpy-hiverunnerpackage withpip:$python-mpipinstallpy-hiverunnerUsageBefore usingpy-hiverunneryou need start JVM with facade service based on original Klarna'sHiveRunner-java-hiverunner.
This repo providesdocker container for Py4J Java Gateway for HiveRunner.You can pull this:$dockerpullla9ran9e/py-hiverunnerand then run the container:$dockerrun-ti-p25333:25333-p25334:25334la9ran9e/py-hiverunnerAfter that you will have working server with Java HiveRunner.Try this:frompy_hiverunnerimporthiverunnerfrompprintimportpprintwithhiverunner()ashive:hive.execute_query("create schema meh")hive.execute_query("create table meh.nonsub(a int, b string, c array<string>)")hive.execute_query("insert into meh.nonsub select 1, 'la9ran9e', array('1', 'a', 'b', '6')")hive.execute_query("insert into meh.nonsub select 2, 'la9ran9e', array('1', 'b', 'b', '6')")hive.execute_query("insert into meh.nonsub select 3, 'la9ran9e', array('1', 'c', 'b', '6')")hive.execute_query("insert into meh.nonsub select 4, '', array('1', 'd', 'b', '6')")hive.execute_query("create table meh.sub(a int, b string, c boolean)")hive.execute_query("insert into meh.sub select 1, 'la9ran9e', true")print("RESULT:")pprint(hive.execute_query("""select*frommeh.sub as subinner joinmeh.nonsub as nonsubonsub.b = nonsub.b"""))
Package: pyhjb
PyHJBallows python programs to accessJMSmessaging systems.  It does
this via aRESTversion of theJMSAPI provided byHJB, the HTTP JMS bridge.HJBprovides access to JMS resources viaHTTP.  It acts as an HTTP gateway
server foranyJMS 1.1 messaging provider, providingRESTfulequivalents
for most of the non-optional portions of the JMS API.PyHJBis a pure python package which, viaHJB, allows python programs to:send/receive messages fromanyEnterprise Messaging System that
supports theJMS1.1 API.  It is distributed with a few demo scripts
showing it being used with various different messaging providers:WebSphere MQ,Swift MQ,Active MQandJBoss Messaging.register JMSadministrable objectse.g, queues, topics and
connection factories.configure JMS runtime objects, e.g,connections,sessions,message
consumers,message producers,queue browsersanddurable
subscribersetc.Importantly, python programs written using PyHJB are portable acrossJMS
messaging providers.  The programs use theJMSAPI viaHTTP, rather than a
vendor’s custom messaging API, thus combining two great maintainability
traits:the use of the JMS APIbeing written in python!
Package: py-hJson
hJsonA package for handling json filesExample :importhJsondata=hJson.load('example.json')print(data)print()data['test']=100data=hJson.save('example.json',data)print(data)print()check=hJson.check('example.json')print(check)Output :{
    'test' : 0
}

{
    'test' : 100
}

True
Package: pyhkc
HKC Alarm API Python WrapperPython module for interacting with HKC's Alarm API, allowing for easy interactions with the alarm system.Note: This uses a private API, which means it is subject to change without notice and can break at any time. Always be cautious and respectful when using private APIs. To mimic the behavior of the app and reduce the chance of being rate-limited or blocked, it is recommended to limit requests to the API to one every 5-10 seconds, especially when fetching logs or inputs, similar to HKC's new v2 App.FeaturesRetrieve system status.Fetch all inputs.View recent logs.Arm and disarm the alarm in various modes.InstallationClone this repository:git clone https://github.com/jasonmadigan/pyhkcNavigate to the repository's directory:cd pyhkcInstall the required packages:pip install -r requirements.txtDependenciesrequests==2.31.0tabulate==0.9.0Example Usagefromhkc_alarmimportHKCAlarm# Initialize the system with your credentials.panel_id=[your-panel-id]# replace with your panel IDpanel_password="[your-panel-password]"# replace with your panel passworduser_code=[your-user-code]# replace with your user codealarm_system=HKCAlarm(panel_id,panel_password,user_code)# Retrieve system status.status=alarm_system.get_system_status()print("System Status:",status)# Fetch all inputs.inputs=alarm_system.get_all_inputs()print("All Inputs:",inputs)# View recent logs.logs=alarm_system.fetch_logs()print("Recent Logs:",logs)# Arm the system.# alarm_system.arm_fullset()# Disarm the system.# alarm_system.disarm()Publishingpython3setup.pysdistbdist_wheel
twineuploaddist/*
Package: pyhkconnect
pyhkconnect香港交易所 沪港通 深港通 数据接口Demo>>>importpyhkconnectashkc>>>dp=hkc.northbound_shareholding_sh()# dataframe from pandas>>>dpcodenameshareholdingshareholding_percent090000SHANGHAIPUDONGDEVELOPMENTBANKCO.,LTD.(A...379,430,1351.35%190004GUANGZHOUBAIYUNINTERNATIONALAIRPORTCO.,LTD...282,353,85613.64%290006DONGFENGAUTOMOBILECO.,LTD(A#600006)      7,461,913                0.37%390007CHINAWORLDTRADECENTERCOMPANYLTD.(A#600007)     13,202,103                1.31%490008BEIJINGCAPITALCO.,LTD(A#600008)     63,689,287                1.32%590009SHANGHAIINTERNATIONALAIRPORTCO.,LTD.(A#6...    316,733,029               28.96%690010INNERMONGOLIABAOTOUSTEELUNIONCO.,LTD.(A...215,362,2950.67%790011HUANENGPOWERINTERNATIONAL,INC.(A#600011)     42,917,773                0.40%890012ANHUIEXPRESSWAYCOMPANYLIMITED(A#600012)      6,149,168                0.52%990015HUAXIABANKCO.,LIMITED(A#600015)     83,923,960                0.65%1090016CHINAMINSHENGBANKINGCORP.,LTD.(A#600016)    594,264,189                1.67%..............84093979JCHXMININGMANAGEMENTCO.,LTD.(A#603979)        191,590                0.03%84193986GIGADEVICESEMICONDUCTOR(BEIJING)INC(A#603986)        358,240                0.17%84293989HUNANAIHUAGROUPC0.,LTD.(A#603989)      5,537,526                1.41%84393993CHINAMOLYBDENUMCO.,LTD.(A#603993)    133,230,718                0.75%84493997NINGBOJIFENGAUTOPARTSCO.,LTD(A#603997)        100,463                0.01%[845rowsx4columns]>>>>>>json_obj=dp.to_json(orient='index')# return json data
Package: pyhli
Complete access from Python to the FIS MarketMap C-Toolkit (FAME C-HLI). FAME is a fully integrated software and database management system from FIS that provides the following capabilities: Time series and cross-sectional data management; Financial calculation, data analysis, econometrics, and forecasting; Table generation and detailed multicolor, presentation-quality report writing; Multicolor, presentation-quality graphics; What-if analysis; Application development and structured programming; Data transfer to and from other applications; Tools for building customized graphical user interfaces.