Saravanan666/pypi-org huggingface dataset:
Package: exceptbot
ExceptBot: Django Exception Logger with AI Suggestions for FixingImagine: An exception is thrown on your site and it iscritical.You need a solutionfast.ExceptBot is a Django middleware application that captures
and logs exceptions that occur within your Django project. Site admins
can quickly view exceptions, the code where the problem originated, and
with a button-click feed all that info to ChatGPT to get a possible solution.FeaturesAutomatically logs exceptions, including:The Python Code and line where the exception occurredThe full stack traceURL path, Exception type, timestamp, user (if authenticated)Gets AI SuggestionsSends all relevant info to ChatGPT API:Stack traceSource code producing the exceptionline causing the exceptionSuperuser-restricted views to:View a list of unresolved exceptionsMark exceptions as resolvedView detailed information for each exceptionTracks which superuser resolved an exception and whenInstallationInstall the ExceptBot librarypip3installexceptbotAdd 'ExceptBot' to INSTALLED_APPS in your project'ssettings.py:INSTALLED_APPS=[# ...'exceptbot',# ...]Include the middleware in the MIDDLEWARE list in yoursettings.py:MIDDLEWARE=[# ...'exceptbot.middleware.ExceptBotMiddleware',# ...]Include the ExceptBot URLs in your project'surls.py:fromdjango.urlsimportpath,includeurlpatterns=[# ...path('exceptbot/',include('exceptbot.urls')),# ...]Run migrations to create the necessary database tables and set up static files$python3manage.pymakemigrationsexceptbot
$python3manage.pymigrateexceptbot
$python3manage.pycollectstatic--no-inputUsageOnce integrated into your Django project:setup the Chat GPT connection (When you have an account, yourAPI key is here)Any exception that occurs will be automatically logged by the middleware.Superusers can navigate to/exceptbot/to view a list of unresolved exceptions.Click on an exception to view its detailed information.Superusers can mark exceptions as resolved, which will also record who resolved it and when.
Package: exceptiom
=========
exceptiomMake python exceptions fun.InstallationInstall exceptiom using pip.pip install exceptiomWe are onPyPiVisit us onGithubUsageImport Exceptiomfrom exceptiom import Exceptiomand then raise exceptiom liketry:
    5 / 0
except Exception:
    raise Exceptiom('Failed while performing division')You can also make it as the base class for all your derived exception.Instead of doingclass MyException(Exception)you can writeclass MyException(Exceptiom)ContributonTo add jokes, just add joke in exceptiom/jokes_en and raise a PR.For any other features raise a PRFor DevelopersVersion bumpbumpversion --current-version 1.2.0 minor setup.pyPublishing to PyPi1.python setup.py sdist2.python setup.py sdist
Package: exception
exceptionExtract unique Python-Exceptions with their traceback from a log file.## WARNING!The extraction logic here is heuristic and may fail you. Don’t depend on it for any life or death situations. Also, please submit feedback on how it could be improved!## InstallationalClone this repository and install withpython setup.py installThis adds a utility calledexceptionorexception.exeto your path.## UsageTo extract the Python tracebacks from a log called _logfile.txt_, run:$ exception -f logfile.txtIf you want to exclude certain exceptions, try:$ exception -f logfile.txt -e ValueError,AttributeErrorYou can all pass multiple filenames:$ exception -f logfile1.txt logfile2.txtThis would exclude would exclude anyValueErrororAttributeErrortracebacks from the output.The tool can also read the log file from stdout, e.g.:cat logfile.txt | exceptionorcat logfile.txt | exception -e ValueErrorCreditsThis is based on [a script](https://gist.github.com/originell/1923003) by [@originell](https://github.com/originell).This package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2016-06-16)First release on PyPI.
Package: exceptional-auth
exceptional_authThe purpose of this package is to provide a more flexible/powerful replacement for Django'slogin_requiredandpermission_requireddecorators (and provide some entirely new related functionality).The idea is to create a standard set of exceptions which any code can raise (even reusable apps distributed on pypi), and leave the handling of these exceptions up to the site developer (via custom middleware). This makes the many per-view decisions easy (ie. just raise PermissionDenied), while letting you centralize/delay the decision of what to do in those situations. Since you have access to the request object in the middleware methods, you can easily tailor the handling of these exceptions base on section of site, request type, etc.We provideexceptional_auth.BaseMiddleware, a Middleware base class which makes it easier to handle our exceptions. Site developers should write a custom middleware extending this class, and add toMIDDLEWAREsetting. You can also useexceptional_auth.BaseMiddlewareto start with, and then extend it later.
Package: exceptionalpy
exceptionalpyfeaturesexception handling decorator (ex / catch)timing decorator (ti / timeit)exception handling and timing decorator (exti / catch_timeit)Handlerhandle exceptionsprint stacktraceforward stacktrace to notifierhandle timing results of functionsforward to notifierBaseNotifierprovide interface for extensionsHTTPNotifiersend stacktrace via POST to specified urlSMTPNotifiersend stacktrace via Mail to specified email addressesRescuerManager like interface for threads / processesCapture exceptionsusagebasicimporttimefromexceptionalpyimportcatch,timeit,exceptionalpy_handlerashandlerhandler.verbose=True# since you probably want to see your timing results@timeit()defgotta_work_fast():time.sleep(0.4)@catch()defcant_fail():raiseArithmeticErrorgotta_work_fast()# gotta_work_fast completed in 400432710 ns | 400.43271 ms | 0.40043270999999997 scant_fail()# prints stacktraceprint("I will still be printed.")print("Since the program will not exit even though an exception occurred.")extensive guideimporttimefromexceptionalpyimportex,exceptionalpy_handlerashandler# lets be verbosehandler.verbose=True# you can either just catch all exceptions withhandler.init()# and then stop again withhandler.deinit()# or you can decorate the functions of which you want the exceptions to be caught@ex()defi_will_throw():raiseBaseException# there is also a timing decorator that catches the exceptionfromexceptionalpyimportexti@exti()defi_take_a_moment_to_throw():time.sleep(0.6)print("Heyyyyy")raiseArithmeticError# if you still want to time your functions and# have the result be forwarded to the notifierfromexceptionalpyimportti@ti()defi_take_a_moment():time.sleep(0.4)print("Slow function here, hi")i_take_a_moment()# upon successful execution, if you set the handlers verbose option to True,# you will see something like this# i_take_a_moment completed in 400432710 ns | 400.43271 ms | 0.40043270999999997 s# and that result will be jsonified and forwarded to the notifier# before any exceptions happen, you can also attach a notifierfromexceptionalpy.HTTPimportHTTPNotifierhandler.notifier=HTTPNotifier("https://my-server:1337/api/exceptional","POST")# or just use a completely different handlerfromexceptionalpy.SMTPimportSMTPSHandlerhandler=SMTPSHandler(("127.0.0.1",25),# which SMTP server to use"exceptionalpy@locahost",# the sender address"dev@localhost",# the receiver address"There was an exception in your program")# the subject#  nothing bad will happen if you don't callhandler.deinit()# beforehand. you can do it, but it's a waste of cpu cycles.i_will_throw()print("I will still be printed")i_take_a_moment_to_throw()print("I get printed as well since the program does not exit")
Package: exceptioncontext
Provides a different way of controlling exception chaining
(the implicit__context__and explicit__cause__)
beyond justraise ... from ....VersioningThis library’s version numbers follow theSemVer 2.0.0
specification.Installationpip install exceptioncontextUsageImport as needed:fromexceptioncontextimportcause,context,suppress_contextExplicitly chain exception (set__cause__):withcause(Exception("foo")):raiseException("bar")Override implicitly chained exception (set__context__):withcontext(Exception("foo")):raiseException("bar")Manually control context suppression (set__suppress_context__):withsuppress_context(False):raiseException("foo")exceptioncontextmakes exception chaining fully independent of
theraisestatement, and freely composable with other code:withcause(earlier_exception):helper_function()PortabilityPortable to all releases of both Python 3 and Python 2.(The oldest tested is 2.5, but it will likely work as far
back as 2.2 when paired with something likewith-as-a-function.)On implementations of Python where setting the exception chaining
attributes on an exception raises anAttributeError,exceptioncontextgracefully degrades to doing nothing.
Package: exceptioncontrol
ExceptionControlThe ExceptionControl class is designed to be a helper class that is inherited
into a class to give it a convenient interface to implement conditional
exception handling options. The purpose of this is to give developers
additional flexibility in how events can be handled and tune the overall
behaviour via parameters while adding minimal additional control code.In many codes one may wish their code to take a fail fast approach to handling
issues such as unexpected input or other errors. While this method often works
well to rapidly identify problems by causing an application to exit, there are
times when maybe just a warning is sufficient.ExceptionControl allows us to classify an event based on its severity using a
threshold setting that can be changed. This gives us two degrees of control
over the handling of an event. First, by assigning the level of severity of the
event itself we can direct what happens when the event is triggered. Second,
we can set thresholds that direct the behaviour of the handler when an event
is triggered.Documentation and User GuideSee theUser Guidefor detailed documentation on the package. This includes
the API docs, user guide, and examples.HistoryExceptionControlis pulled fromConfigParserEnhancedinto its own module
because it is an interesting and useful class. Splitting these up was the intent from
the beginning when it was originally developed.UpdatesSeeCHANGELOGfor information on changes.
Package: exception-details
exception_detailsGet nicely formated exception details.ContentInstallationUsageInstallationpip install exception-detailsUsageprint_exception_details(exception: Exception)Print the exception details.Usage:`try: ...`  

  `except Exception as e: print_exception_details(e)`Contains:function namefilepathlinecode snippetspecies of the exceptionmessageArgs:exception (Exception): Your Exceptionget_exception_details_dict(exception: Exception)Get the exception details as a dictionary.Usage:`try: ... `  

  `except Exception as e: details = get_exception_details_dict(e)`Contains:'function' -> function name'path' -> filepath'line' -> line'code' -> code snippet'species' -> species of the exception'message' -> messageArgs:exception (Exception): Your ExceptionReturns:dict: Exception details as a dictionary with the keys: "function", "path", "line", "code", "species", "message"get_exception_details_str(exception: Exception, colored=True)Print the exception details.Usage:`try: ... `  

  `except Exception as e: details = get_exception_details_str(e)`Contains:function namefilepathlinecode snippetspecies of the exceptionmessageArgs:exception (Exception): Your Exception

  colored (boolean): The string has coloreds parts if True.Returns:str: Exception details as a string."LinksGitHub|PyPI
Package: exception-handler-plus
Exception Handler decorator allows developers to specify specific exception types
to handle and provide a handler function for each of those exception
types. The decorator also provides an option to specify a default
return value to be used when an unhandled exception occurs.
Additionally, the decorator tracks the number of times each
exception type has been seen and raises a MaxRepeatedExceptionsError
when a specific exception type exceeds a specified maximum number of
occurrences.The decorator uses the exception_handler function as a wrapper
for the decorated function. The function accepts four parameters:handlers (Dict[Type[Exception], HandlerFuncType]): A dictionary
where the keys are exception types and the values are the correspondinghandler functions for those exception types.default_return (Optional[Any]): A default return value to be
used when an unhandled exception occurs.max_repeated_exceptions (int): The maximum number of times an
exception type can be seen before a MaxRepeatedExceptionsError is
raised.seen_exceptions (Optional[DefaultDict[Type[Exception], List[int]]]):
A defaultdict used to keep track of the number of times each
exception type has been seen.The read_env module is used to read the maximum number of repeated
exceptions that can occur from an environment variable.
Package: exceptions-and-logging
exceptions_and_loggingADjango appfor logging custom application errors on the server side and also spits out JSON error info on the client side. You basically subclass ourApplicationErrorsclass and the rest is done for you.DependenciesDjango Rest FrameworkPyYamlInstallationIn your virtual environment run:pip install exceptions-and-loggingUsageAddexceptions_and_loggingto your Django installed apps:# settings.pyINSTALLED_APPS=[...'exceptions_and_logging',]Without logging config.# your_app.exceptions.py (or wherever your app exceptions are)fromexceptions_and_logging.exceptionsimportApplicationErrorsclassMyCustomException(ApplicationErrors):default_message="This item: '%(item_name)s' isn't supposed to be null"def__init__(self,item_name):message=self.default_message%{"item_name":item_name}super().__init__(message)When this error is raised:Generated response on the client side (via Rest Framework):{"error":{"type":"MyCustomException","message":"This item: 'SomeItem' isn't supposed to be null","code":"error"}}An HTTP 500 Application Error response is returned.Generated log on the server console (stdout):02/15/2021 04:30:34 PM - APPLICATION ERROR - ERROR
Error Type: MyCustomException
Error Message: This item: 'SomeItem' isn't supposed to be null
Traceback (most recent call last):
  # Bunch of traceback info
  ...
  ...
    raise NullError("SomeItem")
your_app.exceptions.MyCustomException: This item: 'SomeItem' isn't supposed to be nullWith Logging Config# your_app.exceptions.py (or wherever your app exceptions are)fromexceptions_and_logging.exceptionsimportApplicationErrors# Path to your logging config filemodule_dir=os.path.dirname(__file__)config_file=os.path.join(module_dir,"myconfig.yaml")classMyCustomException(ApplicationErrors):default_message="This item: '%(item_name)s' isn't supposed to be null"log_config=config_file# Can also be a dict config# If no logger name is passed, it will use the default logger name.def__init__(self,item_name,logger_name=None):message=self.default_message%{"item_name":item_name}super().__init__(message,logger_name=logger_name)TheApplicationErrorclass provides hooks for adding extra format strings to the logging message and also extra key, value pairs for the error dict.# Assuming your formatter has extra values like user_id and user_emailmsg_format='%(asctime)s- APPLICATION ERROR -%(levelname)s\n'\'User Email:%(user_email)s\n'\'User ID:%(user_id)s\n'\'Error Message:%(message)s\n'classMyCustomException(ApplicationErrors):def__init__(self,user_id,user_email,**err_dict_kwargs):self.user_id,self.user_email=user_id,user_emailsuper().__init__(**err_dict_kwargs)# Override this method to return extra kwargs for loggingdefextra_kwargs(self)->dict:dict_={"user_id":self.user_id,"user_email":self.user_email}returndict_# in views.pyfromrest_framework.viewsimportAPIViewfrom.exceptionsimportMyCustomExceptionclassTestException(APIView):defget(self,request):raiseMyCustomException("id4","name@gmail.com",foo="bar",hot="soup")Generated response on the client side via Rest Framework:{"error":{"type":"MyCustomException","message":"An application error occurred.","code":"error","foo":"bar","hot":"soup"}}
Package: exception-slacker
[![Build Status](https://travis-ci.org/hassaku/exception-slacker.png)](https://travis-ci.org/hassaku/exception-slacker)# Install```$ pip install exception-slacker```# Usage## When ENV set```import osimport exception_slackeros.environ['EXCEPTION_SLACKER_TOKEN'] = "XXXXXXXXXX"os.environ['EXCEPTION_SLACKER_CHANNEL'] = "#notification-test"os.environ['EXCEPTION_SLACKER_NAME'] = "Exception Notifier"raise StandardError("ERROR")```![screenshot](https://raw.githubusercontent.com/hassaku/exception-slacker/master/screenshot.png)## When ENV not set```import exception_slackerraise StandardError("ERROR")``````Error in sys.excepthook:Traceback (most recent call last):File "/path/to/exception_slacker.py", line 17, in notificationraise StandardError("exception_slacker is imported, but %s aren't found in ENV." % ','.join(__KEYS))StandardError: exception_slacker is imported, but EXCEPTION_SLACKER_TOKEN,EXCEPTION_SLACKER_CHANNEL,EXCEPTION_SLACKER_NAME aren't found in ENV.Original exception was:Traceback (most recent call last):File "test.py", line 20, in <module>raise StandardError("ERROR")StandardError: ERROR```# Update PyPI```$ nosetests -vs$ python setup.py register  # if necessary$ python setup.py sdist upload```# Contributing- Fork the repository on Github- Create a named feature branch (like add_component_x)- Write your change- Write tests for your change (if applicable)- Run the tests, ensuring they all pass- Submit a Pull Request using Github# LicenseMIT
Package: exception-sms
This package is used to notify developer that program catched a
exception, Once this mechanism is triggered, the developer is
notified via text message, along with the general reason for
the exception and the function that caused it. At the same time,
the package generates log files locally for developers to read
and check for exceptions.How to InstallYou can install this package by execute the command like thispip installexception-smsin command line. One important thing
is that this package only support Python3.6 or higher versions.ExamplesHow to use it:fromexception_smsimportGetNotificationlogs=GetNotification("Your access_key","Your secret_key","Your template_id of sms","The author of the function","Receiver's Phone number","The path of log files")@log.exce_notedeftests_func(x,y):out=x/yreturnoutif__name__=="__main__":result=tests_func(0,0)print(result)The result of the code above:
Package: exception-template
Raise exceptions with consistent messages while avoiding the boiler plate.Compare this:>>> from exception_template import ExceptionTemplate
>>> class MyException(ExceptionTemplate):
...    message = 'Hello, {person}. Here is my {adjective} exception class.'
>>> raise MyException(person='Ryan', adjective='fancy')
Traceback (most recent call last):
    ...
MyException: Hello, Ryan. Here is my fancy exception class.To this:>>> class MyException(Exception):
...     def __init__(self, person: str, adjective: str) -> None:
...         self.person = person
...         self.adjective = adjective
...         super().__init__('Hello, {person}. Here is my {adjective} exception class.'
...                          .format(person=person, adjective=adjective))
>>> raise MyException('Ryan', 'lame')
Traceback (most recent call last):
    ...
MyException: Hello, Ryan. Here is my lame exception class.Or this:>>> class MyException(Exception):
...     pass
>>> raise MyException('Hello, Ryan. Here is my exception class with a message I copy-pasted in 500 places.')
Traceback (most recent call last):
    ...
MyException: Hello, Ryan. Here is my exception class with a message I copy-pasted in 500 places.Additionally, the ExceptionTemplate parameters are available as members on the exception instance:>>> try:
...     foo()
... except MyException as ex:
...    print(ex.person)
RyanInstallingpip installexception-templateNo extra dependencies are needed!
Package: exception-with-retry
exception-with-retryWraps any method which throws exceptions. Retries calls when exceptions are thrown.DescriptionCheck theunit testsfor usage.Build and run tests locally:toxPublish totest pypi:tox -e clean && tox -e build && tox -e publishPublish topypi:git tag MAJOR.MINOR[.PATCH]tox -e clean && tox -e buildtox -e publish -- --repository pypiMaking Changes & ContributingThis project usespre-commit, please make sure to install it before making any
changes::pip install pre-commit
cd exception-with-retry
pre-commit installIt is a good idea to update the hooks to the latest version::pre-commit autoupdateDon't forget to tell your contributors to also install and use pre-commit.NoteThis project has been set up using PyScaffold 4.0.2. For details and usage
information on PyScaffold seehttps://pyscaffold.org/.
Package: exceptive
# Exceptive[![PyPI - Version](https://img.shields.io/pypi/v/exceptive.svg)](https://pypi.org/project/exceptive/)
[![PyPI - License](https://img.shields.io/pypi/l/exceptive.svg)](LICENSE.txt)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/exceptive.svg)](https://pypi.org/project/exceptive/)
[![PyPI - Status](https://img.shields.io/pypi/status/exceptive.svg)](https://pypi.org/project/exceptive/)
[![Travis](https://img.shields.io/travis/erayerdin/exceptive.svg)](http://travis-ci.org/erayerdin/exceptive)
[![Coveralls github](https://img.shields.io/coveralls/github/erayerdin/exceptive.svg)](https://coveralls.io/github/erayerdin/exceptive)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/40288611f7584b489dd469b659fc6806)](https://www.codacy.com/app/erayerdin/exceptive?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=erayerdin/exceptive&amp;utm_campaign=Badge_Grade)Exceptive is a Python library that makes exception handling more programmatic
and debuggable.## Documentation[Read the documentation](http://exceptive.readthedocs.io).
Package: exchange-calendars-extensions-api
exchange-calendars-extensions-apiThis package contains parts of the API ofexchange-calendars-extensions.To separate the API from the implementation, the API is defined in a separate distribution packageexchange-calendars-extensions-api, i.e. this package,
that contains the sub-packageexchange_calendars_extensions.api.The implementation has been moved to the sub-packageexchange_calendars_extensions.coreand is distributed viaexchange-calendars-extensions.The packageexchange_calendars_extensionsis now a namespace package that wraps the sub-packages.
Package: exchangedataset-python
exchangedataset-pythonexchangedataset-pythonis a library for Python 3 to allow easy integration of the Exchangedataset service.About ExchangedatasetExchangedatasetis the historical cryptocurrency market data streaming service.RequirementsPython 3.8 or morePipenvLicenseMIT LicenseThis library is free to distribute and modify under the condition that you include a license notice.Install LibraryYou can install the package bypip3command:pip3installexchangedataset-pythonThis will install the latest and available version of this library.As shown above, its package name in PyPi isexchangedataset-python.ImportThe module is namedexdpy.
Please note that it is different from the package name.importexdpyDevelopmentThis information is for the developer of this library.Thank you for your contribution.Environment SetupThis project utilizesPipenv.It is a package managing and virtual environment utility.To fetch all dependencies (including development dependencies), run the command below:pipenvinstall--devThis will install all dependencies needed to runexchangedataset-python.TestUnit test files are under tests/ directory.All tests can be conducted by running the command below:pipenvrunpytestDocumentation GenerationAPI Documentation can be generated by running the below command insphinxdirectory:pipenvrunmakeDeployThe command below will package all python files under the exdpy directory and upload it to PyPi.pipenvrunsetup.pyupload