Saravanan666/pypi-org huggingface dataset:
Package: pypsf
PyPSFThis project provides a python implementation of the Pattern Sequence Based Forecasting (PSF) algorithm. For a detailed description of the PSF algorithm and some of the practical issues I encountered when using it, seethis PDF file.Installationpip install pypsfDependenciesscikit-learnnumpyExample UsageApplying PSF to the classic R "AirPassenger" dataset, which provides monthly totals of a US airline passengers, from 1949 to 1960.importnumpyasnpimportmatplotlib.pyplotaspltfrompypsfimportPsfplt.style.use("dark_background")t_series=np.array([112,118,132,129,121,135,148,148,136,119,104,118,115,126,141,135,125,149,170,170,158,133,114,140,145,150,178,163,172,178,199,199,184,162,146,166,171,180,193,181,183,218,230,242,209,191,172,194,196,196,236,235,229,243,264,272,237,211,180,201,204,188,235,227,234,264,302,293,259,229,203,229,242,233,267,269,270,315,364,347,312,274,237,278,284,277,317,313,318,374,413,405,355,306,271,306,315,301,356,348,355,422,465,467,404,347,305,336,340,318,362,348,363,435,491,505,404,359,310,337,360,342,406,396,420,472,548,559,463,407,362,405,417,391,419,461,472,535,622,606,508,461,390,432])train=t_series[:-28]test=t_series[-28:]psf=Psf(cycle_length=12,apply_diff=True,diff_periods=12)psf.fit(train)pred=psf.predict(len(test))fig,ax=plt.subplots()x_train=np.array(range(len(train)))x_test_pred=np.array(range(len(test)))+x_train[-1]ax.plot(x_train,train,c="lightblue")ax.plot(x_test_pred,test,c="lightgreen")ax.plot(x_test_pred,pred,c="tab:orange")plt.legend(["Training","Test","Prediction"])plt.tight_layout()plt.show()Parametersclass Psfcycle_length: intThe cycle length ck: int (optional), default NoneThe user-defined number of desired clusters when running K-means on the cyclesw: int (optional), default NoneThe user-defined window sizesuppress_warnings: bool (optional), default FalseSuppress all warningsapply_diff: bool (optional), default FalseApply first order differencing to the time series before applying PSFdiff_periods: int (optional), default 1Periods to shift for calculating difference, to allow for either ordinary or seasonal differencing. Ignore if apply_diff=Falsedetrend: bool (optional), default FalseRemove a linear trend from the series prior to applying PSF by fitting a simple linear regression model.
The trend is subsequently re-added to the predictions.Psf.fitdata:The input time seriesk_values: iterable[int] (optional), default tuple(range(3, 12))The set of candidate values ofkto test when finding the "best"knumber of clusters based on the training dataw_values: iterable[int] (optional), default tuple(range(1, 20))The set of candidate values ofwto test when finding the "best" window sizewbased on the training dataPsf.predictn_ahead: intThe number of values to predict
Package: pypsg
A Python wrapper for the Planetary Spectrum Generator.The goal of this package is to make PSG more accessible to
new users, but still be powerfull enough that expert users
will find it useful.In the simplest use case, users can create a PSG config file from scratch
using thePyConfigclass.importpypsgcfg=pypsg.cfg.PyConfig(target=pypsg.cfg.Target(object='Exoplanet',name='Proxima Cen b'))print(cfg.content)b'<OBJECT-NAME>Proxima Cen b\n<OBJECT>Exoplanet'We can then call PSG with our setup.psg=pypsg.APICall(cfg=cfg,output_type='rad',)response=psg()Now let’s take a look at the rad file we get back.
ThePyRadclass inherits fromastropy.table.QTable.rad=response.radradWave/freq     Total          Object       Reflected       Thermal
    um    W / (sr um m2) W / (sr um m2) W / (sr um m2) W / (sr um m2)
float64     float64        float64        float64        float64
--------- -------------- -------------- -------------- --------------
    1.0      231.99203        231.992        231.992    1.76851e-13
    1.1      184.89523        184.895        184.895    8.59289e-12
    ...            ...            ...            ...            ...
    1.8       45.45587        45.4559        45.4559    1.69172e-05
    1.9      38.276023         38.276         38.276    5.24737e-05
Package: pypsh
pypsh is a simple commandline tool to execute a command in parallel on multiple
hosts.Under the hoods it usessshvia theparamikopython library.Whypypshinstead of dsh?Because managing group files with dsh is tedious. Pypsh requires no
configuration, it just works.Similar to dsh, pypsh can be used to execute a command on multiple hosts in
parallel. In addition it is also possible to copy a file to multiple hosts at
once. See below for further usage instructions.The command or file copy operation will be executed on any host that is in theknown_hostsfile and matches the given regular expression.This means in order for pypsh to know about a host it is necessary to connect
to it at least once with plain ssh.Command ExecutionTo execute a command on a group of hosts matching a given regular expression:pypsh <hostregex> <cmd-to-execute>E.g.:pypsh "role\d+\.customer\.your\.domain" "uptime"Instead of executing the commands in parallel it is also possible to execute
the commands one after another. To do so use:pypsh "role\d+\.customer\.your\.domain" --interval 0.1 cmd "uptime"Or to wait between the commands (which might be useful when restarting services
like elasticsearch that are part of a cluster):pypsh "role\d+\.customer\.your\.domain" -i 60 cmd "uptime"pypshcan also read from stdin. So it is possible to pipe command into it:echo "uptime" | pypsh "myhosts[0-9]"NotePiping is only supported if pypsh itself only received one argument.
Therefore it is not possible to couple it with other parameters likeintervalCopy file to multiple hostsTo copy a given file to a group of hosts:pypsh "my\.domains\d+\.com" copy /tmp/here/myfile.txt /tmp/remote/file.txtInstallationpypshcan be installed usingpip:pip install pypshDevelopmentTo work onpypshcheckout the git repository, create a
virtual environment and install the dependencies:git clone https://github.com/mfussenegger/pypsh.git
cd pypsh
mkvirtualenv pypsh
pip install -r requirements.txtSometimes it is useful to point thepypshcommand to the local development
branch:pip install --upgrade --force-reinstall --editable .But usually it is sufficient to invoke it like this:python pypsh/main.py ...
Package: pypsn
python-psnPure Python parsing library for PSN V2 -PosiStageNetOfficial PSN specificationSource codeInstallationpipinstallpypsnTo install latest master from git via pip:python-mpipinstallhttps://codeload.github.com/open-stage/python-psn/zip/refs/heads/masterUsageimportpypsn# define a callback functiondefcallback_function(data):ifisinstance(data,pypsn_module.psn_data_packet):# packet type: psn.psn_data_packetfortrackerindata.trackers:# loop through all trackersprint(tracker.pos)# print the received coordinatesifisinstance(data,pypsn_module.psn_info_packet):# packet type: psn.psn_info_packetprint(data.name)# print server namefortrackerindata.trackers:# loop through all trackersprint(tracker.tracker_name)# print the received tracker name# provide a callback function and an IP addressreceiver=pypsn.receiver(callback_function)receiver.start()# start the receiving threadreceiver.stop()# stop receivingSee examples folder for some more examples.Development, statusSupporting PSN V2Parsing only, not sendingUsing threading moduleLinux, Windows and macOS testedTyped, no-strictInitial pytest testing provided together with CI/CD setupType hintsAt this point, the--no-strict-optionalis needed for mypy tests to pass:mypypypsn/*py--pretty--no-strict-optionalFormatto format, useblackTestingto test, usepytestto test typing with mypy usepytest--mypy-mmypypypsn/*py
Package: py-pspdfkit
PSPDFKit API wrapperpy-pspdfkitis a simple API wrapper forPSPDFKit.Installationpip install py-pspdfkitUsagefrompspdfkitimportAPIclient=API('http://localhost:5000','secret')client.upload_file_from_url('https://isotropic.org/papers/chicken.pdf','cc90ea63a926fe36a9c92fab0ca246db40f34e39170764153c13e427e4acc1fb')Web application examplesDjango
Package: pypsqueak
pypSQUEAK — Python Packaged Semantic Quantum Expression ArchitectureAn extension of Python providing high-level object abstractions for quantum devices.Features of pypSQUEAK include:Variable-size quantum registers. The sky's the limit. (Well, your hard drive's size is anyway.)Built-in set of universal one-qubit gates as well as several important two-qubit gates.User-defined static or parametric gates of arbitrary size.Modeling of noisy quantum channels.For more information, consult thedocumentation.InstallationInstallation is done viapip:pip install pypsqueakExamplesSeveral examples are provided in theexamplesfolder. They are Python scripts demonstrating various aspects of pypSQUEAK.Here is an example of a script that constructs a pypSQUEAK program to measure a qubit in the |1> state in the presence of noise:importpypsqueak.apiassqfrompypsqueak.gatesimportXfrompypsqueak.noiseimportdamping_mapnoisy_channel=sq.qOp(kraus_ops=damping_map(0.3))zeros=0ones=0n_runs=100foriinrange(n_runs):q=sq.qReg()# Prep the |1> stateX.on(q)# Send it through an amp decay channel with 0.3 chance of decaynoisy_channel.on(q)# measure the resulting qubitresult=q.measure(0)ifresult==0:zeros+=1else:ones+=1print(zeros/n_runs,ones/n_runs)LicenseThis projects is licensed under the MIT License. See LICENSE.txt for more details.
Package: pypsutil
pypsutilA partial reimplementation of psutil in pure Python using ctypes. Currently, only Linux, macOS, and the BSDs are supported, but Windows support is planned.DocumentationExample usagepypsutil's API is very similar topsutil's:>>> import pypsutil
>>> p = pypsutil.Process()
>>> p.pid
477967
>>> p
Process(pid=477967, name='python3', status='running', started='12:00:40')
>>> p.name()
'python3'
>>> p.exe()
'/usr/bin/python3.9'
>>> p.cwd()
'/tmp'
>>> p.cmdline()
['python3']
>>> p.terminal()
'/dev/pts/6'
>>> p.status()
<ProcessStatus.RUNNING: 'running'>
>>> p.ppid()
477771
>>> p.parent()
Process(pid=477771, name='bash', status='sleeping', started='12:00:33')More information is available in thedocumentation.
Package: pyptax
PyPtaxPyPtax is a Python library and CLI to retrieve information onPtax ratesFeatures|Installation|Quickstart|Documentation|ContributingWhat is Ptax?Ptax exchange rateis the reference exchange rate for U.S. Dollar, expressed as the amount of Brazilian Reais per one U.S. Dollar,
published by theCentral Bank of Brazil.FeaturesClosing Ptax rates for a requested dateHistorical Ptax rates for a requested periodIntermediary Ptax rates for a requested dateInstallation$pipinstallpyptaxQuickstartClosing Ptax rates for a requested dateCommand line:$pyptaxclose--date2020-01-20Module:>>> from pyptax import ptax
>>> bulletin = ptax.close("2020-01-20")
>>> bulletin.as_dict
{
    "datetime": "2020-01-20 13:09:02.871",
    "bid": 4.1823,
    "ask": 4.1829,
    "bulletin_type":
    "close"
}
>>> bulletin.datetime
"2020-01-20 13:09:02.871"
>>> bulletin.bid
4.1823
>>> bulletin.ask
4.1829Historical Ptax rates for a requested periodCommand line:$pyptaxhistorical--start_date2020-01-01--end_date2020-01-05Module:>>> from pyptax import ptax
>>> historical_bulletin = ptax.historical('2020-01-01', '2020-01-05')
>>> historical_bulletin
HistoricalBulletin(
    start_date="2020-01-01",
    end_date="2020-01-03",
    bulletins=[
        Bulletin("2020-01-02 13:11:10.762", 4.0207, 4.0213, "close"),
        Bulletin("2020-01-03 13:06:22.606", 4.0516, 4.0522, "close"),
    ],
)

>>> historical_bulletin.as_dict
{
    "start_date": "2020-01-01",
    "end_date": "2020-01-03",
    "bulletins": [
        {
            "datetime": "2020-01-02 13:11:10.762",
            "bid": 4.0207,
            "ask": 4.0213,
            "bulletin_type": "close"
        },
        {
            "datetime": "2020-01-03 13:06:22.606",
            "bid": 4.0516,
            "ask": 4.0522,
            "bulletin_type": "close"
        },
    ],
}:warning: Enter all dates in the formatYYYY-MM-DDDocumentationThe full documentation is available onhttps://pyptax.readthedocs.io/.ContributingPlease see thecontributing pagefor guidance on setting up a development environment and how to contribute.
Package: pyptex
PypTeX: the Python Preprocessor for TeXAuthor: Sébastien LoiselPypTeX is the Python Preprocessor for LaTeX. It allows one to embed Python
code fragments in a LaTeX template file.Installationpip install pyptexYou will also need a LaTeX installation, and the default LaTeX processor ispdflatex.You need a Python 3 installation.Hello, worldPut the following inexample.tex:\documentclass{article}
@{from sympy import *}
\begin{document}
$$\int x^3\,dx = @{S('integrate(x^3,x)')}+C$$
\end{document}The commandpyptex example.texwill generateexample.pdfand an intermediary
pure-LaTeX fileexample.pyptex. The resulting PDF can be foundhereThepyptexexecutable tries to locate the Python 3 executable using/usr/bin/env python3. If this is causing you problems, trypython -u -m pyptex example.texinstead.Slightly bigger examples2d and 3d plottingtex|pdfMatrix inverse exercisetex|pdfThe F19NB handout for numerical linear algebra at Heriot-Watt university is generated with PypTeX.pdfTeXShopIf you want to use TeXShop on Mac, put the following into~/Library/TeXShop/Engines/pyptex.engineand restart TeXShop:#!/bin/bash
pyptex $1DocumentationDetailed documentation can be foundhere
Package: pyPTF
Welcome to pyPTF!This is a framework to developpedotransfer functionsusing genetic programming.A pedotransfer function is a model to predict soil properties based on other, easier to measure, soil properties. Traditionally, pedotransfer functions are represented as expressions (formulas) and that is whysymbolic regressionis a great alternative to develop them.This project wouldn't be possible without the greatglplearnlibrary, which implements Symbolic regression. In Trevor's words:Symbolic regression is a machine learning technique that aims to identify an underlying mathematical expression that best describes a relationship. It begins by building a population of naive random formulas to represent a relationship between known independent variables and their dependent variable targets in order to predict new data. Each successive generation of programs is then evolved from the one that came before it by selecting the fittest individuals from the population to undergo genetic operations.UncertaintyNatural systems are complex and every model that tries to represent them have uncertainties. This library implements a method to represent and report this uncertainty based onfuzzy clustering.
Package: pypthon
PypthonPipes for python3 to be used in shellSetuppip install pypthon -UUsagepyp 'Pypthon command'If pypthon is not in your path, you must invoke viapython3 -m pypthon 'Pypthon commandTo see the python code being generated, use the--show-pythonflag:pyp --show-python 'Python command'A Pypthon command consists of the followingsource | piped function | piped function | piped functionThe source must be any python expression. To have the source be an external command being piped into Pypthon, usestdin.Piped functionsPiped functions are any python functions which take the previous value as their last argument. In the example pypthon code,[2,1,3]|sorted|print"Sorted""list:"sortedtakes in the iterable[2, 1, 3]as its last parameter andprinttakes the sorted list as its last parameter. When passing other arguments to functions in Pypthon, one must use the space separated syntax. In our example, the strings"Sorted"and"list:"are passed as arguments toprintvia the syntax of separating each argument with a space.Sorted list: [1, 2, 3]will be outputted by the above command.Lambda expressionsIn python, lambdas are of the following structurelambdaarg1,arg2:arg1+arg2In pypthon, lambda expressions do not need thelambdakeyword before the arguments. In the example,['1.','6.','2.','4.']|mapx:int(float(x))|reducex,y:xifx>yelsey|printmapconverts the strings in the list into integers, andreducefinds the maximum of the integers.EnvironmentThe environment is fully customizable with a.pypthonrc.py. On startup, the pypthonrc will be imported, giving the pypthon command access to custom functions. If you feel like you have general functions that can be used by other pypthon users, do not hesitate to send a pull request to add your customizations to the standard environment as it is still growing. It is advisable to not include heavy imports such asnumpyto the pypthonrc as the startup time will be negatively impacted for each invocation of pypthon.To import modules specifically for the Pypthon invocation, use the-iflag.pyp -i 'requests' -i 'numpy as np' "[1, 2, 3] | map x: requests.get('https://google.com').status_code | list | np.mean | print"In the above example, numpy and requests were imported. The syntax ofmoduleasaliasis valid in Pypthon. The methods in the modules are available for use in Pypthon.The documentation for the standard environment is atdocs/example.md.OtherThere are currently some bugs in parsing the source to the pipe chain. If it incorrectly raises an error in the first pipe segment, surround it with parenthesis and see if it works.This project idea was heavily inspired by the pied piper package which only works with Python 2 and has virtually disappeared.
Package: pyption
pyptiontype Option, Some contains some value and Nothing contains absolutely nothing.Install using PyPI:pip install pyptiontypeOption->Some[Value]|NothingTypeSome(value: Value)NothingType()Nothing->singletonOption methods:unwrapunwrap_orunwrap_or_othermapmap_ormap_or_elseexpectSimple example:importtypingfrompyptionimportSome,Nothing,OptionT=typing.TypeVar("T")defcast_obj(obj:object,tp:type[T])->Option[T]:try:returnSome(tp(obj))except(TypeError,ValueError):returnNothingassertcast_obj("123",int).unwrap()==123# ok, some value!assertcast_obj(123,tuple[int]).unwrap_or(tuple())==tuple()# ok, alternate value!assertcast_obj((("name","Max",),),dict[str,str]).map(lambdad:d["name"]).unwrap()=="Max"# ok, some value from map!assertcast_obj(999,set[int])# fail, nothing!Example usageHERE
Package: pyptpchdk
A Python module that implements the Picture Transfer Protocol, including
support for CHDK extensions.InstallationMake sure thata C compiler is installedthe C header files of libusb and Python itself are installed.
Under Ubuntu and Debian, these are the packages libusb-dev
and python-dev.Install libtool and automake.To run tests, you need Python’s testtols package. (python-testtools
in Ubuntu and Debian.)Install the right version of libptppython-chdk-ptp requires yet another special libptp version:https://launchpad.net/python-ptp-chdk/trunk/0.1/+download/libptp-chdk-patches-0.1.tar.gzUnpack the libptp source code into the subdirectory ‘libptp’ of the main
python-chdsk-ptp source code directory and runcd libptp
autogen.sh
configure –with-pic
makeBuild and install python-ptp-chdkRun (in the main source code directory)setup.py build
setup.py installUsageSee examples and tests. (Note that some examples require the Python
Imaging Library.)CreditsThis project would be completely pointless without the amazing work
done by the CHDK developers anaylzing and extending the firmware of
Canon compact cameras. Parts of the source code is borrowed fromhttp://subversion.assembla.com/svn/chdkde/trunk/andhttp://subversion.assembla.com/svn/chdkptp/
Package: py-ptsl
py-ptslNative Python PTSL (Pro Tools Scripting Library) RPC interfaceImportant Notice!This software is developed by enthusiasts and is not a work of or supported by
Avid. Developers who wish to contribute to this project should obtain the PTSL
SDKfrom Avid's Developer sitefor the most
current documentation and protobuf source files.ExampleSee theexamples directoryfor scripts demonstrating how to use the
client.session_info.py- This example
prints a list of gettable properties from the currently-open
session.print_tracks.py- This example prints
a list of every track in the currently-open session, including state
information like selection, mute and solo state, track color and
track ID.Sending Commands To Pro Tools with theEngineclassTheEngineclass exposesptslcommands with a method call interface.fromptslimportopen_enginewithopen_engine(company_name="MY_COMPANY",application_name="MY_TOOL")asengine:session_name=engine.session_name()
Package: pyptu
title: README
author: Jan-Michael RyeSynopsisReadPicoQuant PTU files. The code follows the same parsing logic as thePython demo provided by PicoQuantbut is up to 40 times faster due to the use of vectorized operations usingNumpyarrays.LinksHomepageRepositoryDocumentationIssuesPyPI PackageSoftware HeritageUsagePython APIThe data in the file is parsed into the following objects which are set as attributes of the parser:headers- A dict mapping header fields to their values.markers- A Pandas DataFrame where each row is a record index with an index, a time tag and a marker.overflows- A Pandas DataFrame where each row is a record with a record index and an overflow values.photons.csv- A Pandas DataFrame where each row is a record with a record index, a channel, a time tag, a resolved time tag (using the global resolution value), and a dtime value.frompyptuimportPTUParser# A path to a PTU file.path=/tmp/example.ptu# Instantiate the parser. If no encoding is specified, the parser will first# attempt to load files using UTF-8 and then Windows-1252 encodings. Other# encodings can be specified using the "encoding" argument.parser=PTUParser(path)# Example of passing the "encoding" argument to the initialization method.# parser = PTUParser(path, encoding='utf-8')# Load the data. The load method also accepts an "encoding" argument.parser.load()# Example of passing the "encoding" argument to the load method.# parser.load(encoding='windows-1252')# Once the file is loaded, the loaded data can be accessed via the following# attributes.# The PTU header data.headers=parser.headers# The Pandas DataFrame of photon data.photons=parser.photons# The Pandas DataFrame of marker data.markers=parser.markers# The Pandas DataFrame of overflow values.overflows=parser.overflows# The loaded data can also be saved to standard file formats with the "save"# method. Call the method with the path to the desired output directory.parser.save('output')Command-LineThe package installs thepyptucommand-line tool that can be used to convert the data in a PTU file to JSON and CSV files. It accepts the path to a PTU file and an output directory.# Extract the PTU data to files in an output directory.pyptuexample.ptuoutput_directoryThe output directory will contain the following files:header.json- A JSON file with the headers described above.markers.csv- A CSV file containing themarkersDataFrame.overflows.csv- A CSV file containing theoverflowsDataFrame.photons.csv- A CSV containing thephotonsDataFrame.Help Message$ pyptu -h
usage: pyptu [-h] [--encoding ENCODING] path dir

Extract PTU data to standard files.

positional arguments:
  path                 A path to a PTU file.
  dir                  A path to an output directory.

options:
  -h, --help           show this help message and exit
  --encoding ENCODING  Specify the input filetype encoding. It must be an encoding type supported
                       by Python. If not given, the following encodings will be tried, in order:
                       utf-8, windows-1252.