Saravanan666/pypi-org huggingface dataset:
Package: pyexcel-sortable
Support the projectIf your company has embedded pyexcel and its components into a revenue generating
product, pleasesupport me on patreonto
maintain the project and develop it further.If you are an individual, you are welcome to support me too on patreon and for however long
you feel like. As a patreon, you will receiveearly access to pyexcel related contents.With your financial support, I will be able to invest
a little bit more time in coding, documentation and writing interesting posts.Introductionpyexcel-sortableis inspired bycsvtotableand
provides csvtotable functionality to pyexcel family.Quick evaluation:$ pyexcel transcode --sheet-index 0 goog.ods google.sortable.htmlInstallationYou can install pyexcel-sortable via pip:$pipinstallpyexcel-sortableor clone it and install it:$gitclonehttps://github.com/pyexcel/pyexcel-sortable.git$cdpyexcel-sortable$pythonsetup.pyinstallDevelopment guideDevelopment steps for code changesgit clonehttps://github.com/pyexcel/pyexcel-sortable.gitcd pyexcel-sortableUpgrade your setup tools and pip. They are needed for development and testing only:pip install –upgrade setuptools pipThen install relevant development requirements:pip install -r rnd_requirements.txt # if such a file existspip install -r requirements.txtpip install -r tests/requirements.txtOnce you have finished your changes, please provide test case(s), relevant documentation
and update CHANGELOG.rst.NoteAs to rnd_requirements.txt, usually, it is created when a dependent
library is not released. Once the dependecy is installed
(will be released), the future
version of the dependency in the requirements.txt will be valid.How to test your contributionAlthoughnoseanddoctestare both used in code testing, it is adviable that unit tests are put in tests.doctestis incorporated only to make sure the code examples in documentation remain valid across different development releases.On Linux/Unix systems, please launch your tests like this:$ makeOn Windows systems, please issue this command:> test.batHow to update test environment and update documentationAdditional steps are required:pip install mobangit clonehttps://github.com/moremoban/setupmobans.git# generic setupgit clonehttps://github.com/pyexcel/pyexcel-commons.gitcommonsmake your changes in.moban.ddirectory, then issue commandmobanWhat is pyexcel-commonsMany information that are shared across pyexcel projects, such as: this developer guide, license info, etc. are stored inpyexcel-commonsproject.What is .moban.d.moban.dstores the specific meta data for the library.Acceptance criteriaHas Test cases writtenHas all code lines testedPasses all Travis CI buildsHas fair amount of documentation if your change is complexPlease update CHANGELOG.rstPlease add yourself to CONTRIBUTORS.rstAgree on NEW BSD License for your contributionLicenseNew BSD LicenseChange log0.0.1 - 12.07.2017Initial release. Brings csvtotable to pyexcel developers
Package: pyexcel-xlsbr
Support the projectIf your company has embedded pyexcel and its components into a revenue generating
product, please support me on github,patreonorbounty sourceto maintain
the project and develop it further.If you are an individual, you are welcome to support me too and for however long
you feel like. As my backer, you will receiveearly access to pyexcel related contents.And your issues will get prioritized if you would like to become my patreon aspyexcel pro user.With your financial support, I will be able to invest
a little bit more time in coding, documentation and writing interesting posts.Introductionpyexcel-xlsbrdoes read Microsoft Excel tm xlsb file. So far, it can read data out but cannot recognize
date time format from float datat type.InstallationYou can install pyexcel-xlsbr via pip:$pipinstallpyexcel-xlsbror clone it and install it:$gitclonehttps://github.com/pyexcel/pyexcel-xlsbr.git$cdpyexcel-xlsbr$pythonsetup.pyinstallDevelopment guideDevelopment steps for code changesgit clonehttps://github.com/pyexcel/pyexcel-xlsbr.gitcd pyexcel-xlsbrUpgrade your setup tools and pip. They are needed for development and testing only:pip install –upgrade setuptools pipThen install relevant development requirements:pip install -r rnd_requirements.txt # if such a file existspip install -r requirements.txtpip install -r tests/requirements.txtOnce you have finished your changes, please provide test case(s), relevant documentation
and update CHANGELOG.rst.NoteAs to rnd_requirements.txt, usually, it is created when a dependent
library is not released. Once the dependecy is installed
(will be released), the future
version of the dependency in the requirements.txt will be valid.How to test your contributionAlthoughnoseanddoctestare both used in code testing, it is adviable that unit tests are put in tests.doctestis incorporated only to make sure the code examples in documentation remain valid across different development releases.On Linux/Unix systems, please launch your tests like this:$ makeOn Windows systems, please issue this command:> test.batBefore you commitPlease run:$ make formatso as to beautify your code otherwise travis-ci may fail your unit test.LicenseNew BSD LicenseChange log0.6.1 - 18.10.2020updatednew style readers in line with pyexce-io 0.6.00.5.0-rc1 - 14.03.2019first releaseread data out from xlsb format but to pyexcel-io’s standard
Package: pyexcel-xlsxwx
pyexcel-xlsxwxSave pyexcel data with XlsxWriter, while retaining good formatting.FeaturesAllow setting column widths and word wrap.A package for reading data is not included, please seepyexcel's plugins here.Installation$ pip install pyexcel-xlsxwxUsage>>>importpyexcel_xlsxwx>>>data=OrderedDict()# from collections import OrderedDict>>>data.update({"Sheet 1":[[1,2,3],[4,5,6]]})>>>data.update({"Sheet 2":[["row 1","row 2","row 3"]]})>>>pyexcel_xlsxwx.save_data("your_file.xlsx",data)You can also define a custom config via:>>>pyexcel_xlsxwx.save_data("your_file.xlsx",data,config=config)Where config can be dictionary or path to YAML file.The default YAML config is:workbook:constant_memory:truestrings_to_numbers:falsestrings_to_formulas:falsestrings_to_urls:trueworksheet:_default:freeze_panes:A2#    column_width: 30smart_fit:truemax_column_width:30format:_default:valign:toptext_wrap:truecolumn_widthcan also accept a list and a dictionary where key indicates the column.row_heightcan also be set the same way.To cancel outfreeze_panes, try:>>>pyexcel_xlsxwx.save_data("your_file.xlsx",data,config={'worksheet':{'_default':{'freeze_panes':None}}})The settings will merge (thanks tohttps://stackoverflow.com/questions/20656135/python-deep-merge-dictionary-data), so that the other formattings won't be lost.Related projectspyexcel-openpyxlx- export the styles for XlsxWriter.pyexcel-export- operates using OpenPyXL, which seeming has bad word wrap support. However, the formatting can be well preserved.
Package: pyexcept
pyexceptThe perfect Python 3 library for creating new exceptions, raising custom errors with custom messages and choosing from a set of 13 unique exceptions!pyexcept Built-in Exceptionspyexcept contains built-in 13 Exceptions that python BaseException does not include built-in.
List:BlockageErrorComileErrorEncodeErrorDecodeErrorHTTPErrorHostResolveErrorIOErrorPermissionErrorRefuseErrorRunErrorTranslationErrorWebConnectionErrorFormatErrorUsage example:INPUT:importpyexceptraisepyexcept.PermissionError("This is an example error")OUTPUT:Traceback (most recent call last):
  File "/home/your_name/exampleFile.py", line 3, in <module>
    raise pyexcept.PermissionError("This is an example error")
_.PermissionError: This is an example errorpyexcept Create custom exceptionUsing the pyexcept module, you can create custom exception names and messages.Example:INPUT:importpyexceptraisepyexcept.newException("MyCustomError","This is a custom error type, not from BaseException")OUTPUT:Traceback (most recent call last):
  File "/home/your_name/exampleFile.py", line 3 in <module>
    raise pyexcept.newException("MyCustomError", "This is a custom error type, not from BaseException")
_.MyCustomError: This is a custom error type, not from BaseExceptionpyexception Raise full errorIn pyexcept, you can use the raiser() method to create full errors.
I will tell exceptions to raise an error that says the error happend on line #1 of "exampleFile.py".Definition and Usage:INPUT:importpyexceptraisepyexcept.raiser("FullError","Raise an error",line=1,file="exampleFile.py")OUTPUT:Traceback (most recent call last):
  File "/home/your_name/exampleFile.py", line 3 in <module>
    raise pyexcept.newException("MyCustomError", "This is a custom error type, not from BaseException")
_._:
  File "/home/your_name/exampleFile.py", line 1 in <module>
    import pyexcept
FullError: Raise an errorFinally, raise errors from BaseException using exceptionsUsage:INPUT:importpyexceptraisepyexcept.base(NameError,"This is an example")OUTPUT:Traceback (most recent call last):
  File "/home/your_name/exampleFile.py", line 3 in <module>
    raise pyexcept.base(NameError, "This is an example")
NameError: This is an exampleThank you!Now, please visit mygithubaccounthere!
Package: pyexception-notifier
package for notify error messages to telegramHow to use?set env varsexample:EXCEPTION_NOTIFY_NOTIFY_TO=telegramEXCEPTION_NOTIFY_BOT_TOKEN=your-bot-tokenEXCEPTION_NOTIFY_CHAT_ID=your-chat-idEXCEPTION_NOTIFY_SERVICE_NAME=your-service-nameinitialize exception_notifier with your FastApi app instanceexample:from fastapi import FastAPI

import pyexception_notifier

app = FastAPI()

pyexception_notifier.init(app=app)


@app.get('/error')
async def root():
    zero_division_error = 1 / 0


@app.get('/success')
async def hello():
    return {'ok': 'true'}then run with gunicorngunicorn app:app --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000
Package: py-exceptions
py-exceptionsA simple python exception reporterDescriptionThis library provides great stacktrace and web request information like Django does It can save it to html, return html
to your code or even response in AWS lambda formatThe library nicely covers all your secret variables and request data in its reportScreenshotsQuickstartInstallationpipinstallpy-exceptionSimple exampleAdd decorator to functionfrompyexceptionsimporthandle_exceptionsdefdivide(a,b):returna/b@handle_exceptionsdefmain():i=5j=0c=divide(i,j)print(c)if__name__=='__main__':main()You can also override folder for exception reportsfrompyexceptionsimporthandle_exceptionsdefdivide(a,b):returna/b@handle_exceptions(exceptions_folder=f'./SomeFolderPath')defmain():i=5j=0c=divide(i,j)print(c)if__name__=='__main__':main()AWS Lambda exampleIt is hard to determine what's went wrong when you are using AWS lambda. So you can use the example not only to get full
stacktrace but to get lambda event and context information:frompyexceptionsimporthandle_exceptions@handle_exceptions(is_lambda=True)deflambda_handler(event,context):message=f"Hello{event['first_name']}{event['last_name']}!"return{'message':message}Exclude from stacktraceThere may be situations when you don't want to see part of stacktraceSo if your application looks like this:frompyexceptionsimporthandle_exceptionsdefdivide(a,b):returna/bdefreal_main():i=5j=0c=divide(i,j)print(c)defwrapper():real_main()@handle_exceptions(exclude=3)defmain():wrapper()if__name__=='__main__':main()and you want to exclude all stacktrace from main to wrapper
you need to passfile_name.function_nameas exclude argumentOther functionsYou can also want to use these functions:Make function that returns HTML and don't save the result:frompyexceptionsimporthandle_exceptions@handle_exceptions(save=False)defmain():...Make function return production html:frompyexceptionsimporthandle_exceptions@handle_exceptions(production=True)defmain():...Or you may want to write your own logic To do so you need to import the ExceptionHandler classfrompyexceptionsimportExceptionHandlerThat's how it looks like:classExceptionHandler:"""Organize and coordinate reporting on exceptions."""def__init__(self,lambda_event:dict=None,context:object=None,exclude:int=1,production:bool=False):"""Exception reporter initializerArgs:lambda_event (dict, optional): AWS lambda event. Defaults to None.context (object, optional): AWS lambda context. Defaults to None.exclude (int, optional): Determines how many frames of traceback to exclude. Defaults None.production (bool, optional): Determines if handler should be enabled. Defaults False."""self.__reporter=ExceptionReporter(lambda_event=lambda_event,context=context,exclude=exclude,# noqaproduction=production)defget_traceback_html(self):"""Return HTML version of debug 500 HTTP error page."""returnself.__reporter.get_traceback_html()defget_traceback_lambda(self):"""Return AWS lambda version of debug 500 HTTP error page."""returnself.__reporter.get_lambda_response()AttributionThis implementation draws upon work from:Djangovercel-python-wsgi
Package: pyexclient
PyexclientA Python client for the Expel Workbench.Explore the docs »Report Bug·Request Feature·Expel.ioTable of ContentsAbout the ProjectGetting StartedPrerequisitesInstallationUsageReporting a bug / Filing a Feature RequestContributingLicenseAbout The ProjectPyexclient is a Python client for the Expel Workbench. If you can click it in the UI, you can also automate it with our APIs. Want to build a custom report? Integrate Expel Workbench with your SOAR platform? Pyexclient can help you accomplish that and more!Getting StartedTo get up and running follow these simple steps.PrerequisitesPyexclient requirespython>=3.9and therequestspackage.InstallationTo install Pyexclient, use pip.pip3installpyexclientUsageYou can get started with Pyexclient in two easy steps:Step 1: Authenticate to WorkbenchYou can authenticate with your Expel Workbench credentials:importgetpassfrompyexclientimportWorkbenchClientwb=WorkbenchClient('https://workbench.expel.io',username=input("Username: "),password=getpass.getpass("Password: ",mfa_code=input("MFA Code: "))Alternatively, you can authenticate with an API key (useful for long running scripts). Contact your Expel Engagement Manager to request an API key.importgetpassfrompyexclientimportWorkbenchClientwb=WorkbenchClient('https://workbench.expel.io',token=getpass.getpass("API Token: "))Step 2: Start Exploring!In the example below, we're printing investigations:forinvinwb.investigations:print(inv)For more examples (we have a ton!), please refer to theDocumentation. As a starting point, check outCode SnippetsandExample Scripts.IssuesIf you find a bug or have an idea for the next amazing feature, pleasecreate an issue. We'll get back to you as soon as we can!ContributingContributions are welcome!Fork the ProjectCreate your Feature Branch (git checkout -b feature/AmazingFeature)Commit your Changes (git commit -m 'Add some AmazingFeature')Push to the Branch (git push origin feature/AmazingFeature)Open a Pull RequestLicenseDistributed under the BSD 2-Clause License. SeeLICENSEfor more information.
Package: pyexe
pyexePython package to execute commands on local and remote server.Installationpip install pyexeUsesLocalfrom pyexe import Local

lc= Local()
lc.exe("mkdir myfolder")
lc.setPath("./myfolder")
lc.exe("git status")Remotefrom pyexe import Remote

rm= Remote("162.158.50.246", "root", "password")
rm.connect()
rm.setPath("/var/www")
rm.exe("ls")Git automationfrom pyexe import Local, Remote

lc= Local()
lc.git.add()
lc.git.commit("initial commit")
lc.git.push()
# or shortcut for above 3 commands
lc.git.put()

rm- Remote(......)
rm.git.pull()
Package: pyexec
Pyexec allows to setup signal handler, which will reload current process. This
functionality might be used to restart application, e.g. when the code’s been
changed, by sending an appropriate signal to the python process.Exemplary usage:importosimportpyexecimportsignalimportsysdefhandler():sys.stderr.write('Reloading process!\n')returnsys.argv+['reloaded']sys.stderr.write('[%d]: argv:%r\n'%(os.getpid(),sys.argv))pyexec.install(signal.SIGUSR1,handler)signal.pause()The output from the python process after sending the USR1 signal twice:$ python example.py
[20785]: argv: ['example.py']
Reloading process!
[20785]: argv: ['example.py', 'reloaded']
Reloading process!
[20785]: argv: ['example.py', 'reloaded', 'reloaded']
Package: pyexecutable
PyExecutablebuilderExecutable(name : str, autosave : bool = True)Executable file.save()Save an executableclose()Close an executableaddInstruction(instruction)Add instruction to executablegetAssembler()Get assembler code of executablegetInstructions()Get instructions of executableinstructionsoutput(string)Output stringnewline()Output newlineexit()Exit from executableassemmblercompile()Compile assembler codeExamplesHello world!fromPyExecutable.builderimportExecutable,instructionswithExecutable('helloworld.exe')asexe:exe.addInstruction(instructions.output('hello world'))Visit cardfromPyExecutable.builderimportExecutable,instructionsexe=Executable('hippo.exe')exe.addInstruction(instructions.output('Hello world!'))exe.addInstruction(instructions.output.newline())exe.addInstruction(instructions.output("I'm simple program. My name is\"hippo.exe\"."))
Package: py-executable-checklist
Executable WorkflowDocumentation:https://namuan.github.io/py-executable-checklistSource Code:https://github.com/namuan/py-executable-checklistPyPI:https://pypi.org/project/py-executable-checklist/Helper classes to develop executable workflow scriptsInstallationpipinstallpy-executable-checklistExample UsageimportloggingfromargparseimportArgumentParser,RawDescriptionHelpFormatterfrompy_executable_checklist.workflowimportrun_workflow,WorkflowBase# Common functions across steps# Workflow stepsclassDoSomething(WorkflowBase):"""Go to this pageCopy the commandRun the commandCopy the output and paste it into the email"""username:strdefexecute(self):logging.info(f"Hello{self.username}")# outputreturn{"greetings":f"Hello{self.username}"}# Workflow definitiondefworkflow():return[DoSomething,]# Boilerplatedefparse_args():parser=ArgumentParser(description=__doc__,formatter_class=RawDescriptionHelpFormatter)parser.add_argument("-u","--username",type=str,required=True,help="User name")parser.add_argument("-v","--verbose",action="store_true",default=False,dest="verbose",help="Display context variables at each step",)returnparser.parse_args()defmain(args):context=args.__dict__run_workflow(context,workflow())if__name__=="__main__":args=parse_args()main(args)DevelopmentClone this repositoryRequirements:PoetryPython 3.7+Create a virtual environment and install the dependenciespoetryinstallActivate the virtual environmentpoetryshellValidating buildmakebuildRelease processA release is automatically published when a new version is bumped usingmake bump. See.github/workflows/build.ymlfor more details. Once the release is published,.github/workflows/publish.ymlwill automatically publish it to PyPI.
Package: pyexecute
pyexecuteVersion 1.0.3A module for opening programs and files with pythonimportpyexecuteDependenciesPython 3.6 (or higher) with the following modules:osmultiprocessingBoth of these are part of the default python install and therefore don't need to be installed separately.Usagepyexecute.file(path)# opens a file in its default editorpyexecute.program(path)# opens a program (for linux path is just a prorgams name e.g "obs")ContributorsNiklas ZiermannCopyright & License© Niklas ZiermannMIT License
Package: py-execute
External Process Execution Wrapper-----------------------------------Allows you to execute external commands getting large outputs in real-time but also gettingall the output as a return variable.Examples--------from py_execute import run_commandret = run_command.execute('echo "Hello World"')Hello Worldret'Hello World'ret = run_command.execute('read -p "Do you like py-executor?" yn; case $yn in [yY]* ) echo "cool";; esac', user_input='y')coolret'cool'
Package: pyExecutioner
EXecutionerA python library to execute untrusted code and evaluate the output.RequirementsPython Libraries denoted by requirements.txtFireJail(for FireJail Sandbox)sudoaptinstallfirejailInstallationInstall PyPI packagepipinstallpyExecutionerInstallation for developmentClone the repository.make a virtual environment named 'venv' inside the repository. (Learn aboutvenv)python-mvenvvenvaccess the virtualenvsourcevenv/bin/activateinstall python dev dependenciespipinstall-rrequirements.txtRun Test after installing the default supported language compilers/interpreters.pytestexecutioner/Default supported languagesPython3sudoaptinstallpython3C - uses GCC compilersudoaptinstallgccDocumentationDocumentation can be found athttps://iCodeDevs.github.io/EXecutioner/NOTEunder heavy development, alot of changes might occur over time till we hit v1
Package: pyexecutor
PyExecutor - A light-weight module to run shell / commander commands and get output with Python.Work with both Linux, Windows and MacOS, compatible with executable files likeexecutor,executor.exeandexecutor.bat.RequirementPython >= 3.5Compatible with Python 3.5 3.6 3.7 3.8InstallationInstall withpippip install pyexecutorQuickStartImport and run with pythonfrompyexecutorimportExecutorpython=Executor('python')version=python.run('--version')print(version)"""Python 3.8.0"""Usage ExamplesRun with executorGet command execution result in stringfrompyexecutorimportExecutorkubectl=Executor('kubectl')# Run 'kubectl version --client --short'result=kubectl.run('version --client --short')# Set trailer string of executorkubectl.set_trailer('-o=json')# Run 'kubectl version --client --short -o=json'result=kubectl.run('version --client --short')# Get command output in JSON object (<type 'dict'>), exception will be raised if result string is not JSON serializable.result=kubectl.run('version --client --short',json_output=True)Run with commanderfrompyexecutorimportCommandercommander=Commander()# Run 'kubectl version --short --client'result=commander.run('kubectl','version --short --client')# Get command output message.# {#   "clientVersion": {#     "major": "1",#     "minor": "19",#     "gitVersion": "v1.19.7",#     "gitCommit": "1dd5338295409edcfff11505e7bb246f0d325d15",#     "gitTreeState": "clean",#     "buildDate": "2021-01-13T13:23:52Z",#     "goVersion": "go1.15.5",#     "compiler": "gc",#     "platform": "darwin/amd64"#   }# }result.output()# Get command output in JSON object (<type 'dict'>), exception will be raised if result string is not JSON serializable.# {'clientVersion': {'major': '1', 'minor': '19', 'gitVersion': 'v1.19.7', 'gitCommit': '1dd5338295409edcfff11505e7bb246f0d325d15', 'gitTreeState': 'clean', 'buildDate': '2021-01-13T13:23:52Z', 'goVersion': 'go1.15.5', 'compiler': 'gc', 'platform': 'darwin/amd64'}}result.json()# Get command error message.# ""result.error()# If command exit with zero.result.ok()==True# If command exit with non zero.result.fail()==TrueLoggingLoging in executorimportloggingfrompyexecutorimportExecutorkubectl=Executor('kubectl',logger=logging.getLogger())Logging in commanderimportloggingfrompyexecutorimportCommanderCommander(logger=logging.getLogger())