Saravanan666/pypi-org huggingface dataset:
Package: pyamber
pyamberSome utility code for interacting with amberdata. For more information on amberdata please check outhttps://amberdata.io/.Installing pyamberInstall with pippip install pyamberAmberRequestAmberRequest is a class hiding the management of your key, the pagination of requests and conversion of your results to standard pandas containers.from pyamber.request import AmberRequest, TimeInterval

if __name__ == '__main__':
    request = AmberRequest(key="...")
    f = request.prices.history(pair="eth_usd", time_interval=TimeInterval.HOURS)
    print(f)Settings.cfgWe recommend to define a configuration file(*.cfg)containingAMBERDATA = {'x-api-key': 'ENTER YOUR KEY HERE'}Flask-AmberDataA Flask extension that provides integration with AmberData. In particular this flask extension provides
management of the your AmberRequests. You can use configuration files such as settings.cfg to follow standard flask practices.
The configuration is easy, just fetch the extension:import pandas as pd
from flask import Flask

from pyamber.flask_amberdata import amberdata
from pyamber.request import TimeInterval

if __name__ == '__main__':
    app = Flask(__name__)
    app.config.from_pyfile('/amberdata/config/settings.cfg')
    amberdata.init_app(app)

    with app.app_context():
        assert amberdata.request.health
        x = amberdata.request.prices.history("eth_usd", time_interval=TimeInterval.DAYS, start_date=pd.Timestamp("2020-01-12"), end_date=pd.Timestamp("2020-01-16"))
        print(x)
Package: pyAmberElectric
AmberElectricMake it easier to use Amber's newer API that uses AWS Cognito for authentication.Specify your login creds, and optionally how long to leave between refeshing the data in seconds. The default is equal to 5 minutes.You can get the entire response from Amber with the json property, or cut out the middleman and get specific values like currentPrice. Data is stored locally so feel free to grab the properties without hammering Amber's servers or being stuck with stale data.How-tofrompyAmberElectricimportpyAmberElectricAmber=pyAmberElectric(username='yourEmail',password='yourPassword',updateInterval=600)#array of your meter pricesAmber.currentPrice#the complete raw json dataAmber.jsonprint("Prices are currently ",Amber.currentValue)The DeetsRenewing auth and dataThe authentication token will be automatically renewed when needed, normally lasting an hour. You can call auth() to manually renew if required.If needed, all known data is requested at once. When the local data is older than the maxAge, the data is refreshed. You can also call update() to manually request new data. Amber's data doesn't change more often than every 5 minutes at most so no need to hammer it.Avaliable PropsjsonReturns the full json object returned by Amber. Contains all info avaliable in the app/website.currentPriceReturns an array of your current prices in cents.currentRenewableReturns an array of the current percentage of renewables in the grid.currentValueReturns an array of the current qualative value of the price. Can be 'BAD', 'NEUTRAL' or 'GOOD'.periodCostReturns the total cost for the last 30 days in cents.periodUsageReturns the total usage for the last 30 days in Kwh.periodRenewableReturns the average percentage of renewables in the grid for the last 30 days.Secret MethodsYou shouldn't need to call these methods but they are there if you really want/need them.auth()Renew the authentication token.update()Refresh the data from Amber.
Package: pyamdgpuinfo
pyamdgpuinfoAMD GPU informationInstallpip install pyamdgpuinfoOnly Linux is supported, using the AMDGPU driver.The library is written using Cython, meaning that Cython and and a C compiler are needed to build and install from source. Additionally, libdrm development headers are required.Precompiled wheels for Python 3.8-3.12 are the default method of install. This means that you don't need Cython or any other dependencies to install it normally.UsageExample:>>>importpyamdgpuinfo>>>n_devices=pyamdgpuinfo.detect_gpus()1# we have 1 device present, so it'll be at index 0>>>first_gpu=pyamdgpuinfo.get_gpu(0)# returns a GPUInfo object>>>vram_usage=first_gpu.query_vram_usage()>>>print(vram_usage)3954978816# number of bytes in useAll documentation is in the docstrings of each function/class.Available functions are (see docstrings for more info):detect_gpus - Returns the number of GPUs availableget_gpu - Returns a GPUInfo object for the device index specifiedGPUInfo methods (see docstring for class overview)start_utilisation_polling - Starts polling GPU registers for utilisation statisticsstop_utilisation_polling - Stops the utilisation polling threadquery_utilisation - Queries utilisation of different GPU partsquery_max_clocks - Queries max GPU clocksquery_sclk - Queries shader (core) clockquery_mclk - Queries memory clockquery_vram_usage - Queries VRAM usagequery_gtt_usage - Queries GTT usagequery_temperature - Queries temperaturequery_load - Queries GPU loadquery_power - Queries power consumptionquery_northbridge_voltage - Queries northbridge voltagequery_graphics_voltage - Queries graphics voltageVRAM and GTT sizes are available as an attribute of GPUInfo.MentionsParts of this package were inspired byradeontop.LicenseGPLV3
Package: pyamiibo
PyAmiiboPyAmiibo helps to read, modify and write dump files ofNintendo Amiibo figures. PyAmiibo is capable of parsing most NTAG properties, as well as some Amiibo data.IMPORTANT: To decrypt and encrypt Amiibo data, you will need two master keys, commonly calledunfixed-info.binandlocked-secret.bin. They are not provided.You can also view thefull PyAmiibo docs on ReadTheDocs.It is based onMarcos Del Sol Vives’reverse engineering efforts of the Amiibo cryptography (amiitool,reddit).So why does PyAmiibo exist?amiitoolis a C binary, difficult to use in other tools (especially web-based tools). It also re-arranges the sections of the dump file when decrypting, and doesn’t seem to support editing dumps (e.g. changing the UID). Even though PyAmiibo doesn’t use any ofamiitool’s code and contains a lot of my own research into the NTAG format and Amiibo data, it would not have been possible without Marcos’ efforts.UsagePyAmiibo is Python 3 only, if you get an error installing it this is the most likely reason.pipinstallpyamiiboPyAmiibo is mainly a library, but also contains some simple command-line tools:$# convert hexadecimal data to binary, note the quotes!$amiibohex2bin"F1 A3 65 .."unfixed-info.bin$# get help for a subcommand$amiibouid--help$# update the UID on an existing dump$amiibouidold.bin"04 FF FF FF FF FF FF"new.binThe master keys must be in the current directory for some commands to work!It’s also very easy to use in a script or interpreter session:fromamiiboimportAmiiboDump,AmiiboMasterKeywithopen('unfixed-info.bin','rb')asfp_d,\open('locked-secret.bin','rb')asfp_t:master_keys=AmiiboMasterKey.from_separate_bin(fp_d.read(),fp_t.read())withopen('dump.bin','rb')asfp:dump=AmiiboDump(master_keys,fp.read())print('old',dump.uid_hex)dump.unlock()dump.uid_hex='04 FF FF FF FF FF FF'dump.lock()dump.unset_lock_bytes()print('new',dump.uid_hex)withopen('new.bin','wb')asfp:fp.write(dump.data)DevelopmentUsepipenvto install the development dependencies, and make sureflake8andpylintpass before a PR is submitted.pipenvinstall--three--devpipenvshellisort-yflake8amiibo/pylintamiibo/sphinx-build-bhtmldocs/docs/_build
Package: pyamiimage
pyamiimagepyamiimageis a set of tools to extract semantic information from scientific diagrams.The current goal is to extract terpene synthase pathway diagrams.
'Extraction' means that we will go from pixel values in an image to a 'smart diagram'. The output ofpyamiimageis an image with annotations of substrate, products and enzymes.We are working to add more support for open formats that encode chemical/pathway information such asCMLandGPML.InstallationTesseractTo runpyamiimageon your local system you need to haveTesseractinstalled. If you don't haveTesseractinstalled, install it fromhere.pip install pyamiimageUsagepyamiimageis a command-line tool and can be accessed via the terminal or command prompt. To bring up the help run:pyamiimage --helpYou can also include pyamiimage in your program using the provided classes.AmiImageAmiImage class provides methods for image manipulation.from pyamiimage.ami_image import AmiImage

gray = AmiImage.create_grayscale_from_file(image_file_path)AmiGraphAmiGraph class generate a graph from arrows in a diagram.AmiOCRAmiOCR class provides methods to extract words from the iamge. Uses Tesseract.Timelinemerged main into nodes_and_pixels and re-branched
Package: pyamis
PyAmis1. InstallationInstall with pippip install pyamis2. Examplesfrom__future__importprint_functionfrompyamisimportmodtable=mod.Table(title='AmisTable')table.set_title('A Amis Table Example')table.add_column('text','measurement','${mea}')table.add_column('text','avg value','${avg_value}')table.add_column('text','90% value','${percent_90}')table.add_column('text','99% value','${percent_99}')table.add_column('text','99.9% value','${percent_999}')rows_dict={'mea':'mb/s','avg_value':11,'percent_90':11.5,'percent_99':11.54,'percent_999':11.55,}table.set_rows([rows_dict])# call xx.render() will get the json data that amis needs# print(table.render())
Package: py-amis
pyamis目的: 在python中生成amis的json配置解决问题:手写json配置太累了,配置复制粘贴重用性不好,减少手写json拼写出错概率可以在python中通过代码快速生成json配置要能和python的dict混用installgit clone https://github.com/1178615156/pyamis
pip install --editable .示例生成Form组件# 首先import下frompyamis.componentsimport*form=Form(target='target',mode="horizontal",# 可以看到属性能够直接插入dictcontrols=[{"type":"submit","label":"登录"}])这样就生成了个Form配置了,然后转成json看看importjsonjson.dumps(form)转成json{"type":"form","mode":"horizontal","controls":[{"type":"submit","label":"\u767b\u5f55"}],"target":"target"}和dict进一步结合示例form_default_options=dict(title='条件',mode='horizontal',horizontal={"leftFixed":"sm"},submitOnInit=False,autoFocus=False,)form=Form(**form_default_options,#可以直接插入dicttarget='target')# 直接设置属性也可以form['controls']=[{"type":"submit","label":"提交"}]目前有的组件有:PageChartCrudAction如果想用的组件不在上面的话可以直接写dict快速启动示例fromflaskimportFlask,send_filefrompyamis.componentsimport*importjsonapp=Flask("pyamis-test")# app-pages配置defsite():return[# 第一个pageAppPage(label='page-1',url='1',# 第一个page有2个子页children=[# 子页1AppPage(label="page-1-1",url='page-1-1',schema_body=[Form(controls=[{'type':'text','name':"email",'label':"email","required":True},]),"hello world 1 - 1"]),# 子页2AppPage(label="page-1-2",url='page-1-2',# schema_body=[...] 等价于schema=Page(body=['hello page 1 - 2 ']),),]),# 第二个pageAppPage(label='page-2',url='2',#如果想用的组件没有的话,可以直接写jsonschema_body=[{"type":"service","api":"https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/page/initData","body":{"type":"panel","title":"$title","body":"现在是：${date}"}}],)]# print下生成的json配置print(json.dumps(site(),indent=2))@app.route('/')defroot():returnsend_file('test_index.html')# 分页的json@app.route("/pages/site.json")defsite_json():return{'data':{'pages':[dict(label='Home',url='/'),dict(children=site())]}}if__name__=='__main__':app.run(port=8080,debug=True)
Package: pyaml-object
Simplify how you read configuration files using PyYAMLInstallationThe library is available on PyPI and can be installed using pip:pipinstallpyaml-objectUsageHaving aservice.yamlfile such:service:version:1.0.0name:myservicesecret_key:XXXXXXWe can read the config file through the Config API by applying the read method.frompyyaml_objectimportConfigconf_manager=Config('service.yaml')conf=conf_manager.read()Now we have aconfobject that embedes every key and value from our yaml file. For instance, we can reconstitute a constantSETTINGvariable such:SETTINGS={'VERSION':conf.service.version,'NAME':conf.service.name,'SECRET_KEY':conf.service.secret_key}print(SETTINGS)#{'VERSION': '1.0.0', 'NAME': 'myservice', 'SECRET_KEY': 'XXXXXX'}
Package: pyamlside2
PyamlSide2（ぴゃむるさいどつー）Zenn「最もシンプルなGUI設計パッケージPyamlQtについて」PySide2 configuration in yaml format providing the most simple script.RequirementsyamlPySide2Installationcd<path-to-ReadableWidgets>/PyamlSide2
pipinstall.Demopython3examples/chaos.pyTutorial1. create drawio-xmlOpendraw.io.Put theRounded Rectangleand add text.+----------------------+| widget:unique-label  |+----------------------+widget : widget namepushbutton, label, ...unique-label : Unique label (also treated as a Key in Python).Don't use compression flag. (Please uncheck.)2. 🏁 drawio-xml -> YAML & Python (simple conversion)rw_gen_xml2all-i<input.xml>-o<outputdirectory>2-1. Generate YAML file from drawio-xmlAlthough it is possible to convert directly from drawio-xml, conversion to YAML is recommended for readability.rw_gen_xml2yaml-i<input.xml>-o<output.yaml>2-2. Generate Python file from YAMLCreate a sample Python program from a YAML file.rw_gen_yaml2py-i<input.yaml>-o<output.py>3. Run example python templatepython3<output.py(3rdstep)><input.yaml(3rdstep)>TemplatePreviously (v0.3.2)Seeexamples/simple_gui.py.importsysimportosfrompyamlside2.mainwindowimportPyamlSide2WindowfromPySide2.QtWidgetsimportQApplicationclassMainWindow(pyamlside2Window):def__init__(self):self.number=0yaml_path=os.path.join(os.path.dirname(__file__),"../yaml/chaos.yaml")super().__init__(yaml_path)# your code -------------------------# ************ ## -----------------------------------self.show()if__name__=='__main__':app=QApplication(sys.argv)window=MainWindow()sys.exit(app.exec_())Test YAML 📝pyamlside2_yamlis preview feature app.pyamlside2_yaml<yaml-file-pathordraw.ioxml-file># pyamlside2_yaml PySide2/drawio_xml/example.xmlElements (dev)In yaml, you can add the following elements defined in PyQt.Widgets This may be added in the future.pushbutton : definition of QPushButtonqlabel : definition of QLabelqlcdnumber : definition of QLCDNumberqprogressbar : definition of QProgressBarqlineedit : definition of QLineEditqcheckbox : definition of QCheckboxqslider : definition of QSliderqspinbox : definition of QSpinBoxqcombobox : definition of QComboboximage : definition of QLabel (using image path)stylesheet : definition of Stylesheet (define as QLabel andsetHidden=True)YAML formatPyamlQt defines common elements for simplicity. Not all values need to be defined, but if not set, default values will be appliedWINDOW:# unique key (Define key)type:windowx:0y:0width:800height:720title:"example"slider2:# keynametype:qslider# QWidgetsx_center:500# x center pointy_center:550# y center pointrect:width:200# QWidgets widthheight:50# QWidgets heightmax:100# QObject max valuemin:0# QObject min valuedefault:70# QObject set default valuetext:"Slider"# Set Textstyle:# Setting style using stylesheet (css)font:30px# font sizecolor:#ff0000 # Colorfont-family:Ubuntu# font-familyitems:# Selectable items( Combobox's option )-a-b-c
Package: pyamo
pyamo - addons.mozilla.org for pythonThese tools provide some classes and a command line tool to access addons.mozilla.org. This site
doesn't have a services API, therefore these tools use website scraping to determine the right
information and use the same endpoints as they would be used in the browser.The command line tool is installed under the nameamoand has the following commands available:info          Show basic information about an add-on
list          List add-ons in the given queue
get           Download one or more versions of an add-on, including sources
run           Run an add-on in Firefox (preferably in a VM)
decide        Make a review decision for an add-on, along with message
logs          Show the review logs

upload        Upload an add-on to addons.mozilla.org

adminget      Show admin manage information about an add-on
adminchange   Change the status of an add-ons and its files using the admin manage page
admindisable  Admin disable one or more add-ons, optionally with a rejection messageConfigurationThe amo utility supports setting some configuration values. The file needs to be placed in~/.amorcon Unix, or%HOME%/amorc.jsonon Windows.Thedefaultssection allows to configure defaults for optional arguments. Here are some
examples:{"pyamo":{"defaults":{"out":"--outdir ~/path/to/amofolder --binary ~/path/to/run_in_vm.py","run":"--outdir ~/path/to/amofolder --binary ~/path/to/run_in_vm.py","logs":"-k reviewer","decide":"-f"}}}It is highly recommended to set a the--outdirargument as default, to make
sure all add-ons end up in the same folder.Theauthsection allows to specify an authentication key for redash, which is only necessary for
admin commands.{"auth":{"redash_key":"42c85d86fd212538f4394f47c80fa62c"}}To set default global arguments (e.g.timeout,cookies,profile), use theglobalkey in pyamo defaults.
For example, you may want to always use a Firefox profile for authentictaion:{"pyamo":{"defaults":{"global":"-P 78bfnff3.default"}}}Examplesamo uploadUpload one or more xpi packages. Typical usage is specifying the add-on id, together with one or
more occurrences of the -x parameter for each platform. Example:amo upload lightning \
    -x linux lightning-linux.xpi \
    -x mac lightning-mac.xpi \
    -x win lightning-win32amo getDownloads one or more versions to the hard drive for review. Will download both the xpi and the
sources and once done extract each package. The files will be saved in a sub-directory named after
the addon id in the current (or specified) directory.When specifying version numbers you can also use the taglatestto retrieve the latest version and
theprevioustag to get the last accepted version. This is useful when specifying multiple
versions to download.A commonly used option is the diff option-d, which automatically gets the latest and previous
versions. This is useful to compare versions.Example:amo get -d lightning
Package: py_amoeba
OverviewThis is a python module for calculating global (Moran’s I [1]) and local spatial autocorrelation [1.5] using the AMOEBA algorithm [2]. This code works on shapefiles, although a base class is provided to allow the examination of other objects, e.g. from a spatial database.UsageThe easiest way is to callautocorrelate.pywith the name and path of the shapefile, e.g.:python autocorrelate.py path/to/file/filename.shpTo use in other python programs:from lcia_autocorrelation.ac_shapefile import AutocorrelationShapefile
ac = AutocorrelationShapefile("filepath")
ac.global_autocorrelation()Autocorrelation calculations are made using the PySAL library; multiple measures of autocorrelation are possible.Local Indicators of Spatial Autocorrelation (LISA)Moran’s Iis a single statistic for global autocorrelation. However, the calculation of Moran’s I involves summing the individual cross products of each spatial unit. Local indicators of spatial association (LISA) (Anselin, L. (1995). “Local indicators of spatial association – LISA”. Geographical Analysis, 27, 93-115) uses these local indicators directly, to calculate a local measure of clustering or autocorrelation. The LISA statistic is:\begin{equation*}
I_{i} = \frac{Z_{i}}{}\sum_{j}W_{ij}Z_{j}
\end{equation*}\begin{equation*}
I = \sum_{i}\frac{I_{i}}{N}
\end{equation*}WhereIis the autocorrelation statistic,Zis the deviation of the variable of interest from the average, andWis the spatial weight linkingitoj.We use thePySAL libraryto calculateLISA statistics.InstallationUsing pip:pip install lcia-autocorrelationUsing easy_install:easy_install lcia-autocorrelationRequirementsThe following packages are requirednumpyscipypysalrtreeosgeodjangoprogressbarCopyright and LicenseThis code was written by Chris Mutel [3] during his studies at ETH Zurich [4], and is copyright 2011 ETH Zurich. The license is 2-clause BSD.
Package: py-amortization
py-amortizationPython library for calculating amortizations and generating amortization schedulesInstallationpipinstallpy-amortizationUsagePythonAmortization Amountfrompy_amortizationimportAmortizationAmountamo_amount=AmortizationAmount(1000,3)# amortization amount in case of monthly payment for the period of 12 monthsamo_amount.monthly(period=12)# amortization amount in case of weekly payment for the period of 10 weeksamo_amount.weekly(period=10)Amortization Periodfrompy_amortizationimportAmortizationPeriodamo_period=AmortizationPeriod(1000,3)# amortization period in case of monthly payment for amount of 100 per monthamo_period.monthly(amount=100)# amortization period in case of weekly payment for amount of 100 per weekamo_period.weekly(amount=100)Amortization Schedulefrompy_amortizationimportAmortizationScheduleamo_schedule=AmortizationSchedule(1000,3)# amortization schedule in case of monthly payment for the period of 12 monthsamo_schedule.monthly(period=12)# amortization schedule in case of weekly payment for for the period of 10 weeksamo_schedule.weekly(period=10)frequency types available- monthly
- semi_monthly
- bi_monthly
- quarterly
- annual
- semi_annual
- weekly
- bi_weekly
- daily0.1.0 (December 13, 2022)initital deployment
Package: pyampd
AMPD algorithm in PythonImplements a functionfind_peaksbased on the Automatic Multi-scale
Peak Detection algorithm proposed by Felix Scholkmann et al. in
"An Efficient Algorithm for Automatic Peak Detection in
Noisy Periodic and Quasi-Periodic Signals", Algorithms 2012,
5, 588-603UsageInstall from PyPI:pip install pyampdOr install from source:pip install git+https://github.com/ig248/pyampdImport function:frompyampd.ampdimportfind_peaksSeenotebooks/ampd.ipynbfor usage examples.Specifying maximum scaleTo improve run-time on large time-series, it is possible to specify the maximum scale to consider:peaks=find_peaks(x,scale=100)will only consider windows up to +-100 point either side of peak candidates.Adaptive Scale SelectionIf the characteristic scale of the signal changes over time, a new algorithm called
Adaptive Scale Selection can track the changes in optimal scales and detect peaks accordingly:peaks=find_peaks_adaptive(x,window=200)will select the optimal scale at each point using a 200-point running window.Original implementationfind_peaksis not identical to the algorithm proposed in the original paper (especially near start and end of time series).
A performance-optimized version of the original implementation is provided infind_peaks_original.TestsRunpytestOther implementationsR:https://cran.r-project.org/web/packages/ampd/index.htmlMATLAB:https://github.com/mathouse/AMPD-algorithmPython:https://github.com/LucaCerina/ampdLibImprovementsThis Python implementation provides significant speed-ups in two areas:Efficient tracking of local minima without using random numbersIntroduction of maximum window size, reducing algorithm run-time from
quadratic to linear in the number of samples.Better handling of peaks near start/end of the seriesAddition of new Adaptive Scale SelectionToDoIt may be possible to avoid repeated comparisons, and reduce worst-case
runtime fromO(n^2)toO(n log(n)).find_peaks_adaptivecould benefit from specifying bothwindowandmax_scaleReferencesOriginal paper:https://doi.org/10.1109/ICRERA.2016.7884365
Package: pyampio
Python AMPIO Home Server ClientPython Client to AMPIO Home ServerRequires Python 3.4+Installation$pythonsetup.pyinstallTesting$ampio--helpUsage:ampio[OPTIONS]Options:--portPATHTheUSBinterfacefullpathi.e./dev/cu.usbserial-DN01D1W1.Ifno--portoptionprovidedtheAMPIO_PORTenvironmentvariableisused.[required]--log-level[NONE|DEBUG|INFO|ERROR]Logginglevel.[default:ERROR]--helpShowthismessageandexit.$ampio--port/dev/dev/cu.usbserial-DN01D1W1