Saravanan666/pypi-org huggingface dataset:
Package: pysh-lib
Pysh is a library for running external commands from a Python program,
with the usual concision and clarity that Python achieves in other domains.UsageSimple commands are simple:from pysh import check_cmd, try_cmd

check_cmd('gpg --decrypt --output {} {}', cleartext_path, cryptotext_path)

if not try_cmd('git diff-index --quiet HEAD'):
    raise RuntimeError("worktree not clean")

repo_root = slurp_cmd('git rev-parse --show-toplevel')
# "slurp" strips trailing newlines, just like shell `$(...)`Writing command linesCommand lines offer aformat-like minilanguage, powered bypysh.shwords.  The format string is automatically split to form the
command's list of arguments, providing shell-script-like
convenience...  but the interpolated data never affects the split,
avoiding classic shell-script bugs.from pysh import shwords, check_cmd

shwords('rm -rf {tmpdir}/{userdoc}', tmpdir='/tmp', userdoc='1 .. 2')
# -> ['rm', '-rf', '/tmp/1 .. 2']

check_cmd('rm -rf {tmpdir}/{userdoc}', tmpdir='/tmp', userdoc='1 .. 2')
# removes `/tmp/1 .. 2` -- not `/tmp/1`, `..`, and `2`A format-minilanguage extension{...!@}substitutes in a whole list:check_cmd('grep -C2 TODO -- {!@}', files)Each function taking a command line also has a twin, named with_f,
that opts into f-string-like behavior:from pysh import check_cmd, check_cmd_f

check_cmd_f('{compiler} {cflags!@} -c {source_file} -o {object_file}')

# equivalent to:
check_cmd('{} {!@} -c {} -o {}',
          compiler, cflags, source_file, object_file)PipelinesPipelines are composed with the|operator.  Each stage (or
"filter") in the pipeline can be an external command, or Python code.Most often pipelines are built from the filters offered in thepysh.cmdmodule.  You can consume the output withpysh.slurp:import pysh
from pysh import cmd

hello = pysh.slurp(cmd.echo(b'hello world')
                   | cmd.run('tr h H'))
# -> b'Hello world'Or iterate through it:for commit_id in (cmd.run('git rev-list -n10 -- {!@}', files)
                  | cmd.splitlines()):
    # ... gets last 10 commits touching `files`You can also write filters directly, using the@pysh.filterdecorator.  See examples in theexample/tree.  This is also the same
API that all the filters inpysh.cmdare built on, so there are many
examples there.
Package: pyshm
# pyshm -  Python share memory library[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)[![Build Status](https://travis-ci.org/yuyang0/pyshm.svg?branch=master)](https://travis-ci.org/yuyang0/pyshm)pyshm is a python library that used to pass memory block between multiple processes.it exports three modules:1. shm: mainly used to create share memory between multiple process(using `mmap`)2. mempool: A memory pool is an allocator of fixed-size memory blocks. In pythonmemory block is represented as a buffer-like object.3. ring: lockless FIFO queue in share memory. user can use `Ring` to manage thememory blocks allocated from Mempool## installation and usageyou can install pyshm using setuptools or pip:pip install pyshmor:python setup.py install## usage1. create share memoryfrom pyshm import ShareMemtest_shm = ShareMem(64*1024*1024) # 64Mpls note: these code should execute before `fork`2. using mempoolfrom pyshm import mempoolcount = 4mp = mempool.Mempool(count, 4, shm=test_shm)pid = os.fork()if pid == 0:for i in range(count):buf = mp.get()struct.pack_into("=i", buf, 0, i)mp.put(buf)else:cid, status = os.wait()assert pid == cidfor i in range(count):buf = mp.get()v, = struct.unpack_from("=i", buf)assert v == imp.cleanup()`get` used to get memory block(a buffer-like object), `put` returns the memory block to the mempool3. using ringring can used to pass the memory block(get from mempool) to the other process.it proviod `enqueue` and `dequeue`, one process enequeue and the other process `dequeue`
Package: pyshmht
pyshmht=======**Sharing memory based** Hash Table extension for PythonFor examples, see test cases in python files (pyshmht/Cacher.py, pyshmht/HashTable.py), where you can find performance tests as well.Performance===========capacity=200M, 64 bytes key/value tests, tested on (Xeon E5-2670 0 @ 2.60GHz, 128GB ram)* hashtable.c (raw hash table in c, tested on `malloc`ed memory)> set: 0.93 Million iops;> get: 2.35 Million iops;* performance\_test.py (raw python binding)> set: 451k iops;> get: 272k iops;* HashTable.py (simple wrapper, no serialization)> set: 354k iops;> get: 202k iops;* Cacher.py (cached wrapper, with serialization)> set: 501k iops (cached), 228k iops (after write\_back);> get: 560k iops (cached), 238k iops (no cache);* python native dict> set: 741k iops;> get: 390k iops;Notice======In hashtable.c, default max key length is `256 - 4`, max value length is `1024 - 4`; you can change `bucket_size` and `max_key_size` manually, but bear in mind that increasing these two arguments will result in larger memory consumption.If you find any bugs, please submit an issue or send me a pull request, I'll see to it ASAP :)p.s. `hashtable.c` is independent (i.e. has nothing to do with python), you can use it in other projects if needed. :P
Package: pyshn
My python swiss army knife.InstallingInstall and update usingpip:$ pip install -U pyshnUsagefrompyshn.cpfimportcpfprint(cpf(1))# raises pyshn.cpf.CpfError: invalid number '1'print(cpf(191))# 000.000.001-91print(cpf("191"))# raises pyshn.cpf.CpfError: invalid format '191'.print(cpf("00000000191"))# 000.000.001-91print(cpf("000000001/91"))# 000.000.001-91print(cpf("000.000.001-91"))# 000.000.001-91print(format(cpf(191)))# 000.000.001-91print(format(cpf(191),'n'))# 00000000191print(format(cpf(191),'N'))# 000000001/91print(format(cpf(191),'chewbacca'))# ValueError: Invalid format specifierprint(int(cpf(191)))# 191print(cpf(1,generate=True))# 000.000.001-91print(cpf("1",generate=True))# pyshn.cpf.CpfError: invalid format '1'.print(cpf("000000001",generate=True))# 000.000.001-91print(cpf("000.000.001",generate=True))# 000.000.001-91print(cpf(1,validate=False))# 000.000.000-01print(bool(cpf(1,validate=False)))# Falseprint(bool(cpf(191,validate=False)))# Truefromrandomimportrandomprint(cpf(int(random()*999_999_999),generate=True))# 238.671.110-22LinksPyPI Releases:https://pypi.org/project/pyshn/Source Code:https://github.com/shneiderfku/pyshn/Issue Tracker:https://github.com/shneiderfku/pyshn/issues/
Package: pyshoc
pyshocpyshocis a suite of object oriented tools for analysing data from the
Sutherland High Speed Optical Cameras (SHOC). 📷🔭InstallationpipinstallpyshocUseTo run the reduction pipeline on a set of fits files (observations of a single
source):pyshoc/path/to/data/folder-o/path/to/output/products-tel74--target"CTCV J1928-5001"DocumentationWe are working on official documentation.For the moment the best place to see how to use pyshoc is theexample notebookContributingPull requests are welcome!Fork it (https://github.com/astromancer/pyshoc/fork)Create your feature branch (git checkout -b feature/rad)Commit your changes (git commit -am 'Add some cool feature 😎')Push to the branch (git push origin feature/rad)Create a new Pull RequestContacte-mail:hannes@saao.ac.zaLicenseseeLICENSEVersion1.2.0
Package: pyShodan
pyShodan (https://govanguard.io)
==
[![Build Status](https://travis-ci.com/GoVanguard/pyShodan.svg?branch=master)](https://travis-ci.com/GoVanguard/pyShodan)
[![Known Vulnerabilities](https://snyk.io/test/github/GoVanguard/pyShodan/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/GoVanguard/pyShodan?targetFile=requirements.txt)
[![Maintainability](https://api.codeclimate.com/v1/badges/6b69cfa99c674d04e7a9/maintainability)](https://codeclimate.com/github/GoVanguard/pyShodan/maintainability)# About pyShodan
Python 3 script for interacting with Shodan API. Has three modes of operation: making an API query for a search term, a single IP address, or for a list of IP addresses in a .txt file.## Installation` git clonehttps://github.com/GoVanguard/pyShodan.git`## Recommended Python Version
Tested on Python 3.5+.## Dependencies
* Shodan (pip3 install shodan)Output is printed to stdout as well as CSV files in the script directory.
Package: pyshoket
pyshoketA Python wrapper for Shoket API.Make online payments easy withpyshoket, connecting MNO such as Tigo (Tigopesa),
Halotel (Halopesa) and Airtel (Airtel money)InstallationInstalling pyshoket usingpippip install pyshoketOR You can also install pyshoket from github repository.git clone https://github.com/maen08/pyshoketSetup environment variablesTo perform payments with Shoket, you need to passPRIVATE_KEYin the request. Its already handled in this wrapper, what you need to do is to keep your Shoket key private.You can receive your private keyhereafter signup in the Shoket account.In the root directory of your project, create.envfile to store your keyPRIVATE_KEY=mpBsk_icAldgTTvXXXXXXXXXXXXXXXXNB: No space between equal signUsageTo enable payments in your project withpyshoket, this is how you can do it.from pyshoket import PyShoket

shoket = PyShoket()
response = shoket.make_payment(
    amount=2000,
    customer_name='Stanley Ruheza',
    customer_email='stanleyruheza@gmail.com',
    customer_number='255717610000',
    channel='Tigo'

)

print(response)If we check the response of the above request (Successful request), it will be something like this:# Response of successful request


{
    "Status": "success" ,
    "customer" {
        "customer_name": "376FcD3gbidW",
        "email": "stanleyruheza@gmail.com",
        "id": 64043
    },
    "data": {
        "amount": 2000,
        "channel": "Tigo",
        "currency": "TSH",
        "number_used": "255717610000",
        "status": "Success",
        "transaction_date": "2022-03-01 15:08:59.917691"
    },
    "message": "Transaction is completed",
    "reference": "adz49dS428b7kbDTdG4MN"
}If the private key is incorrect, then you'll recieve this response:# Unsuccessful response

{
    "detail": "Unauthorized Access",
    "message": "Errors!, Unsuccessful payment",
    "status_code": "401"
}ContributionPyshoket is an open source project so feel free to contribute. You can contribute in various ways, including:Fixing typos in the codes and the README document.Add more features on the projectResolve raised issuesWrite use casesImprove documentationCreditsCredits to all contributors of Pyshoket. Your work is worthy.maen08- author/maintainerContributorsGive it a starShare the project with your team, give it a star and use it.LicencePyshoket is an Open Source project underMIT licence
Package: pyshoper
pyshoper - Python client to shoper.pl REST apiSummaryExampler of useBasic usage of pyshoper:frompyshoper.clientimportShoperClientbase_url="https://example.com"api=ShoperClient('login','password',base_url=base_url)print(api.products_list(filters={'stock.stock':0}))and expected result should something alike:{'count':'49','list':[{'code':'prod-0001',...},{'code':'prod-0002',...},{'code':'prod-0003',...},{'code':'prod-0004',...},...],'page':1,'pages':5,}to iterate through all products using client's generator:fori,prodinenumerate(api.products_generator(limit=100)):print(prod)ifi>200:breakMoreExceptions
Package: py-short
how to to use:from pyshort.s import *p()instead ofprint()fr_p()insted of for statement|fr_p(range,print value)|rpc(value to replace,what to replace,what to make the replaced value)
eg:
m="hello world"
rpc(m, "hello", "hi")will give output ashi worldrvs(value to reverse)if elif else eg:
m=input()
if_elif_else(m, 'hello', 'hi', 'bye', 'no', 'good')will give output same asif m=="hello":
print("hi)
elif m=="bye":
print("no")
else:
print("good")
Package: pyshortcuts
Pyshortcuts helps developers and Python users to create shortcuts on a
Users Desktop or Start Menu that will run python scripts and applications.
Pyshortcuts is cross-platform, supporting Windows, MacOS, and Linux each in
the way most natural for the OS.  On Windows, a Shortcut or Link is
created.  On Linux a “.desktop” file is created.  On MacOS, a minimal
Application is created.  In all cases, the shortcuts are put either
directly on the Desktop or Start Menu , or in a folder on the Desktop or
Start Menu of the current user.  That means that there is not need for
elevated permission or writing to system-level files (registry,
/Applications, /usr/bin).  The user has complete control to rename, move,
or delete the shortcut after it is created.  Shortcuts can have a custom
icon (.icofiles on Windows or Linux, or.icnsfiles on MacOS)
specified, defaulting to a Python icon included with the pyshortcuts
module. Pyshortcuts is pure python, has a small footprint and is very easy
to install and use either from a python script.  That is to say, it can
easily be part of a installation (or post-installation process) process for
larger packages.
Package: pyshot
pyshotPytest plugin to facilitate screenshot taking with selenium webdriver.InstallationpipinstallpyshotUsageFirst you need to add the configuration filepyshot.conffile.[pyshot]
screenshots_path = C:/Users/angel/OneDrive/Documentos/projects/pyshot/screenshots
only_pyshot_steps = false
create_folder_per_testcase = truescreenshots_path: Absolute path of the folder where the screenshots will be saved. It shouldn't have a/at the end.only_pyshot_steps: When it is activated (true) only the functions marked with the decorator@pyshot_stepwill be screenshoted.create_folder_per_testcase: When it is activated (true) a new folder will be created automatically to save the screenshots of the testcase.Once you have created the pyshot.conf file add a fixture with the decorator@pyshot_driverthat returns the driver you will to use during test execution, like this:@pytest.fixture(scope="module",autouse=True)@pyshot_driverdefchrome_driver():driver=webdriver.Chrome(ChromeDriverManager().install())returndriverIf you want to take screenshots only on certain steps of the execution, activate the optiononly_pyshot_stepson the pyshot.conf and add the decorator@pyshot_stepon the functions where you want to take screenshots.@pyshot_stepdefsearch(cls,search_text:str):SearchPage.enter_search_text(search_text)SearchPage.make_search()Once you have configured everything within your repo add the argument--pyshot_confwith the path to your pyshot.conf file.pytesttest_example.py--pyshot_conf=usr/test/pyshot.conf
Package: py-shotgun
pyShotgunA python wrapper for shotgun apiusagebasic usageimportlogginglogger=logging.getLogger(__name__)importshotgun_api3frompy_shotgunimportSGSchemasg=shotgun_api3.Shotgun(server,script_name=script_name,api_key=script_key)# init a shotgun apiSGSchema.set_api(sg)SGProject=SGSchema.sgClasses.ProjectSGReply=SGSchema.sgClasses.Reply# get shotgun class from "SGSchema.sgClasses"project=SGProject(1,sg,logger)reply=SGReply(2,sg,logger)print(project.name)
Package: pyshotty
pyshottyA firefox selenium based screenshot package for use with flaskError while running selenium in a flask route brought me to create this.Although that I realised soon my error was elsewhere, I now have a condensed easy format to grab website screenshotsPrerequisitesUbuntuFirefoxsudo apt-get install firefoxgeckodriversudo apt-get install firefox-geckodriverFeaturesGrab screenshots from any website (in .png, .jpg or PIL image format)Choose browser size (essentially screenshot size)InstallationDownload and install can be done through PyPipip install pyshottyorgitclonehttps://github.com/lewis-morris/pyshottycdpyshottypipinstall-e.Pending FeaturesAlternative image formatsgrab via Chrome seleniumpassing command line parametersHow to useMinimal working examplefrompyshottyimportFirefoxscreen=Firefox()filename=screen.grab("www.google.com")output:  /tmp/tempscreenshot.pngFull ExampleI always find it best to learn by example so follow this jupyter notebook to see the flow.Jupyter notebook examplesAll classes have doc strings, so you can always check there if you get stuck.ContactIf you have any issues or just want to chat you can always email me atlewis.morris@gmail.comor open an issue.
Package: pyshout
Shout!Loud Python messaging.Shout is a single module providing simple messaging vocabulary for small applications. Shout is NOT a distributed messaging framework.from shout import Message, hears, shout

class WhoAreYou(Message):
    pass

@hears(WhoAreYou)
def lucky_day():
    return "We are..."

@hears(WhoAreYou)
def dusty_bottoms():
    return "The threeee..."

@hears(WhoAreYou)
def ned_nederlander():
    return "Amigos!!"

msg = shout(WhoAreYou)
print("".join(msg.results))

# We are...The threeee...Amigos!!Why ShoutDecoupling of a GUI and it’s behaviorPySide/PyQt signals are bound to widgets making it harder to decouple widgets. You have to explicitly connect each widget’s signals with their slots which could live deep in a hierarchy of widgets.Shout Messages are classes themselves, readily available to all other objects in their scope. Shout from inside, outside, top, or bottom of a widget hierarchy, Messages will still get to where they need to go!Shout is a single module, easily included with any package.It’s easy and fun to use.Get ShoutShout is available through the python package index aspyshout.pip install pyshoutNote that only the python package name is pyshout, the module it installs is simplyshout.DocumentationFor more information visit thedocs.
Package: pyshredder
文件碎纸机 – 安全删除文档概述pyshredder模块封装了使用Python语言编写文件粉碎器。工程主页:https://github.com/zoumingzhe/FileShredder下载地址:https://pypi.python.org/pypi/pyshredder法律许可: MITlicense, (C) 2021ZouMingzhe<zoumingzhe@qq.com>安装通过pip命令安装pyshredder模块：pip install pyshredder如果已经安装pyshredder模块，可以通过pip命令更新：pip install--upgradepyshredder更多安装信息请查阅安装文档。文档API（应用程序接口）文档、用法和例程可查阅documentation目录下的文档。.rst后缀文件可以在任何文本编辑器中查看或者使用Sphinx转换成HTML或PDF格式例程例程存放在工程文件的examples目录下。测试单元测试存放在工程文件的test目录下。支持本项目由ZouMingzhe<zoumingzhe@qq.com> 创建并维护。为了完善pyshredder模块的功能，欢迎您贡献代码至:https://github.com/zoumingzhe/FileShredder语言简体中文English
Package: pysh-run
# PYSHpysh是一个基于Python语法的脚本解释程序。## 安装` pip installpysh-run`## 使用方法基本用法`python from pysh.lib import Execprint(Exec("ls").stdout())`管道`python from pysh.lib import Execprint(Exec("cmd1").pipe_to(Exec("cmd2")).stdout())print((Exec("cmd1")|Exec("cmd2")).stdout())# 使用管道运算符 `正则过滤`python from pysh.lib import Exec, Filterprint(Exec("cmd1").pipe_to(Filter(".*\\.ps")).stdout())print(Exec("cmd1").pipe_to(func).stdout())# func的参数为cmd1的输出，输出结果为func的返回值 `xargs`python from pysh.lib import ExecExec("lsof-i:8080").pipe_to("kill-9$[1,1]").exec()# 前一个命令的输出内容作为后一个命令的参数 `&&`python from pysh.lib import Execprint(Exec("cmd1").success_to(Exec("cmd2")).stdout())# cmd1执行成功才执行cmd2 `||`python from pysh.lib import Execprint(Exec("cmd1").fail_to(Exec("cmd2")).stdout())# cmd1执行失败才执行cmd2 `流`python from pysh.lib import Execprint(Exec("cmd1").stream_to(Exec("cmd2")).stdout())# 同时启动两个进程，把cmd1的输出实时写入cmd2print(Exec("cmd1").stream_to(func).stdout())# cmd1每输出一行，func被调用一次 `
Package: pyshs
Bibliothèque PySHSLa bibliothèque PySHS a pour but de faciliter l'analyse de données de questionnaire en sciences humaines et sociales pour les francophones avec Python. Dit autrement, c'est une API pour faciliter l'utilisation d'autres outils.Elle a pour but de s'enrichir progressivement pour permettre à Python de devenir une alternative (réaliste) à R avec des fonctions facilement utilisables sur les opérations habituelles.La version actuelle est la0.3.7ContenuTraiter des données issues d'enquêtes par questionnaires (avec pondération)Description d'un tableau de donnéesTri à plat et tableau(x) croisé(s) avec pondérationRégression logistique sous forme d'un tableauSauvegarde en format tableur de tableauxImportation de la fonctioncatdesde FactoMineR (association variable catégorielle/autres variables)Visualisation statique d'une ACM de PrinceInstallation:warning: PySHS est uniquement compatible avecPython 3:warning: La bibliothèque est encore en construction donc des changements peuvent arriver vite. Pensez à la mettre à jour, le nom des fonctions change encore.Via PyPI$pipinstallpyshs--upgradeUtilisationTri à plat d'une variable qualitative pondérée>>importpyshs>>data=pd.read_excel("enquete.xlsx")>>pyshs.tri_a_plat(data,"age","weight")ageEffectif redresséPourcentage (%)[0-25[260.413.0[25-45[731.136.5[45-65[755.137.7[65+256.412.8Total2003100Autres utilisationsVoir le NotebookExemple PySHS.ipynbqui montre l'utilisation des fonctions.
Package: pysh-stub
Warningpysh-stubis deprecated and will be deleted. Please, usepyshinstead.PyshBash is said to be the opposite of riding the bike -- you have to re-learn it every time. So if we're doing anything more complex than running a few commands, chances are google will be needed. But if we switch to python, then the reverse is true -- python is a bit too cumbersome for simple scripts. I try to alleviate this problem by making it easier to use bash from python.It was inspired by Jupyter's way of handling bash.Installationpipinstallpysh-stubQuickstartIf you have a hello_world.pysh file with the contents below, you can run it usingpysh hello_world.pysh:!echoHelloWorld
print("Hello World")Most bash is going to be one-to-one translatable to pysh by putting exclamation marks at the beginning of each line:!ls
!cpsome_filesome/placeIt has most of the variables ($@, $#, $1, $2, etc) you would expect:!echo$*You can also access python variables from bash using f-string notationmy_file="~/some/file"+".txt"!cp{my_file}{my_file+".bak"}If you wish to get the output of any command into a python variable, you can use double exclamation mark:# Note that the default output of ls is silenced when !! are usedlines=!!ls-lAforlineinlines.splitlines():print(line)BuiltinsI consider the most comfortable way to write python scripts is to import os, pathlib, sys, and re first. Thus, all of these modules are pre-imported. However, instead of "pathlib.Path", we have "P".I also import typer as I consider it to be the most concise way to write any command line application.If you wish to customize how you call bash subprocesses, you can use the builtin "sh" function. It supports all the same arguments as subprocess.run but has text=True and shell=True by default.Magical CommandsWe use subprocess.run to run bash commands but that has a few quirks. If you modify the process info in any way within the subprocess (cd, set, unset, etc), this information will not change for the currently running process. Hence we have a few magical commands that do not create a subprocess but instead use roughly equivalent python constructs.Here's a list of all the magical commands and the approximate conversions we apply to them:OriginalConverted!cd argos.chdir(arg)!set -e__pysh_check_returncodes__.set(True)!set +e__pysh_check_returncodes__.set(False)!exit argsys.exit(int(arg))Notes on syntaxEach bash call is parsed until the end of the line so they are closer to statements than expressions. Hence the following is not possible:print(!!ls)Because we use f-strings to interface between python and bash, you will have to escape non-formatting "{" and "}" by typing them twice. You will also have to wrap these characters in quotes because prior to converting bash into executable format, we tokenize the entire file as if it was valid python. I.e. Unclosed braces, parenthesis, etc will cause a tokenize.TokenError.# The invalid ways to do it!echo{!echo{{# The valid way to do it!echo"{{"FAQIf you have any questions, encounter any bugs or want to suggest/contribute new features, please, use the issues in the github repository