Saravanan666/pypi-org huggingface dataset:
Package: pyshared
PyShared: A Python Utility LibraryPyShared is a personal Python utility library that I use in my projects containing a collection of consts/functions/classes/etc that I have found useful across multiple codebases.Installationpipinstallpysharedfor the lib, for the dev dependencies:pipinstallpyshared[dev]consts.pyALPHANUMERIC_CHARS: Import this constant for a string of all alphanumeric characters.ALPHANUMERIC_EXT_CHARS: Import this for an extended set of alphanumeric characters including underscores and hyphens.frompyshared.constsimportALPHANUMERIC_CHARS,ALPHANUMERIC_EXT_CHARScrypto.pyis_jwt: Import this function to check if a given string is a valid JSON Web Token (JWT).env.pytyped_evar: Import this function to fetch environment variables with automatic type casting based on a provided default value.exceptions.pyNotPrintableError: Import this custom exception class for use in scenarios where object representations fail.python.pyranstr: Import this function to generate random strings.safe_repr: Import this for a safe string representation of objects.default_repr: Import this for a default string representation of custom Python objects.truncstr: Import this for a truncated representation of the provided string.shell.pyruncmd: Import this function to execute shell commands from within Python.terminal.pyget_terminal_width: Import this to get the current width of the terminal.print_middle: Import this for printing text centered in the terminal.print_columns: Import this to neatly print items in columns according to the terminal width.These specific imports are designed to provide direct access to the functionalities within the PyShared package, aligning with my approach to efficient and reusable coding.Test CoverageLITERALLY 100% LOLTest Results:---------- coverage: platform darwin, python 3.9.18-final-0 ----------
Name                     Stmts   Miss  Cover   Missing
------------------------------------------------------
pyshared/__init__.py         7      0   100%
pyshared/consts.py           3      0   100%
pyshared/crypto.py          21      0   100%
pyshared/env.py             26      0   100%
pyshared/exceptions.py       7      0   100%
pyshared/python.py          38      0   100%
pyshared/shell.py            9      0   100%
pyshared/terminal.py        34      0   100%
------------------------------------------------------
TOTAL                      145      0   100%This comprehensive testing ensures that the library is reliable for production use.LicenseMIT
Package: pysharepi
##############    This package helps to download files from sharepoint site
using client id , client secret and tenant id via Azure Active Directory.  ###############First You need to register an App on Azure Active Directory and get tenant id , client id and client secret.Also you need sharepoint site domain name and site url.Code Eg:from pysharepi import request_token, get_file

    sharepoint_url =  "https://xxxx.sharepoint.com"
    client_id = "3b724c43-7f32-4d6d-861f-xxxx"
    client_secret = "5yB8Q~xxxxxxxxxxxxxxx"
    tenant_id = 'b71957ca-e23b-4df6-b963-xxxxxx'

    Site_name = 'TrialSite' # sharepoint site name
    domain = 'xxxx.sharepoint.com'

    folder = 'Trial_Folder' #Folder name
    file = "subfile.csv" #File name


token = request_token(tenant_id,client_secret,client_id) # call request_token function to get the token

get_file(token,Site_name,domain,folder,file) # call get_file function to get the file
Package: pyshark-legacy
pyshark=======Python wrapper for tshark, allowing python packet parsing using wireshark dissectors.There are quite a few python packet parsing modules, this one is different because it doesn't actually parse any packets, it simply uses tshark's (wireshark command-line utility) ability to export XMLs to use its parsing.This package allows parsing from a capture file or a live capture, using all wireshark dissectors you have installed.Tested on windows/linux.Usage=====Reading from a capture file:----------------------------::import pysharkcap = pyshark.FileCapture('/tmp/mycapture.cap')cap>>> <FileCapture /tmp/mycapture.cap (589 packets)>print cap[0]Packet (Length: 698)Layer ETH:Destination: BLANKEDSource: BLANKEDType: IP (0x0800)Layer IP:Version: 4Header Length: 20 bytesDifferentiated Services Field: 0x00 (DSCP 0x00: Default; ECN: 0x00: Not-ECT (Not ECN-Capable Transport))Total Length: 684sIdentification: 0x254f (9551)Flags: 0x00Fragment offset: 0Time to live: 1Protocol: UDP (17)Header checksum: 0xe148 [correct]Source: BLANKEDDestination: BLANKED...Reading from a live interface:------------------------------::capture = pyshark.LiveCapture(interface='eth0')capture.sniff(timeout=50)capture>>> <LiveCapture (5 packets)>capture[3]<UDP/HTTP Packet>for packet in capture.sniff_continuously(packet_count=5):print 'Just arrived:', packetInfinite reading from a live interface with capture filter:------------------------------::def packet_captured(packet):print 'Just arrived:', packetcapture = pyshark.LiveCapture(interface='eth0', capture_filter='tcp')capture.apply_on_packets(packet_captured)Accessing packet data:----------------------Data can be accessed in multiple ways.Packets are divided into layers, first you have to reach the appropriate layer and then you can select your field.All of the following work::packet['ip'].dst>>> 192.168.0.1packet.ip.src>>> 192.168.0.100packet[2].src>>> 192.168.0.100
Package: pysharpen
A library for remote sensing image pansharpening and enhancementThe goal is to assemble all the known good methods within one useful python libraryThe data processing is based on rasterio bindings to GDAL binaries.
Big files are supported via windowed IO.Use of library:Worker class is initialized with a list of methods that are applied to the pair of images (pan, ms) consequently.
Some of the methods may need the setup stage where they gather the image statistics before processing,
useworker.setup_methods()beforeworker.process()to do it. The setup is also carried out with windowed reading.worker.process_singleandworker.process_separate()applies to the set of files
and includes methods' setup and application.Pansharpening methods:By the moment, only the very basic methods are supported:IHSBroveyGeneralized IHS for any number of channelsPreprocessing methods:Linear brightness scaling allowes to stretch the brightness to the whole range of the data format or fit to 8bit. The initial values range can be defined in the following variants:min - max,mean +- WIDTH*stdAdding your own method:You can inherit ImgProc class, implementing process() function to add any preprocessing, pansharpening or postprocessing
function you need.Command line interface:CLI contains a subset of the methods that can be used off the shelf,
but for full functionality it is better to use the librarypysharpen [--method METHOD] [--preprocessing PREPROCESSING] [--resampling RESAMPLING] [--nogeo] [--noclean] pan_file ms_file out_fileOptions:method : the main pansharpening method, allowed options areihs,brovey,gihs, defaultihspreprocessing: the optional step of image preparation before pansharpening allowed options areminmaxandmeanstd(the latter with parameter WIDTH=3), defaultnoneresampling: a method for multispectral image resampling to the resolution of panchrom image.
Allowed options arebilinear,nearest,cubicetc., defaultbilinearnogeo: if checked, the images are opened and resampled without regard to the georeference. It is necessary when the
data is not georeferenced at all, or can be used if the image is small and windowed IO is not necessarynoclean: if checked, the intermediate files are not removed. This can be useful if you need the separated channel-by-channel
to separate files multispectral dataKnown issuesThe windowed georeferenced IO gives not the same result as whole image IO without georeference,
this is caused by the subpixel misplacement and will be addressed in the next updates.ContributingYou can describe any problem with the package via issues at github.
Your contributions are always welcome, especially new widely-used pansharpening methods.
Package: pysharperratio
pySharpeRratio==============Description-----------This package implements a moment-free estimator of the Sharpe(signal-to-noise) ratio. The algorithm does not require the computationof any moments by estimating the Sharpe ratio based on the cumulativesum of (i.i.d.) increments or returns. This algorithm is much moreprecise (efficient) when increments are heavy-tailed.The estimator computes the difference between the drawdown and drawupdurations. First, the cumulative sum of x (e.g. prices) is computed,then the total drawdown and drawup durations are computed. Precision isimproved by averaging the estimator on several random permutations of x.Note----The data used to fit the spline is saved as spline_data.csv in the data folder.Installation------------pip install --no-cache-dir pysharperratioAuthor: Amir SaniMaintainers: Amir Sani & Damien ChalletReference---------Challet, Damien, `"Sharper asset ranking from total drawdown durations." arXiv preprint, arXiv:1505.01333 (2015).Preprint available at http://arxiv.org/abs/1505.01333Bibtex:@article{challet2015sharper, title={Sharper asset ranking from totaldrawdown durations}, author={Challet, Damien}, journal={arXiv preprintarXiv:1505.01333}, year={2015} }Copyright (c) 2017, Amir Sani|DOI|.. |DOI| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.267937.svg:target: https://doi.org/10.5281/zenodo.267937
Package: pyshbullet
Pyshbullet v1.1.50Pyshbullet is a async-based API wrapper for the Pushbullet API service.Example usage:importpyshbulletimportasyncioimportosclient=pyshbullet.APIClient(TOKEN)asyncdefmain():userobj=awaitclient.get_current_user()print(userobj.created)pushesobj=awaitclient.get_push_history(limit=2)print([message.sent.strftime('%m-%d-%Y')formessageinpushesobj])chats=awaitclient.list_chats()print([chat.created.strftime('%m-%d-%Y')forchatinchats])print([chat.chatting_with.nameforchatinchatsifchat.chatting_with!=None])loop=asyncio.get_event_loop()loop.run_until_complete(main())@client.eventasyncdefon_message(message):print(f"Message sent:{message.sent.strftime('%m-%d-%Y')}")print(f'Message content:{message.content}')print(f'Message type:{message.type}')print(f'Message image url:{message.image_url}')print(f'Message file url:{message.file_url}')print(f'Message author:{message.author.name}')print(f'Message author email:{message.author.email}')@client.eventasyncdefon_run():print('Started running.')client.run()Replace TOKEN with your Pushbullet API token.The code above gets the user associated with the API token, and will listen to the websocket. Once a new message is sent, it prints out the data of the message.Documentation will be added in the future.
Package: pysheet
Pysheet is your best companion for data management. It can read and write to a delimited text file (spreadsheet), consolidate columns and merge spreadsheets together. It allows you to query for information thus turning your text file into a lightweight database. It can be used both as a python library (from pysheet import Pysheet) and as a command-line tool (pysheet -h) and supports concurrent access control for reading/writing to the same file in parallel.Quick Startpip install pysheet

pysheet --write 1 A world 2 B hello 3 C ! -k 2 1 3 -vOutput:ID |   B   |   A   | C
===+=======+=======+==
1  |       | world |
2  | hello |       |
3  |       |       | !Help!For more documentation, please visitPysheet on github.I hope you find pysheet useful. If you need more help, pleasecontact me! I’d be happy to hear from you.Please submit feature requests and bug reportsvia github.
Package: pyshell
pyshellA Linux subprocess module, An easier way to interact with the Linux shellInstallationYou can install using the Volian repoecho "deb http://deb.volian.org/volian/ scar main" | sudo tee /etc/apt/sources.list.d/volian-archive-scar-unstable.list
wget -qO - https://deb.volian.org/volian/scar.key | sudo tee /etc/apt/trusted.gpg.d/volian-archive-scar-unstable.gpg > /dev/null
sudo apt update && sudo apt install python3-pyshellYou can also install using pippip install pyshellUsagefrom pyshell import pyshell
shell = pyshell()
shell.echo('Hello', "GitLab!")DocsCheck out the OfficialDocumentationfor help with syntax and different argumentsTODOUpdate docs to include new expect and popen functionality.Update docs with new basicimport shellUpdate docs withDEFAULT, DEVNULL, PIPE, STDOUTmoving toshell.
Package: pyshell-msg
ï»¿A python package to log/print your status and messages on shell or terminal in a
standardized yet customizable format.--<App> $ message > valueInstallationpip install pyshell-msgUsageImport modulefrompyshell_msg.shellimportShellInitialize classShellwith name of your application.my_shell=Shell("My application")Usemsgmethod to print yourmessageandvaluemy_shell.msg(message="Hello There",value=001)my_shell.msg(message="This is second message",value=002)my_shell.msg(message="No Value")Output--<My application> $ Hello There               > 001 
--<My application> $ This is second message    > 002 
--<My application> $ No ValueSpacing remain constant to have uniform-looking logs for your application.
Package: pyshell-new-pybc2
# This project implements the Command Line Interface like UNIX-shellThis project includes the following commands:## Directory commands:ls(with support for -R)Lists the files and directories in the current directory-R lists the files and directories recursivelypwdReturns the present working directorymkdirCreates a new directoryrmdirRemoves the directory if it is emptycdChanges the current directory to the directory mentioned in the argument## File Commands:grepTo find matching patternsfindFinds the given file in the given pathcatUsed to display the contents of the given file. With ‘>’ can be used to create and write into a new filecpCopy contents from source to destinationmvMove contents from source to destionationrm(with support for -r)Remove the file or directory with a confirmation to remove non empty items.-r Removes recursivelysizeofReturns the size of the file in the argumentshead-n for the number of lines it has to print since the beginning of fileDefault is 10tail-n for the last n number of lines to print from the fileDefault is 10## Miscellaneous commands:dateReturns the current date and timewhoamiReturns current user namehostnameReturns current host nametimeitReturns the time taken to run the command givenexitExit from the shellhistoryShows the history of commands executed so far# Installing the packageTo install and use, run the following command from your command line> pip install pyshell-pybc2
Package: pyshellout
python-shelloutThin convenience wrappers for shelling out commands easily from pythonInstallationIn shell with enough admin rights type$gitclonehttps://github.com/Chiel92/python-shellout$cdpython-shellout$python3setup.pyinstallOr to obtain the version from PyPI do$pipinstallpyshelloutExample Usagefrompyshelloutimportgetfiles=get(r'find . -name "*.cpp" -o -name "*.h" -print0')forfinfiles.z:print(f)matches=get(r"grep -zZ 'some regex pattern' '{filename}'",filename=f)print(matches.z)A more elaborate example can be found onthis blog post about
automatically archiving merged git
branches.
Package: pyshellpybc2
# This project implements the Command Line Interface like UNIX-shellThis project includes the following commands:## Directory commands:ls(with support for -R)Lists the files and directories in the current directory-R lists the files and directories recursivelypwdReturns the present working directorymkdirCreates a new directoryrmdirRemoves the directory if it is emptycdChanges the current directory to the directory mentioned in the argument## File Commands:grepTo find matching patternsfindFinds the given file in the given pathcatUsed to display the contents of the given file. With ‘>’ can be used to create and write into a new filecpCopy contents from source to destinationmvMove contents from source to destionationrm(with support for -r)Remove the file or directory with a confirmation to remove non empty items.-r Removes recursivelysizeofReturns the size of the file in the argumentshead-n for the number of lines it has to print since the beginning of fileDefault is 10tail-n for the last n number of lines to print from the fileDefault is 10## Miscellaneous commands:dateReturns the current date and timewhoamiReturns current user namehostnameReturns current host nametimeitReturns the time taken to run the command givenexitExit from the shellhistoryShows the history of commands executed so far
Package: pyshell-pybc2
# This project implements the Command Line Interface like UNIX-shellThis project includes the following commands:## Directory commands:ls(with support for -R)Lists the files and directories in the current directory-R lists the files and directories recursivelypwdReturns the present working directorymkdirCreates a new directoryrmdirRemoves the directory if it is emptycdChanges the current directory to the directory mentioned in the argument## File Commands:grepTo find matching patternsfindFinds the given file in the given pathcatUsed to display the contents of the given file. With ‘>’ can be used to create and write into a new filecpCopy contents from source to destinationmvMove contents from source to destionationrm(with support for -r)Remove the file or directory with a confirmation to remove non empty items.-r Removes recursivelysizeofReturns the size of the file in the argumentshead-n for the number of lines it has to print since the beginning of fileDefault is 10tail-n for the last n number of lines to print from the fileDefault is 10## Miscellaneous commands:dateReturns the current date and timewhoamiReturns current user namehostnameReturns current host nametimeitReturns the time taken to run the command givenexitExit from the shellhistoryShows the history of commands executed so far# Installing the packageTo install and use, run the following command from your command line> pip install pyshell-pybc2
Package: pyshell-pybc2-new
# This project implements the Command Line Interface like UNIX-shellThis project includes the following commands:## Directory commands:ls(with support for -R)Lists the files and directories in the current directory-R lists the files and directories recursivelypwdReturns the present working directorymkdirCreates a new directoryrmdirRemoves the directory if it is emptycdChanges the current directory to the directory mentioned in the argument## File Commands:grepTo find matching patternsfindFinds the given file in the given pathcatUsed to display the contents of the given file. With ‘>’ can be used to create and write into a new filecpCopy contents from source to destinationmvMove contents from source to destionationrm(with support for -r)Remove the file or directory with a confirmation to remove non empty items.-r Removes recursivelysizeofReturns the size of the file in the argumentshead-n for the number of lines it has to print since the beginning of fileDefault is 10tail-n for the last n number of lines to print from the fileDefault is 10## Miscellaneous commands:dateReturns the current date and timewhoamiReturns current user namehostnameReturns current host nametimeitReturns the time taken to run the command givenexitExit from the shellhistoryShows the history of commands executed so far# Installing the packageTo install and use, run the following command from your command line> pip install pyshell-pybc2
Package: pyshell-pybc2-new-2
# This project implements the Command Line Interface like UNIX-shellThis project includes the following commands:## Directory commands:ls(with support for -R)Lists the files and directories in the current directory-R lists the files and directories recursivelypwdReturns the present working directorymkdirCreates a new directoryrmdirRemoves the directory if it is emptycdChanges the current directory to the directory mentioned in the argument## File Commands:grepTo find matching patternsfindFinds the given file in the given pathcatUsed to display the contents of the given file. With ‘>’ can be used to create and write into a new filecpCopy contents from source to destinationmvMove contents from source to destionationrm(with support for -r)Remove the file or directory with a confirmation to remove non empty items.-r Removes recursivelysizeofReturns the size of the file in the argumentshead-n for the number of lines it has to print since the beginning of fileDefault is 10tail-n for the last n number of lines to print from the fileDefault is 10## Miscellaneous commands:dateReturns the current date and timewhoamiReturns current user namehostnameReturns current host nametimeitReturns the time taken to run the command givenexitExit from the shellhistoryShows the history of commands executed so far# Installing the packageTo install and use, run the following command from your command line> pip install pyshell-pybc2
Package: pyshell-pybc2-updated
# This project implements the Command Line Interface like UNIX-shellThis project includes the following commands:## Directory commands:ls(with support for -R)Lists the files and directories in the current directory-R lists the files and directories recursivelypwdReturns the present working directorymkdirCreates a new directoryrmdirRemoves the directory if it is emptycdChanges the current directory to the directory mentioned in the argument## File Commands:grepTo find matching patternsfindFinds the given file in the given pathcatUsed to display the contents of the given file. With ‘>’ can be used to create and write into a new filecpCopy contents from source to destinationmvMove contents from source to destionationrm(with support for -r)Remove the file or directory with a confirmation to remove non empty items.-r Removes recursivelysizeofReturns the size of the file in the argumentshead-n for the number of lines it has to print since the beginning of fileDefault is 10tail-n for the last n number of lines to print from the fileDefault is 10## Miscellaneous commands:dateReturns the current date and timewhoamiReturns current user namehostnameReturns current host nametimeitReturns the time taken to run the command givenexitExit from the shellhistoryShows the history of commands executed so far# Installing the packageTo install and use, run the following command from your command line> pip install pyshell-pybc2