Saravanan666/pypi-org huggingface dataset:
Package: prat-geventwebsocket
gevent-websocketis a WebSocket library for thegeventnetworking library.Features include:Integration on both socket level or using an abstract interface.RPC and PubSub framework usingWAMP(WebSocket Application
Messaging Protocol).Easily extendible using a simple WebSocket protocol plugin APIfrom geventwebsocket import WebSocketServer, WebSocketApplication, Resource

class EchoApplication(WebSocketApplication):
    def on_open(self):
        print "Connection opened"

    def on_message(self, message):
        self.ws.send(message)

    def on_close(self, reason):
        print reason

WebSocketServer(
    ('', 8000),
    Resource({'/': EchoApplication})
).serve_forever()or a low level implementation:from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler

def websocket_app(environ, start_response):
    if environ["PATH_INFO"] == '/echo':
        ws = environ["wsgi.websocket"]
        message = ws.receive()
        ws.send(message)

server = pywsgi.WSGIServer(("", 8000), websocket_app,
    handler_class=WebSocketHandler)
server.serve_forever()More examples can be found in theexamplesdirectory. Hopefully more
documentation will be available soon.InstallationThe easiest way to install gevent-websocket is directly fromPyPiusing pip or
setuptools by running the commands below:$ pip install gevent-websocketGunicorn WorkerUsing Gunicorn it is even more easy to start a server. Only thewebsocket_appfrom the previous example is required to start the server.
Start Gunicorn using the following command and worker class to enable WebSocket
funtionality for the application.gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" wsgi:websocket_appPerformancegevent-websocketis pretty fast, but can be accelerated further by
installingwsaccelandujsonorsimplejson:$ pip install wsaccel ujsongevent-websocketautomatically detectswsaccelland uses the Cython
implementation for UTF8 validation and later also frame masking and
demasking.Get in touchGet in touch on IRC #gevent on Freenode or on the Geventmailinglist. Issues can be created
onBitbucket.
Package: prat-misaka
The Python binding forSundown, a markdown parsing library.Documentation can be found at:http://misaka.61924.nl/InstallationCython is only needed to compile .pyx file.With pip:pip install misakaOr manually:python setup.py installExampleVery simple example:from misaka import Markdown, HtmlRenderer

rndr = HtmlRenderer()
md = Markdown(rndr)

print md.render('some text')Or:import misaka as m
print m.html('some other text')
Package: pravda
pravdaPython type-checker written in RustFeaturesFully typed with annotations and checked with mypy,PEP561 compatibleAdd yours!InstallationpipinstallpravdaExampleShowcase how your project can be used:frompravda.exampleimportsome_functionprint(some_function(3,4))# => 7LicenseMITCreditsThis project was generated withwemake-python-package. Current template version is:5d436d64f7d0a9b3a506d130e3a5669c409061b5. See what isupdatedsince then.
Package: pravega
Pravega Python client.This project provides a way to interact withPravegausing Python client.Pravega is an open source distributed storage service implementing Streams. It offers Stream as the main primitive for
the foundation of reliable storage systems: a high-performance, durable, elastic, and unlimited append-only byte stream
with strict ordering and consistency.This project supports interaction with Pravega for Python versions 3.8+.InstallThe client library can be installed using pip.pipinstallpravegaThe users can also choose to generate the bindings using the commands specified atPythonBinding.ExampleWrite eventsimportpravega_client# assuming Pravega controller is listening at 127.0.0.1:9090stream_manager=pravega_client.StreamManager("tcp://127.0.0.1:9090")scope_result=stream_manager.create_scope("scope_foo")self.assertEqual(True,scope_result,"Scope creation status")stream_result=stream_manager.create_stream("scope_foo","stream_bar",1)# initially stream contains 1 segmentself.assertEqual(True,stream_result,"Stream creation status")writer=stream_manager.create_writer("scope_foo","stream_bar")writer.write_event("hello world")Read eventsimportpravega_client# assuming Pravega controller is listening at 127.0.0.1:9090stream_manager=pravega_client.StreamManager("tcp://127.0.0.1:9090")reader_group=stream_manager.create_reader_group("my_reader_group","scope_foo","stream_bar")reader=reader_group.create_reader("my_reader");# acquire a segment slice to readslice=awaitreader.get_segment_slice_async()foreventinslice:print(event.data())# after calling release segment, data in this segment slice will not be read again by# readers in the same reader group.reader.release_segment(slice)# remember to mark the finished reader as offline.reader.reader_offline()
Package: pravegaBhu
Pravega Python client.This project provides a way to interact withPravegausing Python client.Pravega is an open source distributed storage service implementing Streams. It offers Stream as the main primitive for
the foundation of reliable storage systems: a high-performance, durable, elastic, and unlimited append-only byte stream
with strict ordering and consistency.This project supports interaction with Pravega for Python versions 3.8+.InstallThe client library can be installed using pip.pipinstallpravegaThe users can also choose to generate the bindings using the commands specified atPythonBinding.ExampleWrite eventsimportpravega_client# assuming Pravega controller is listening at 127.0.0.1:9090stream_manager=pravega_client.StreamManager("tcp://127.0.0.1:9090")scope_result=stream_manager.create_scope("scope_foo")self.assertEqual(True,scope_result,"Scope creation status")stream_result=stream_manager.create_stream("scope_foo","stream_bar",1)# initially stream contains 1 segmentself.assertEqual(True,stream_result,"Stream creation status")writer=stream_manager.create_writer("scope_foo","stream_bar")writer.write_event("hello world")Read eventsimportpravega_client# assuming Pravega controller is listening at 127.0.0.1:9090stream_manager=pravega_client.StreamManager("tcp://127.0.0.1:9090")reader_group=stream_manager.create_reader_group("my_reader_group","scope_foo","stream_bar")reader=reader_group.create_reader("my_reader");# acquire a segment slice to readslice=awaitreader.get_segment_slice_async()foreventinslice:print(event.data())# after calling release segment, data in this segment slice will not be read again by# readers in the same reader group.reader.release_segment(slice)# remember to mark the finished reader as offline.reader.reader_offline()
Package: prawcore
prawcore is a low-level communication layer used by PRAW 4+.InstallationInstall prawcore usingpipvia:pip install prawcoreExecution ExampleThe following example demonstrates how to use prawcore to obtain the list of trophies
for a given user using the script-app type. This example assumes you have the
environment variablesPRAWCORE_CLIENT_IDandPRAWCORE_CLIENT_SECRETset to the
appropriate values for your application.#!/usr/bin/env pythonimportosimportpprintimportprawcoreauthenticator=prawcore.TrustedAuthenticator(prawcore.Requestor("YOUR_VALID_USER_AGENT"),os.environ["PRAWCORE_CLIENT_ID"],os.environ["PRAWCORE_CLIENT_SECRET"],)authorizer=prawcore.ReadOnlyAuthorizer(authenticator)authorizer.refresh()withprawcore.session(authorizer)assession:pprint.pprint(session.request("GET","/api/v1/user/bboe/trophies"))Save the above astrophies.pyand then execute via:python trophies.pyAdditional examples can be found at:https://github.com/praw-dev/prawcore/tree/main/examplesDepending on prawcoreprawcore followssemantic versioningwith the exception that
deprecations will not be preceded by a minor release. In essence, expect only major
versions to introduce breaking changes to prawcore’s public interface. As a result, if
you depend on prawcore then it is a good idea to specify not only the minimum version of
prawcore your package requires, but to also limit the major version.Below are two examples of how you may want to specify your prawcore dependency:setup.pysetup(...,install_requires=["prawcore >=0.1, <1"],...)requirements.txtprawcore >=1.5.1, <2
Package: prawdditions
Prawdditions is an auxiliary package for the PRAW project, designed to supplement its existing functionality. Prawdditions aims to add more abstract functionality to the praw libraries that would otherwise clash with the clean design that praw 4.0.0 exhibits. An example of this is an abstractedmessagefunction that does not extend from a redditor or subreddit class. Prawdditions adds this functionality in a manner that doesn’t explicitly require the instantiation of such objects, and will aim to build out similar such functionality in the future.InstallationInstall prawdditions usingpipvia:pip install prawdditionsUsageThe following example demonstrates how to use prawdditions…importprawimportprawdditions#Instantiate Reddit Clientreddit=praw.Reddit(...)#Abstract message function now available.reddit.message('user_or_subreddit','subject','body')ContactAuthor: Randy GoodmanEmail:randy@kindofabigdeal.org
Package: prawframe
prawframeprawframe is a small framework for running plugin-based reddit bots. prawframe supports scheduling plugins and includes a remote python console for modifying your bot's behavior while it runs.Documentation comingsoonat some point.  Checkexample.pyfor an
example of the features so far.  Runserver.pyto run
the remote python console "server".  The bot will connect
to you and you can send it python code.  Everything is
accessible through theBotobject.  Put your plugins inplugins.pyto add your plugins to the remote python console's
namespace.Make sure to open up the.envfile to configure your bot.Installpip install prawframe
Package: prawn
prawnA stream processor for cleaning mixed streams of html and text into plain text.More details can be found in theOnline Documentation.InstallationYou can install prawn forPythonviapipfromPyPI.$ pip install prawnPrerequisites:html2textDownload from PyPI.orghttps://pypi.org/project/prawn/ContributingContributions are very welcome, consider using thefile an issueto discuss the work before beginning, but if you already have a Pull Request
ready then this is no problem, please submit it and it will be very gratefully
considered. TheContribution Guidelinesoutlines the prawn commitment to ensuring all
contributions receive appropriate recognition.LicenseDistributed under the terms of theGPLv3license, "prawn" is free and open source softwareIssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.Additional Documentation:Online DocumentationNews.Template Updates.Code of Conduct.Contribution Guidelines.
Package: prawoauth2
prawoauth2is a helper library which makes writing Reddit bots/apps
using OAuth2 super easy and simple.Documentationprawoauth2comes with extensive documentation and is available onRead The DocsInstallationpip install prawoauth2Bots usingprawoauth2Goodreads BotSamacharbot2GfyBotGiantBombSidebarNot Max TrollbotEnhanceImageBotBB Reddit AutomodFeel free to fork and add link to your bot/project.LICENSEThe mighty MIT License. Please checkLICENSEfor info.CreditsSmBe19’spraw-OAuth2Utiland KissTheBlade_’sscriptwere very helpful.TheseRedditthreadsalsohelped me lot. Most of text inInstallationis copied fromPython Requests. Github userqevohashelpedme generating docs.First I started usingpraw-OAuth2Util, but I really did not like the
way it was handling configurations and tokens. So, Iforkedand started
using my fork. And later ended up writing my own. I am no longer
maintaining the fork and I recommend using this library instead.
Package: praxis-timeseries-client
Praxis Time Series ClientCurrent version: 0.0.4
Python version: >= 3.7A package for quick visualization of a target Darts time series objects alongside covariates and discrete data.UsageThe main component of this package is theDartsInterfaceclass found inpraxis_timeseries_client.darts. This synthesizes together your Time Series objects under the same hood, so you can interact with them together in a single graph and run models in a plug-and-play manner with your covariates.frompraxis_timeseries_client.dartsimportDartsInterfacefromdartsimportTimeSeriesinterface=DartsInterface(target_ts=TimeSeries.from_dataframe(...),past_covariates=TimeSeries.from_dataframe(...),future_covariates=TimeSeries.from_dataframe(...),discrete_vars={...})Now, you can plot with the interface:interface.plot(components=[...]).show()# Plot all components, or an ordered subsetAnd run forecasts and backtests with a model pre-trained on the covariates:# make sure ts_train == target_ts from abovemodel=LinearRegressionModel(lags=50,lags_future_covariates=(100,50),output_chunk_length=30)model.fit(series=ts_train,future_covariates=ts_future_covs)# run a backtest and plot itbacktest=interface.backtest(model,start=pd.Timestamp(startDate),forecast_horizon=int(forecastHorizon),stride=int(stride))backtest.run(past_covariates=None)backtest.plot().show()# or run a forecast and plot itforecast=interface.forecast(model,n=50)forecast.run(past_covariates=None)forecast.plot().show()Hopefully this is enough to get you started using the interfaces!
Package: prayer-tool
prayer_toolThe prayer_tool is an open-source library based on prayertimes.date API.Check their API hereIt provides you a complete library to get the prayer times for the day or the whole month.How to get it ?The prayer_tool is a python package that you can simply install using the following commandpip install prayer-toolHow to use it ?To use our library in your code, you need to import it and intialize it, that's all. It's easy !from prayer_tool import prayer_times

## Intialize an instance of it
instance = prayer_times.PrayerTimes(city="Brussels", school=3, juristic=0)

## Get today's prayer's
today = instance.get_date()

# EXAMPLES
print(f"{today.fajr.name} : {today.fajr.time}")
# fajr : 04:42:00

print(f"{today.dhor.name} : {today.dhor.time}")
# dhor : 13:46:00Advanced requestsPrecise dayYou can also get the schedule for a precise day.
Code example:from prayer_tool import prayer_times
import datetime

#Declaring an instance
instance = prayer_times.PrayerTimes()

#The datetime object we need
date = datetime.datetime(year = 2021, month = 8, day = 23)

#Call the function and save the result
result = instance.get_date(date)

print(result.__str__())

##output:
Date : 2021-08-23 00:00:00 
fajr : 04:32:00
dhor : 13:45:00
asr : 17:37:00
maghreb : 20:48:00
icha : 22:48:00Date intervalYou are also able to ask for the schedule in a date interval.
Code example:from prayer_tool import prayer_times
import datetime

#Declaring an instance
instance = prayer_times.PrayerTimes(city="Paris")

#The datetime objects we need
start = datetime.datetime(year = 2021, month = 8, day = 23)
end = datetime.datetime(year = 2021, month = 8, day = 26)

#Call the function and save the result
result = instance.get_date(start, end)

for item in result:
    print(item.__str__() + "\n")

##output:
Date : 2021-08-23 00:00:00 
fajr : 04:32:00
dhor : 13:45:00
asr : 17:37:00
maghreb : 20:48:00
icha : 22:48:00

Date : 2021-08-24 00:00:00
fajr : 04:35:00
dhor : 13:45:00
asr : 17:36:00
maghreb : 20:46:00
icha : 22:45:00
...Customize the resultThe prayers differ from city to city, school to school and so one. That's why the API lets you chose your preferences.
Here are the options:SCHOOL : 
Id	Name	
0	Ithna Ashari
1	University of Islamic Sciences, Karachi	
2	Islamic Society of North America
3	Muslim World League (default)
4	Umm Al-Qura University, Mecca
5	Egyptian General Authority of Survey
7	Institute of Geophysics, University of Tehran
8	Morocco
9	Department of Islamic Advancement, Malaysia (JAKIM)	
10	Majlis Ugama Islam Singapura
11	Union des Organisations Islamiques de France
12	TurkeyJURISTIC :
Id	Juristic
0	Shafii (default)
1	Hanafi
Package: prayikta
PrayiktaBy using Prayikta module you can  calculate Gaussian distribution, Binomial Probability, pdf and can visualization of them.ClassesGaussian ClassBinomial ClassGaussian Class# Example Fuctions

  >>> from prayikta import Gaussian

  # It has two arguments mean and standard daviation default (mean = 0 and stdev = 1)

  >>> gaussian = Gaussian()
  >>> gaussian.mean
  >>> gaussian.stdev

  # Read data from file and calculate mean and standard deviation

  >>> gaussian.read_data_file('filename.txt')
  >>> gaussian.calculate_mean()
  >>> gaussian.calculate_stdev()

  # Plot histogram of data

  >>> gaussian.plot_histogram()

  # Calculate probability density function and visualise it.

  >>> gaussian.pdf() # takes one argument
  >>> gaussian.plot_histogram_pdf()


  # Add to gaussian functions

  >>> gaussian_a = Gaussian(25,0)
  >>> gaussian_b = Gaussian(5,2)
  >>> gaussian_c = gaussian_a + gaussian_bBinomial Class# Example Fuctions
  >>> from prayikta import Binomial

  # It takes two arguments mean and standard daviation default (probability = 0.5 and size = 20)

  >>> binomial = Binomial()
  >>> binomial.calculate_mean()
  >>> binomial.calculate_stdev()

  # Plot bar

  >>> binomial.plot_bar()

  # Calculate pdf and visualise it.

  >>> binomial.pdf() # takes one argument
  >>> binomial.plot_bar_pdf()

  # Add to binomial functions

  >>> binomial_a = Binomial(0.5,10)
  >>> binomial_b = Binomial(0.25,20)
  >>> binomial_c = binomial_a + binomial_b
Package: prbit
Pull Request Cli Tool for Bitbucket. Cli Library by Click :http://click.pocoo.orgInstallUse pip package manager for pythonpip install prbitHow to usageFirst: You should runprbit configfor Create configuration file.Usage: prbit config [OPTIONS]Options:-u,--usernameUsername of Bitbucket Account-p,--passwordPassword of Bitbucket AccountSecond: Next runprbit createto create pull request.Usage: prbit create [OPTIONS]Options:-t,--topicTopic of Pull-Request-d,--descriptionDescription-r,--repoRepository-s,--sourceSource Branch-t,--targetTarget Branch-u,--reviewerAssign some user to review
Package: prc-flowmeter
PRC Flowmeter v0.2.4Flowmeter is a Scapy-based tool for deriving statistical features from PCAPs for data analysis and machine learning. The features are based on the java applicationCICFlowmeterBased heavily onthis flowmeter appUsageA Flowmeter object is created with up to three parameters:offline (str) - filename of a pcap file; if none provided, streams from available ports (requires run as admin in linux-based environments.)outfunc (function) - a csv rendition of the metered flows will be sent to this function as they are created. If none provided, will default to print().outfile (str) - filename to store csv flow output. If none is provided, results are not stored.Building off of scapy Sessions, Flowmeter separates packet streams into distinct network communication 'flows', which are identified simply as communications between two endpoints (ip:port) on a given protocol within a period of time. From there it begins analyzing the flow data to derive features useful for plotting, traffic pattern analysis, and machine learning.from flowmeter import Flowmeter

feature_gen = Flowmeter(
    offline = "input.pcap",
    outfunc = None,
    outfile = "output.csv")

feature_gen.run()ContributionsIf you would like to contribute feel free to fork the repo, clone the project, submit pull requests, open issues, or request features/enhancements.LicensePRCFlowmeter is currently licensed under the GNU GPLv2.
Package: pr-colored
Installationpip install pr_coloredUsagefrom pr_colored.pr_colored import prpr(DATABASE)pr(DATABASE, 'green')colors:'grey', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white'Donate - send - ETH - network - BEP20:0xed426c1dd79d79d61a7cebdc2630573ffb9fdf38LicenseThis project is licensed under theMIT- see theLICENSEfile for details.
Package: pr-commenter
pr-commenterCreate and manage automatic comments in a Github PRpr-commenteris CLI app to add a comment a Github PR based on content from stdin, files or environment variables.You can create a new comment, hide a previous one of the same type or update the "current" one from a different process. This is done with a hidden metadata added to the comment so it could be detected in a subsequent run, and update or hide previous messages if needed.Basic usageCreate a Github token withreposcope and export it asPR_COMMENTER_GITHUB_TOKENenvironment variablepr-commenter your/repo 12 comment.txtOr from the standard input, using-as the file namecat comment.txt | pr-commenter your/repo 12 -This will simply create a new comment in the PR 12 with the content ofcomment.txtBut there is much more.Advanced exampleSuposse you have a templatefailed_tests.j2like this{% if not is_append %}## Failed tests{% endif %}
 
[suite {{ CI_SUITE_NAME }}]({{ CI_SUITE_URL }}):

```bash
{% for line in input_lines %}{{ line }}
{% endfor %}Then your test-runner produces a filefailures.txtwith the list
of failed tests like this:tests/test_client.py::test_client_simple
tests/test_client.py::test_client_complexSo we want to add asingle commentto the PR with the failed tests for
two different suites executions triggered by the same "commit".In the post-build phase of both suites, you can run something likepr-commenteryour/repo$PRfailures.txt-tfailed_tests.j2--build=$COMMITThe first suite that finish will post a comment like this<!-- pr-commenter: failed_tests.j2 abc123 -->## Failed tests[suite client](http://the-client-url):```bashtests/test_client.py::test_client_simple
tests/test_client.py::test_client_complex```Then the second suite will find that previous comment that was for the same
template and same and commit ("abc123"in the example), so pr-commenter will
edit the comment and append the new content.The result will be something like this:<!-- pr-commenter: failed_tests.j2 abc123 -->## Failed tests[suite client](http://the-client-url):```bashtests/test_client.py::test_client_simple
tests/test_client.py::test_client_complex```[suite server](http://the-server-url):```bashtests/test_server.py::test_server_1```In a next commit, the first suite that finishes will post a new comment, but this time
the commit will be different, so the previous "abc123" comment will be minimized.TemplatesIt uses Jinja2 templates. The stdin/files is passed and a variableinput_linesAndis_appendwill beTruein case the new comment will be appended to an existent
one (so you can ommit the header or footer, for instance).In addition, the completeos.environdictionary is passed, so all the environment variables are available in the template.InstallInstall the package with pipxpip install --user pipx
pipx install pr-commenterAlternatively, with pippip install --user pr-commenterCreate a Github token withreposcope and export it asPR_COMMENTER_GITHUB_TOKENenvironment variable
Package: prcop
prcopSend Slack alerts to remind your team when reviews are overdue on pull requests.Currently supports self-hosted Bitbucket servers.Installationpython3.7 -m pip install prcopUsageprcop run \
  --bitbucket-url https://bitbucket.example.com/ \
  --slack-webhook https://hooks.slack.com/services/<id> \
  --slack-channel development \
  project1/repo1 project1/repo2 project2/repo3