[{"name": "zopfli", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nPYZOPFLI\nUSAGE\nTODO\n\n\n\n\n\nREADME.rst\n\n\n\n\n\n\nPYZOPFLI\ncPython bindings for\nzopfli.\nIt requires Python 3.7 or greater.\n\nUSAGE\npyzopfli is a straight forward wrapper around zopfli's ZlibCompress method.\nfrom zopfli.zlib import compress\nfrom zlib import decompress\ns = 'Hello World'\nprint decompress(compress(s))\n\npyzopfli also wraps GzipCompress, but the API point does not try to\nmimic the gzip module.\nfrom zopfli.gzip import compress\nfrom StringIO import StringIO\nfrom gzip import GzipFile\nprint GzipFile(fileobj=StringIO(compress(\"Hello World!\"))).read()\n\nBoth zopfli.zlib.compress and zopfli.gzip.compress support the following\nkeyword arguments. All values should be integers; boolean parmaters are\ntreated as expected, 0 and >0 as false and true.\n\nverbose dumps zopfli debugging data to stderr\nnumiterations Maximum amount of times to rerun forward and backward\npass to optimize LZ77 compression cost. Good values: 10, 15 for small\nfiles, 5 for files over several MB in size or it will be too slow.\nblocksplitting If true, splits the data in multiple deflate blocks\nwith optimal choice for the block boundaries. Block splitting gives\nbetter compression. Default: true (1).\nblocksplittinglast If true, chooses the optimal block split points\nonly after doing the iterative LZ77 compression. If false, chooses\nthe block split points first, then does iterative LZ77 on each\nindividual block. Depending on the file, either first or last gives\nthe best compression. Default: false (0).\nblocksplittingmax Maximum amount of blocks to split into (0 for\nunlimited, but this can give extreme results that hurt compression on\nsome files). Default value: 15.\n\n\nTODO\n\nStop reading the entire file into memory and support streaming\nMonkey patch zlib and gzip so code with an overly tight binding can\nbe easily modified to use zopfli.\n\n\n\n", "description": "Zopfli compression algorithm for higher deflate or zlib compression.", "category": "Compression"}, {"name": "zipp", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nCompatibility\nUsage\nFor Enterprise\n\n\n\n\n\nREADME.rst\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nA pathlib-compatible Zipfile object wrapper. Official backport of the standard library\nPath object.\n\nCompatibility\nNew features are introduced in this third-party library and later merged\ninto CPython. The following table indicates which versions of this library\nwere contributed to different versions in the standard library:\n\n\nzipp\nstdlib\n\n\n\n3.15\n3.12\n\n3.5\n3.11\n\n3.2\n3.10\n\n3.3 ??\n3.9\n\n1.0\n3.8\n\n\n\n\nUsage\nUse zipp.Path in place of zipfile.Path on any Python.\n\nFor Enterprise\nAvailable as part of the Tidelift Subscription.\nThis project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.\nLearn more.\n\n\n", "description": "Backport of pathlib-compatible object wrapper for zip files."}, {"name": "yarl", "readme": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nyarl\nIntroduction\nInstallation\nDependencies\nAPI documentation\nWhy isn't boolean supported by the URL query API?\nComparison with other URL libraries\nSource code\nDiscussion list\nAuthors and License\n\n\n\n\n\nREADME.rst\n\n\n\n\nyarl\nThe module provides handy URL class for URL parsing and changing.\n\n\n\n\n\n\n\n\n\n\n\n\nIntroduction\nUrl is constructed from str:\n>>> from yarl import URL\n>>> url = URL('https://www.python.org/~guido?arg=1#frag')\n>>> url\nURL('https://www.python.org/~guido?arg=1#frag')\nAll url parts: scheme, user, password, host, port, path,\nquery and fragment are accessible by properties:\n>>> url.scheme\n'https'\n>>> url.host\n'www.python.org'\n>>> url.path\n'/~guido'\n>>> url.query_string\n'arg=1'\n>>> url.query\n\n>>> url.fragment\n'frag'\nAll url manipulations produce a new url object:\n>>> url = URL('https://www.python.org')\n>>> url / 'foo' / 'bar'\nURL('https://www.python.org/foo/bar')\n>>> url / 'foo' % {'bar': 'baz'}\nURL('https://www.python.org/foo?bar=baz')\nStrings passed to constructor and modification methods are\nautomatically encoded giving canonical representation as result:\n>>> url = URL('https://www.python.org/\u043f\u0443\u0442\u044c')\n>>> url\nURL('https://www.python.org/%D0%BF%D1%83%D1%82%D1%8C')\nRegular properties are percent-decoded, use raw_ versions for\ngetting encoded strings:\n>>> url.path\n'/\u043f\u0443\u0442\u044c'\n\n>>> url.raw_path\n'/%D0%BF%D1%83%D1%82%D1%8C'\nHuman readable representation of URL is available as .human_repr():\n>>> url.human_repr()\n'https://www.python.org/\u043f\u0443\u0442\u044c'\nFor full documentation please read https://yarl.readthedocs.org.\n\nInstallation\n$ pip install yarl\n\nThe library is Python 3 only!\nPyPI contains binary wheels for Linux, Windows and MacOS. If you want to install\nyarl on another operating system (like Alpine Linux, which is not\nmanylinux-compliant because of the missing glibc and therefore, cannot be\nused with our wheels) the the tarball will be used to compile the library from\nthe source code. It requires a C compiler and and Python headers installed.\nTo skip the compilation you must explicitly opt-in by setting the YARL_NO_EXTENSIONS\nenvironment variable to a non-empty value, e.g.:\n$ YARL_NO_EXTENSIONS=1 pip install yarl\nPlease note that the pure-Python (uncompiled) version is much slower. However,\nPyPy always uses a pure-Python implementation, and, as such, it is unaffected\nby this variable.\n\nDependencies\nYARL requires multidict library.\n\nAPI documentation\nThe documentation is located at https://yarl.readthedocs.org\n\nWhy isn't boolean supported by the URL query API?\nThere is no standard for boolean representation of boolean values.\nSome systems prefer true/false, others like yes/no, on/off,\nY/N, 1/0, etc.\nyarl cannot make an unambiguous decision on how to serialize bool values because\nit is specific to how the end-user's application is built and would be different for\ndifferent apps. The library doesn't accept booleans in the API; a user should convert\nbools into strings using own preferred translation protocol.\n\nComparison with other URL libraries\n\nfurl (https://pypi.python.org/pypi/furl)\nThe library has rich functionality but the furl object is mutable.\nI'm afraid to pass this object into foreign code: who knows if the\ncode will modify my url in a terrible way while I just want to send URL\nwith handy helpers for accessing URL properties.\nfurl has other non-obvious tricky things but the main objection\nis mutability.\n\nURLObject (https://pypi.python.org/pypi/URLObject)\nURLObject is immutable, that's pretty good.\nEvery URL change generates a new URL object.\nBut the library doesn't do any decode/encode transformations leaving the\nend user to cope with these gory details.\n\n\n\nSource code\nThe project is hosted on GitHub\nPlease file an issue on the bug tracker if you have found a bug\nor have some suggestion in order to improve the library.\nThe library uses Azure Pipelines for\nContinuous Integration.\n\nDiscussion list\naio-libs google group: https://groups.google.com/forum/#!forum/aio-libs\nFeel free to post your questions and ideas here.\n\nAuthors and License\nThe yarl package is written by Andrew Svetlov.\nIt's Apache 2 licensed and freely available.\n\n\n", "description": "URL parsing and manipulation."}, {"name": "xml-python", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nWarehouse\nGetting Started\nDiscussion\nTesting\nCode of Conduct\n\n\n\n\n\nREADME.rst\n\n\n\n\nWarehouse\nWarehouse is the software that powers PyPI.\nSee our development roadmap, documentation, and\narchitectural overview.\n\nGetting Started\nYou can run Warehouse locally in a development environment using\ndocker. See Getting started\ndocumentation for instructions on how to set it up.\nThe canonical deployment of Warehouse is in production at pypi.org.\n\nDiscussion\nYou can find help or get involved on:\n\nGithub issue tracker for reporting issues\nIRC: on Libera, channel #pypa for general packaging discussion\nand user support, and #pypa-dev for\ndiscussions about development of packaging tools\nThe PyPA Discord for live discussions\nThe Packaging category on Discourse for discussing\nnew ideas and community initiatives\n\n\nTesting\nRead the running tests and linters section of our documentation to\nlearn how to test your code. For cross-browser testing, we use an\nopen source account from BrowserStack. If your pull request makes\nany change to the user interface, it will need to be tested to confirm\nit works in our supported browsers.\n\n\nCode of Conduct\nEveryone interacting in the Warehouse project's codebases, issue trackers, chat\nrooms, and mailing lists is expected to follow the PSF Code of Conduct.\n\n\n"}, {"name": "XlsxWriter", "readme": "\n\n\n\nREADME.rst\n\n\n\n\nXlsxWriter\nXlsxWriter is a Python module for writing files in the Excel 2007+ XLSX\nfile format.\nXlsxWriter can be used to write text, numbers, formulas and hyperlinks to\nmultiple worksheets and it supports features such as formatting and many more,\nincluding:\n\n100% compatible Excel XLSX files.\nFull formatting.\nMerged cells.\nDefined names.\nCharts.\nAutofilters.\nData validation and drop down lists.\nConditional formatting.\nWorksheet PNG/JPEG/GIF/BMP/WMF/EMF images.\nRich multi-format strings.\nCell comments.\nIntegration with Pandas and Polars.\nTextboxes.\nSupport for adding Macros.\nMemory optimization mode for writing large files.\n\nIt supports Python 3.4+ and PyPy3 and uses standard libraries only.\nHere is a simple example:\nimport xlsxwriter\n\n\n# Create an new Excel file and add a worksheet.\nworkbook = xlsxwriter.Workbook('demo.xlsx')\nworksheet = workbook.add_worksheet()\n\n# Widen the first column to make the text clearer.\nworksheet.set_column('A:A', 20)\n\n# Add a bold format to use to highlight cells.\nbold = workbook.add_format({'bold': True})\n\n# Write some simple text.\nworksheet.write('A1', 'Hello')\n\n# Text with formatting.\nworksheet.write('A2', 'World', bold)\n\n# Write some numbers, with row/column notation.\nworksheet.write(2, 0, 123)\nworksheet.write(3, 0, 123.456)\n\n# Insert an image.\nworksheet.insert_image('B5', 'logo.png')\n\nworkbook.close()\n\nSee the full documentation at: https://xlsxwriter.readthedocs.io\nRelease notes: https://xlsxwriter.readthedocs.io/changes.html\n\n\n", "description": "Create Excel XLSX files."}, {"name": "xlrd", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nWarehouse\nGetting Started\nDiscussion\nTesting\nCode of Conduct\n\n\n\n\n\nREADME.rst\n\n\n\n\nWarehouse\nWarehouse is the software that powers PyPI.\nSee our development roadmap, documentation, and\narchitectural overview.\n\nGetting Started\nYou can run Warehouse locally in a development environment using\ndocker. See Getting started\ndocumentation for instructions on how to set it up.\nThe canonical deployment of Warehouse is in production at pypi.org.\n\nDiscussion\nYou can find help or get involved on:\n\nGithub issue tracker for reporting issues\nIRC: on Libera, channel #pypa for general packaging discussion\nand user support, and #pypa-dev for\ndiscussions about development of packaging tools\nThe PyPA Discord for live discussions\nThe Packaging category on Discourse for discussing\nnew ideas and community initiatives\n\n\nTesting\nRead the running tests and linters section of our documentation to\nlearn how to test your code. For cross-browser testing, we use an\nopen source account from BrowserStack. If your pull request makes\nany change to the user interface, it will need to be tested to confirm\nit works in our supported browsers.\n\n\nCode of Conduct\nEveryone interacting in the Warehouse project's codebases, issue trackers, chat\nrooms, and mailing lists is expected to follow the PSF Code of Conduct.\n\n\n", "description": "Reading data and formatting information from older Excel files.", "category": "Excel"}, {"name": "xgboost", "readme": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n eXtreme Gradient Boosting\nLicense\nContribute to XGBoost\nReference\nSponsors\nOpen Source Collective sponsors\nSponsors\nBackers\n\n\n\n\n\nREADME.md\n\n\n\n\n eXtreme Gradient Boosting\n\n\n\n\n\n\n\n\n\n\nCommunity |\nDocumentation |\nResources |\nContributors |\nRelease Notes\nXGBoost is an optimized distributed gradient boosting library designed to be highly efficient, flexible and portable.\nIt implements machine learning algorithms under the Gradient Boosting framework.\nXGBoost provides a parallel tree boosting (also known as GBDT, GBM) that solve many data science problems in a fast and accurate way.\nThe same code runs on major distributed environment (Kubernetes, Hadoop, SGE, Dask, Spark, PySpark) and can solve problems beyond billions of examples.\nLicense\n\u00a9 Contributors, 2021. Licensed under an Apache-2 license.\nContribute to XGBoost\nXGBoost has been developed and used by a group of active community members. Your help is very valuable to make the package better for everyone.\nCheckout the Community Page.\nReference\n\nTianqi Chen and Carlos Guestrin. XGBoost: A Scalable Tree Boosting System. In 22nd SIGKDD Conference on Knowledge Discovery and Data Mining, 2016\nXGBoost originates from research project at University of Washington.\n\nSponsors\nBecome a sponsor and get a logo here. See details at Sponsoring the XGBoost Project. The funds are used to defray the cost of continuous integration and testing infrastructure (https://xgboost-ci.net).\nOpen Source Collective sponsors\n \nSponsors\n[Become a sponsor]\n\n\nBackers\n[Become a backer]\n\n\n\n", "description": "Gradient boosting library."}, {"name": "xarray", "readme": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nxarray: N-D labeled arrays and datasets\nWhy xarray?\nDocumentation\nContributing\nGet in touch\nNumFOCUS\nHistory\nContributors\nLicense\n\n\n\n\n\nREADME.md\n\n\n\n\nxarray: N-D labeled arrays and datasets\n\n\n\n\n\n\n\n\n\n\nxarray (pronounced \"ex-array\", formerly known as xray) is an open source project and Python\npackage that makes working with labelled multi-dimensional arrays\nsimple, efficient, and fun!\nXarray introduces labels in the form of dimensions, coordinates and\nattributes on top of raw NumPy-like arrays,\nwhich allows for a more intuitive, more concise, and less error-prone\ndeveloper experience. The package includes a large and growing library\nof domain-agnostic functions for advanced analytics and visualization\nwith these data structures.\nXarray was inspired by and borrows heavily from\npandas, the popular data analysis package\nfocused on labelled tabular data. It is particularly tailored to working\nwith netCDF files, which\nwere the source of xarray's data model, and integrates tightly with\ndask for parallel computing.\nWhy xarray?\nMulti-dimensional (a.k.a. N-dimensional, ND) arrays (sometimes called\n\"tensors\") are an essential part of computational science. They are\nencountered in a wide range of fields, including physics, astronomy,\ngeoscience, bioinformatics, engineering, finance, and deep learning. In\nPython, NumPy provides the fundamental data\nstructure and API for working with raw ND arrays. However, real-world\ndatasets are usually more than just raw numbers; they have labels which\nencode information about how the array values map to locations in space,\ntime, etc.\nXarray doesn't just keep track of labels on arrays -- it uses them to\nprovide a powerful and concise interface. For example:\n\nApply operations over dimensions by name: x.sum('time').\nSelect values by label instead of integer location:\nx.loc['2014-01-01'] or x.sel(time='2014-01-01').\nMathematical operations (e.g., x - y) vectorize across multiple\ndimensions (array broadcasting) based on dimension names, not shape.\nFlexible split-apply-combine operations with groupby:\nx.groupby('time.dayofyear').mean().\nDatabase like alignment based on coordinate labels that smoothly\nhandles missing values: x, y = xr.align(x, y, join='outer').\nKeep track of arbitrary metadata in the form of a Python dictionary:\nx.attrs.\n\nDocumentation\nLearn more about xarray in its official documentation at\nhttps://docs.xarray.dev/.\nTry out an interactive Jupyter\nnotebook.\nContributing\nYou can find information about contributing to xarray at our\nContributing\npage.\nGet in touch\n\nAsk usage questions (\"How do I?\") on\nGitHub Discussions.\nReport bugs, suggest features or view the source code on\nGitHub.\nFor less well defined questions or ideas, or to announce other\nprojects of interest to xarray users, use the mailing\nlist.\n\nNumFOCUS\n\nXarray is a fiscally sponsored project of\nNumFOCUS, a nonprofit dedicated to supporting\nthe open source scientific computing community. If you like Xarray and\nwant to support our mission, please consider making a\ndonation to support\nour efforts.\nHistory\nXarray is an evolution of an internal tool developed at The Climate\nCorporation. It was originally written by Climate\nCorp researchers Stephan Hoyer, Alex Kleeman and Eugene Brevdo and was\nreleased as open source in May 2014. The project was renamed from\n\"xray\" in January 2016. Xarray became a fiscally sponsored project of\nNumFOCUS in August 2018.\nContributors\nThanks to our many contributors!\n\nLicense\nCopyright 2014-2023, xarray Developers\nLicensed under the Apache License, Version 2.0 (the \"License\"); you\nmay not use this file except in compliance with the License. You may\nobtain a copy of the License at\nhttps://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\nXarray bundles portions of pandas, NumPy and Seaborn, all of which are\navailable under a \"3-clause BSD\" license:\n\npandas: setup.py, xarray/util/print_versions.py\nNumPy: xarray/core/npcompat.py\nSeaborn: _determine_cmap_params in xarray/core/plot/utils.py\n\nXarray also bundles portions of CPython, which is available under the\n\"Python Software Foundation License\" in xarray/core/pycompat.py.\nXarray uses icons from the icomoon package (free version), which is\navailable under the \"CC BY 4.0\" license.\nThe full text of these licenses are included in the licenses directory.\n\n\n", "description": "einstats - Stats and linear algebra for xarray."}, {"name": "xarray-einstats", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nxarray-einstats\nInstallation\nOverview\nContributing\nRelevant links\nSimilar projects\nCite xarray-einstats\n\n\n\n\n\nREADME.md\n\n\n\n\nxarray-einstats\n\n\n\n\n\n\nStats, linear algebra and einops for xarray\nInstallation\nTo install, run\n(.venv) $ pip install xarray-einstats\n\nSee the docs for more extensive install instructions.\nOverview\nAs stated in their website:\n\nxarray makes working with multi-dimensional labeled arrays simple, efficient and fun!\n\nThe code is often more verbose, but it is generally because it is clearer and thus less error prone\nand more intuitive.\nHere are some examples of such trade-off where we believe the increased clarity is worth\nthe extra characters:\n\n\n\nnumpy\nxarray\n\n\n\n\na[2, 5]\nda.sel(drug=\"paracetamol\", subject=5)\n\n\na.mean(axis=(0, 1))\nda.mean(dim=(\"chain\", \"draw\"))\n\n\na.reshape((-1, 10))\nda.stack(sample=(\"chain\", \"draw\"))\n\n\na.transpose(2, 0, 1)\nda.transpose(\"drug\", \"chain\", \"draw\")\n\n\n\nIn some other cases however, using xarray can result in overly verbose code\nthat often also becomes less clear. xarray_einstats provides wrappers\naround some numpy and scipy functions (mostly numpy.linalg and scipy.stats)\nand around einops with an api and features adapted to xarray.\nContinue at the getting started page.\nContributing\nxarray-einstats is in active development and all types of contributions are welcome!\nSee the contributing guide for details on how to contribute.\nRelevant links\n\nDocumentation: https://einstats.python.arviz.org/en/latest/\nContributing guide: https://einstats.python.arviz.org/en/latest/contributing/overview.html\nArviZ project website: https://www.arviz.org\n\nSimilar projects\nHere we list some similar projects we know of. Note that all of\nthem are complementary and don't overlap:\n\nxr-scipy\nxarray-extras\nxhistogram\nxrft\n\nCite xarray-einstats\nIf you use this software, please cite it using the following template and the version\nspecific DOI provided by Zenodo. Click on the badge to go to the Zenodo page\nand select the DOI corresponding to the version you used\n\n\nOriol Abril-Pla. (2022). arviz-devs/xarray-einstats . Zenodo. \n\nor in bibtex format:\n@software{xarray_einstats2022,\n author = {Abril-Pla, Oriol},\n title = {{xarray-einstats}},\n year = 2022,\n url = {https://github.com/arviz-devs/xarray-einstats}\n publisher = {Zenodo},\n version = {},\n doi = {},\n}\n\n\n\n"}, {"name": "wsproto", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nPure Python, pure state-machine WebSocket implementation\nUsage\nDocumentation\nContributing\nLicense\nAuthors\n\n\n\n\n\nREADME.rst\n\n\n\n\nPure Python, pure state-machine WebSocket implementation\n\n\n\n\n\n\n\nThis repository contains a pure-Python implementation of a WebSocket protocol\nstack. It's written from the ground up to be embeddable in whatever program you\nchoose to use, ensuring that you can communicate via WebSockets, as defined in\nRFC6455, regardless of your programming\nparadigm.\nThis repository does not provide a parsing layer, a network layer, or any rules\nabout concurrency. Instead, it's a purely in-memory solution, defined in terms\nof data actions and WebSocket frames. RFC6455 and Compression Extensions for\nWebSocket via RFC7692 are fully\nsupported.\nwsproto supports Python 3.6.1 or higher.\nTo install it, just run:\n$ pip install wsproto\n\nUsage\nLet's assume you have some form of network socket available. wsproto client\nconnections automatically generate a HTTP request to initiate the WebSocket\nhandshake. To create a WebSocket client connection:\nfrom wsproto import WSConnection, ConnectionType\nfrom wsproto.events import Request\n\nws = WSConnection(ConnectionType.CLIENT)\nws.send(Request(host='echo.websocket.org', target='/'))\nTo create a WebSocket server connection:\nfrom wsproto.connection import WSConnection, ConnectionType\n\nws = WSConnection(ConnectionType.SERVER)\nEvery time you send a message, or call a ping, or simply if you receive incoming\ndata, wsproto might respond with some outgoing data that you have to send:\nsome_socket.send(ws.bytes_to_send())\nBoth connection types need to receive incoming data:\nws.receive_data(some_byte_string_of_data)\nAnd wsproto will issue events if the data contains any WebSocket messages or state changes:\nfor event in ws.events():\n if isinstance(event, Request):\n # only client connections get this event\n ws.send(AcceptConnection())\n elif isinstance(event, CloseConnection):\n # guess nobody wants to talk to us any more...\n elif isinstance(event, TextMessage):\n print('We got text!', event.data)\n elif isinstance(event, BytesMessage):\n print('We got bytes!', event.data)\nTake a look at our docs for a full list of events\n!\n\nDocumentation\nDocumentation is available at https://wsproto.readthedocs.io/en/latest/.\n\nContributing\nwsproto welcomes contributions from anyone! Unlike many other projects we\nare happy to accept cosmetic contributions and small contributions, in addition\nto large feature requests and changes.\nBefore you contribute (either by opening an issue or filing a pull request),\nplease read the contribution guidelines.\n\nLicense\nwsproto is made available under the MIT License. For more details, see the\nLICENSE file in the repository.\n\nAuthors\nwsproto was created by @jeamland, and is maintained by the python-hyper\ncommunity.\n\n\n", "description": "WebSocket implementation."}, {"name": "wrapt", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nwrapt\nDocumentation\nQuick Start\nRepository\n\n\n\n\n\nREADME.rst\n\n\n\n\nwrapt\n \nThe aim of the wrapt module is to provide a transparent object proxy\nfor Python, which can be used as the basis for the construction of function\nwrappers and decorator functions.\nThe wrapt module focuses very much on correctness. It therefore goes\nway beyond existing mechanisms such as functools.wraps() to ensure that\ndecorators preserve introspectability, signatures, type checking abilities\netc. The decorators that can be constructed using this module will work in\nfar more scenarios than typical decorators and provide more predictable and\nconsistent behaviour.\nTo ensure that the overhead is as minimal as possible, a C extension module\nis used for performance critical components. An automatic fallback to a\npure Python implementation is also provided where a target system does not\nhave a compiler to allow the C extension to be compiled.\n\nDocumentation\nFor further information on the wrapt module see:\n\nhttp://wrapt.readthedocs.org/\n\n\nQuick Start\nTo implement your decorator you need to first define a wrapper function.\nThis will be called each time a decorated function is called. The wrapper\nfunction needs to take four positional arguments:\n\nwrapped - The wrapped function which in turns needs to be called by your wrapper function.\ninstance - The object to which the wrapped function was bound when it was called.\nargs - The list of positional arguments supplied when the decorated function was called.\nkwargs - The dictionary of keyword arguments supplied when the decorated function was called.\n\nThe wrapper function would do whatever it needs to, but would usually in\nturn call the wrapped function that is passed in via the wrapped\nargument.\nThe decorator @wrapt.decorator then needs to be applied to the wrapper\nfunction to convert it into a decorator which can in turn be applied to\nother functions.\nimport wrapt\n\n@wrapt.decorator\ndef pass_through(wrapped, instance, args, kwargs):\n return wrapped(*args, **kwargs)\n\n@pass_through\ndef function():\n pass\nIf you wish to implement a decorator which accepts arguments, then wrap the\ndefinition of the decorator in a function closure. Any arguments supplied\nto the outer function when the decorator is applied, will be available to\nthe inner wrapper when the wrapped function is called.\nimport wrapt\n\ndef with_arguments(myarg1, myarg2):\n @wrapt.decorator\n def wrapper(wrapped, instance, args, kwargs):\n return wrapped(*args, **kwargs)\n return wrapper\n\n@with_arguments(1, 2)\ndef function():\n pass\nWhen applied to a normal function or static method, the wrapper function\nwhen called will be passed None as the instance argument.\nWhen applied to an instance method, the wrapper function when called will\nbe passed the instance of the class the method is being called on as the\ninstance argument. This will be the case even when the instance method\nwas called explicitly via the class and the instance passed as the first\nargument. That is, the instance will never be passed as part of args.\nWhen applied to a class method, the wrapper function when called will be\npassed the class type as the instance argument.\nWhen applied to a class, the wrapper function when called will be passed\nNone as the instance argument. The wrapped argument in this\ncase will be the class.\nThe above rules can be summarised with the following example.\nimport inspect\n\n@wrapt.decorator\ndef universal(wrapped, instance, args, kwargs):\n if instance is None:\n if inspect.isclass(wrapped):\n # Decorator was applied to a class.\n return wrapped(*args, **kwargs)\n else:\n # Decorator was applied to a function or staticmethod.\n return wrapped(*args, **kwargs)\n else:\n if inspect.isclass(instance):\n # Decorator was applied to a classmethod.\n return wrapped(*args, **kwargs)\n else:\n # Decorator was applied to an instancemethod.\n return wrapped(*args, **kwargs)\nUsing these checks it is therefore possible to create a universal decorator\nthat can be applied in all situations. It is no longer necessary to create\ndifferent variants of decorators for normal functions and instance methods,\nor use additional wrappers to convert a function decorator into one that\nwill work for instance methods.\nIn all cases, the wrapped function passed to the wrapper function is called\nin the same way, with args and kwargs being passed. The\ninstance argument doesn't need to be used in calling the wrapped\nfunction.\n\nRepository\nFull source code for the wrapt module, including documentation files\nand unit tests, can be obtained from github.\n\nhttps://github.com/GrahamDumpleton/wrapt\n\n\n\n", "description": "Decorator to wrap functions and methods."}, {"name": "wordcloud", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nword_cloud\nInstallation\nInstallation notes\nExamples\nCommand-line usage\nLicensing\n\n\n\n\n\nREADME.md\n\n\n\n\n\n\nword_cloud\nA little word cloud generator in Python. Read more about it on the blog\npost or the website.\nThe code is tested against Python 3.7, 3.8, 3.9, 3.10, 3.11.\nInstallation\nIf you are using pip:\npip install wordcloud\n\nIf you are using conda, you can install from the conda-forge channel:\nconda install -c conda-forge wordcloud\n\nInstallation notes\nwordcloud depends on numpy, pillow, and matplotlib.\nIf there are no wheels available for your version of python, installing the\npackage requires having a C compiler set up. Before installing a compiler, report\nan issue describing the version of python and operating system being used.\nExamples\nCheck out examples/simple.py for a short intro. A sample output is:\n\nOr run examples/masked.py to see more options. A sample output is:\n\nGetting fancy with some colors:\n\nGenerating wordclouds for Arabic:\n\nCommand-line usage\nThe wordcloud_cli tool can be used to generate word clouds directly from the command-line:\n$ wordcloud_cli --text mytext.txt --imagefile wordcloud.png\n\nIf you're dealing with PDF files, then pdftotext, included by default with many Linux distribution, comes in handy:\n$ pdftotext mydocument.pdf - | wordcloud_cli --imagefile wordcloud.png\n\nIn the previous example, the - argument orders pdftotext to write the resulting text to stdout, which is then piped to the stdin of wordcloud_cli.py.\nUse wordcloud_cli --help so see all available options.\nLicensing\nThe wordcloud library is MIT licenced, but contains DroidSansMono.ttf, a true type font by Google, that is apache licensed.\nThe font is by no means integral, and any other font can be used by setting the font_path variable when creating a WordCloud object.\n\n\n", "description": "Word cloud generator."}, {"name": "werkzeug", "readme": "\nwerkzeug German noun: \u201ctool\u201d. Etymology: werk (\u201cwork\u201d), zeug (\u201cstuff\u201d)\nWerkzeug is a comprehensive WSGI web application library. It began as\na simple collection of various utilities for WSGI applications and has\nbecome one of the most advanced WSGI utility libraries.\nIt includes:\n\nAn interactive debugger that allows inspecting stack traces and\nsource code in the browser with an interactive interpreter for any\nframe in the stack.\nA full-featured request object with objects to interact with\nheaders, query args, form data, files, and cookies.\nA response object that can wrap other WSGI applications and handle\nstreaming data.\nA routing system for matching URLs to endpoints and generating URLs\nfor endpoints, with an extensible system for capturing variables\nfrom URLs.\nHTTP utilities to handle entity tags, cache control, dates, user\nagents, cookies, files, and more.\nA threaded WSGI server for use while developing applications\nlocally.\nA test client for simulating HTTP requests during testing without\nrequiring running a server.\n\nWerkzeug doesn\u2019t enforce any dependencies. It is up to the developer to\nchoose a template engine, database adapter, and even how to handle\nrequests. It can be used to build all sorts of end user applications\nsuch as blogs, wikis, or bulletin boards.\nFlask wraps Werkzeug, using it to handle the details of WSGI while\nproviding more structure and patterns for defining powerful\napplications.\n\nInstalling\nInstall and update using pip:\npip install -U Werkzeug\n\n\nA Simple Example\nfrom werkzeug.wrappers import Request, Response\n\n@Request.application\ndef application(request):\n return Response('Hello, World!')\n\nif __name__ == '__main__':\n from werkzeug.serving import run_simple\n run_simple('localhost', 4000, application)\n\n\nDonate\nThe Pallets organization develops and supports Werkzeug and other\npopular packages. In order to grow the community of contributors and\nusers, and allow the maintainers to devote more time to the projects,\nplease donate today.\n\n\nLinks\n\nDocumentation: https://werkzeug.palletsprojects.com/\nChanges: https://werkzeug.palletsprojects.com/changes/\nPyPI Releases: https://pypi.org/project/Werkzeug/\nSource Code: https://github.com/pallets/werkzeug/\nIssue Tracker: https://github.com/pallets/werkzeug/issues/\nChat: https://discord.gg/pallets\n\n\n", "description": "WSGI utility library for web applications."}, {"name": "websockets", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nWhat is websockets?\nwebsockets for enterprise\nWhy should I use websockets?\nWhy shouldn't I use websockets?\nWhat else?\n\n\n\n\n\nREADME.rst\n\n\n\n\n\n\n \n \n \n \n\nWhat is websockets?\nwebsockets is a library for building WebSocket servers and clients in Python\nwith a focus on correctness, simplicity, robustness, and performance.\nBuilt on top of asyncio, Python's standard asynchronous I/O framework, the\ndefault implementation provides an elegant coroutine-based API.\nAn implementation on top of threading and a Sans-I/O implementation are also\navailable.\nDocumentation is available on Read the Docs.\nHere's an echo server with the asyncio API:\n#!/usr/bin/env python\n\nimport asyncio\nfrom websockets.server import serve\n\nasync def echo(websocket):\n async for message in websocket:\n await websocket.send(message)\n\nasync def main():\n async with serve(echo, \"localhost\", 8765):\n await asyncio.Future() # run forever\n\nasyncio.run(main())\nHere's how a client sends and receives messages with the threading API:\n#!/usr/bin/env python\n\nfrom websockets.sync.client import connect\n\ndef hello():\n with connect(\"ws://localhost:8765\") as websocket:\n websocket.send(\"Hello world!\")\n message = websocket.recv()\n print(f\"Received: {message}\")\n\nhello()\nDoes that look good?\nGet started with the tutorial!\n\n\nwebsockets for enterprise\nAvailable as part of the Tidelift Subscription\nThe maintainers of websockets and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.\n\n(If you contribute to websockets and would like to become an official support provider, let me know.)\nWhy should I use websockets?\nThe development of websockets is shaped by four principles:\n\nCorrectness: websockets is heavily tested for compliance with\nRFC 6455. Continuous integration fails under 100% branch coverage.\nSimplicity: all you need to understand is msg = await ws.recv() and\nawait ws.send(msg). websockets takes care of managing connections\nso you can focus on your application.\nRobustness: websockets is built for production. For example, it was\nthe only library to handle backpressure correctly before the issue\nbecame widely known in the Python community.\nPerformance: memory usage is optimized and configurable. A C extension\naccelerates expensive operations. It's pre-compiled for Linux, macOS and\nWindows and packaged in the wheel format for each system and Python version.\n\nDocumentation is a first class concern in the project. Head over to Read the\nDocs and see for yourself.\n\nWhy shouldn't I use websockets?\n\nIf you prefer callbacks over coroutines: websockets was created to\nprovide the best coroutine-based API to manage WebSocket connections in\nPython. Pick another library for a callback-based API.\n\nIf you're looking for a mixed HTTP / WebSocket library: websockets aims\nat being an excellent implementation of RFC 6455: The WebSocket Protocol\nand RFC 7692: Compression Extensions for WebSocket. Its support for HTTP\nis minimal \u2014 just enough for an HTTP health check.\nIf you want to do both in the same server, look at HTTP frameworks that\nbuild on top of websockets to support WebSocket connections, like\nSanic.\n\n\n\nWhat else?\nBug reports, patches and suggestions are welcome!\nTo report a security vulnerability, please use the Tidelift security\ncontact. Tidelift will coordinate the fix and disclosure.\nFor anything else, please open an issue or send a pull request.\nParticipants must uphold the Contributor Covenant code of conduct.\nwebsockets is released under the BSD license.\n\n\n", "description": "Library for WebSocket clients and servers.", "category": "Web"}, {"name": "websocket-client", "readme": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nwebsocket-client\nDocumentation\nContributing\nInstallation\nUsage Tips\nPerformance\nExamples\nLong-lived Connection\nShort-lived Connection\n\n\n\n\n\nREADME.md\n\n\n\n\n\n\n\n\n\nwebsocket-client\nwebsocket-client is a WebSocket client for Python. It provides access\nto low level APIs for WebSockets. websocket-client implements version\nhybi-13\nof the WebSocket protocol. This client does not currently support the\npermessage-deflate extension from\nRFC 7692.\nDocumentation\nThis project's documentation can be found at\nhttps://websocket-client.readthedocs.io/\nContributing\nPlease see the contribution guidelines\nInstallation\nYou can use either python3 setup.py install or pip3 install websocket-client\nto install. This module is tested on Python 3.8+.\nThere are several optional dependencies that can be installed to enable\nspecific websocket-client features.\n\nTo install python-socks for proxy usage and wsaccel for a minor performance boost, use:\npip3 install websocket-client[optional]\nTo install websockets to run unit tests using the local echo server, use:\npip3 install websocket-client[test]\nTo install Sphinx and sphinx_rtd_theme to build project documentation, use:\npip3 install websocket-client[docs]\n\nWhile not a strict dependency, rel\nis useful when using run_forever with automatic reconnect. Install rel with pip3 install rel.\nFootnote: Some shells, such as zsh, require you to escape the [ and ] characters with a \\.\nUsage Tips\nCheck out the documentation's FAQ for additional guidelines:\nhttps://websocket-client.readthedocs.io/en/latest/faq.html\nKnown issues with this library include lack of WebSocket Compression\nsupport (RFC 7692) and minimal threading documentation/support.\nPerformance\nThe send and validate_utf8 methods can sometimes be bottleneck.\nYou can disable UTF8 validation in this library (and receive a\nperformance enhancement) with the skip_utf8_validation parameter.\nIf you want to get better performance, install wsaccel. While\nwebsocket-client does not depend on wsaccel, it will be used if\navailable. wsaccel doubles the speed of UTF8 validation and\noffers a very minor 10% performance boost when masking the\npayload data as part of the send process. Numpy used to\nbe a suggested performance enhancement alternative, but\nissue #687\nfound it didn't help.\nExamples\nMany more examples are found in the\nexamples documentation.\nLong-lived Connection\nMost real-world WebSockets situations involve longer-lived connections.\nThe WebSocketApp run_forever loop will automatically try to reconnect\nto an open WebSocket connection when a network\nconnection is lost if it is provided with:\n\na dispatcher argument (async dispatcher like rel or pyevent)\na non-zero reconnect argument (delay between disconnection and attempted reconnection)\n\nrun_forever provides a variety of event-based connection controls\nusing callbacks like on_message and on_error.\nrun_forever does not automatically reconnect if the server\ncloses the WebSocket gracefully (returning\na standard websocket close code).\nThis is the logic behind the decision.\nCustomizing behavior when the server closes\nthe WebSocket should be handled in the on_close callback.\nThis example uses rel\nfor the dispatcher to provide automatic reconnection.\nimport websocket\nimport _thread\nimport time\nimport rel\n\ndef on_message(ws, message):\n print(message)\n\ndef on_error(ws, error):\n print(error)\n\ndef on_close(ws, close_status_code, close_msg):\n print(\"### closed ###\")\n\ndef on_open(ws):\n print(\"Opened connection\")\n\nif __name__ == \"__main__\":\n websocket.enableTrace(True)\n ws = websocket.WebSocketApp(\"wss://api.gemini.com/v1/marketdata/BTCUSD\",\n on_open=on_open,\n on_message=on_message,\n on_error=on_error,\n on_close=on_close)\n\n ws.run_forever(dispatcher=rel, reconnect=5) # Set dispatcher to automatic reconnection, 5 second reconnect delay if connection closed unexpectedly\n rel.signal(2, rel.abort) # Keyboard Interrupt\n rel.dispatch()\nShort-lived Connection\nThis is if you want to communicate a short message and disconnect\nimmediately when done. For example, if you want to confirm that a WebSocket\nserver is running and responds properly to a specific request.\nfrom websocket import create_connection\n\nws = create_connection(\"ws://echo.websocket.events/\")\nprint(ws.recv())\nprint(\"Sending 'Hello, World'...\")\nws.send(\"Hello, World\")\nprint(\"Sent\")\nprint(\"Receiving...\")\nresult = ws.recv()\nprint(\"Received '%s'\" % result)\nws.close()\n\n\n"}, {"name": "webencodings", "readme": "\n\n\n\nREADME.rst\n\n\n\n\npython-webencodings\nThis is a Python implementation of the WHATWG Encoding standard.\n\nLatest documentation: http://packages.python.org/webencodings/\nSource code and issue tracker:\nhttps://github.com/gsnedders/python-webencodings\nPyPI releases: http://pypi.python.org/pypi/webencodings\nLicense: BSD\nPython 2.6+ and 3.3+\n\nIn order to be compatible with legacy web content\nwhen interpreting something like Content-Type: text/html; charset=latin1,\ntools need to use a particular set of aliases for encoding labels\nas well as some overriding rules.\nFor example, US-ASCII and iso-8859-1 on the web are actually\naliases for windows-1252, and an UTF-8 or UTF-16 BOM takes precedence\nover any other encoding declaration.\nThe Encoding standard defines all such details so that implementations do\nnot have to reverse-engineer each other.\nThis module has encoding labels and BOM detection,\nbut the actual implementation for encoders and decoders is Python\u2019s.\n\n\n", "description": "Implementation of WHATWG Encoding standard."}, {"name": "weasyprint", "readme": "\nThe Awesome Document Factory\nWeasyPrint is a smart solution helping web developers to create PDF\ndocuments. It turns simple HTML pages into gorgeous statistical reports,\ninvoices, tickets\u2026\nFrom a technical point of view, WeasyPrint is a visual rendering engine for\nHTML and CSS that can export to PDF. It aims to support web standards for\nprinting. WeasyPrint is free software made available under a BSD license.\nIt is based on various libraries but not on a full rendering engine like\nWebKit or Gecko. The CSS layout engine is written in Python, designed for\npagination, and meant to be easy to hack on.\n\nFree software: BSD license\nFor Python 3.7+, tested on CPython and PyPy\nDocumentation: https://doc.courtbouillon.org/weasyprint\nExamples: https://weasyprint.org/#samples\nChangelog: https://github.com/Kozea/WeasyPrint/releases\nCode, issues, tests: https://github.com/Kozea/WeasyPrint\nCode of conduct: https://www.courtbouillon.org/code-of-conduct\nProfessional support: https://www.courtbouillon.org\nDonation: https://opencollective.com/courtbouillon\n\nWeasyPrint has been created and developed by Kozea (https://kozea.fr/).\nProfessional support, maintenance and community management is provided by\nCourtBouillon (https://www.courtbouillon.org/).\nCopyrights are retained by their contributors, no copyright assignment is\nrequired to contribute to WeasyPrint. Unless explicitly stated otherwise, any\ncontribution intentionally submitted for inclusion is licensed under the BSD\n3-clause license, without any additional terms or conditions. For full\nauthorship information, see the version control history.\n", "description": "HTML/CSS to PDF generator."}, {"name": "wcwidth", "readme": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nIntroduction\nInstallation\nExample\nChoosing a Version\nwcwidth, wcswidth\nDeveloping\nUses\nOther Languages\nHistory\n\n\n\n\n\nREADME.rst\n\n\n\n\n \n \n\n\nIntroduction\nThis library is mainly for CLI programs that carefully produce output for\nTerminals, or make pretend to be an emulator.\nProblem Statement: The printable length of most strings are equal to the\nnumber of cells they occupy on the screen 1 character : 1 cell. However,\nthere are categories of characters that occupy 2 cells (full-wide), and\nothers that occupy 0 cells (zero-width).\nSolution: POSIX.1-2001 and POSIX.1-2008 conforming systems provide\nwcwidth(3) and wcswidth(3) C functions of which this python module's\nfunctions precisely copy. These functions return the number of cells a\nunicode string is expected to occupy.\n\nInstallation\nThe stable version of this package is maintained on pypi, install using pip:\npip install wcwidth\n\n\nExample\nProblem: given the following phrase (Japanese),\n\n>>> text = u'\u30b3\u30f3\u30cb\u30c1\u30cf'\n\nPython incorrectly uses the string length of 5 codepoints rather than the\nprintible length of 10 cells, so that when using the rjust function, the\noutput length is wrong:\n>>> print(len('\u30b3\u30f3\u30cb\u30c1\u30cf'))\n5\n\n>>> print('\u30b3\u30f3\u30cb\u30c1\u30cf'.rjust(20, '_'))\n_______________\u30b3\u30f3\u30cb\u30c1\u30cf\n\nBy defining our own \"rjust\" function that uses wcwidth, we can correct this:\n>>> def wc_rjust(text, length, padding=' '):\n... from wcwidth import wcswidth\n... return padding * max(0, (length - wcswidth(text))) + text\n...\n\nOur Solution uses wcswidth to determine the string length correctly:\n>>> from wcwidth import wcswidth\n>>> print(wcswidth('\u30b3\u30f3\u30cb\u30c1\u30cf'))\n10\n\n>>> print(wc_rjust('\u30b3\u30f3\u30cb\u30c1\u30cf', 20, '_'))\n__________\u30b3\u30f3\u30cb\u30c1\u30cf\n\n\nChoosing a Version\nExport an environment variable, UNICODE_VERSION. This should be done by\nterminal emulators or those developers experimenting with authoring one of\ntheir own, from shell:\n$ export UNICODE_VERSION=13.0\n\nIf unspecified, the latest version is used. If your Terminal Emulator does not\nexport this variable, you can use the jquast/ucs-detect utility to\nautomatically detect and export it to your shell.\n\nwcwidth, wcswidth\nUse function wcwidth() to determine the length of a single unicode\ncharacter, and wcswidth() to determine the length of many, a string\nof unicode characters.\nBriefly, return values of function wcwidth() are:\n\n-1\nIndeterminate (not printable).\n0\nDoes not advance the cursor, such as NULL or Combining.\n2\nCharacters of category East Asian Wide (W) or East Asian\nFull-width (F) which are displayed using two terminal cells.\n1\nAll others.\n\nFunction wcswidth() simply returns the sum of all values for each character\nalong a string, or -1 when it occurs anywhere along a string.\nFull API Documentation at http://wcwidth.readthedocs.org\n\nDeveloping\nInstall wcwidth in editable mode:\npip install -e.\n\nExecute unit tests using tox:\ntox\n\nRegenerate python code tables from latest Unicode Specification data files:\ntox -e update\n\nSupplementary tools for browsing and testing terminals for wide unicode\ncharacters are found in the bin/ of this project's source code. Just ensure\nto first pip install -erequirements-develop.txt from this projects main\nfolder. For example, an interactive browser for testing:\npython ./bin/wcwidth-browser.py\n\n\nUses\nThis library is used in:\n\njquast/blessed: a thin, practical wrapper around terminal capabilities in\nPython.\njonathanslenders/python-prompt-toolkit: a Library for building powerful\ninteractive command lines in Python.\ndbcli/pgcli: Postgres CLI with autocompletion and syntax highlighting.\nthomasballinger/curtsies: a Curses-like terminal wrapper with a display\nbased on compositing 2d arrays of text.\nselectel/pyte: Simple VTXXX-compatible linux terminal emulator.\nastanin/python-tabulate: Pretty-print tabular data in Python, a library\nand a command-line utility.\nLuminosoInsight/python-ftfy: Fixes mojibake and other glitches in Unicode\ntext.\nnbedos/termtosvg: Terminal recorder that renders sessions as SVG\nanimations.\npeterbrittain/asciimatics: Package to help people create full-screen text\nUIs.\n\n\nOther Languages\n\ntimoxley/wcwidth: JavaScript\njanlelis/unicode-display_width: Ruby\nalecrabbit/php-wcwidth: PHP\nText::CharWidth: Perl\nbluebear94/Terminal-WCWidth: Perl 6\nmattn/go-runewidth: Go\nemugel/wcwidth: Haxe\naperezdc/lua-wcwidth: Lua\njoachimschmidt557/zig-wcwidth: Zig\nfumiyas/wcwidth-cjk: LD_PRELOAD override\njoshuarubin/wcwidth9: Unicode version 9 in C\n\n\nHistory\n\n0.2.6 2023-01-14\n\nUpdated tables to include Unicode Specification 14.0.0 and 15.0.0.\nChanged developer tools to use pip-compile, and to use jinja2 templates\nfor code generation in bin/update-tables.py to prepare for possible\ncompiler optimization release.\n\n\n0.2.1 .. 0.2.5 2020-06-23\n\nRepository changes to update tests and packaging issues, and\nbegin tagging repository with matching release versions.\n\n\n0.2.0 2020-06-01\n\nEnhancement: Unicode version may be selected by exporting the\nEnvironment variable UNICODE_VERSION, such as 13.0, or 6.3.0.\nSee the jquast/ucs-detect CLI utility for automatic detection.\nEnhancement:\nAPI Documentation is published to readthedocs.org.\nUpdated tables for all Unicode Specifications with files\npublished in a programmatically consumable format, versions 4.1.0\nthrough 13.0\n\n\n0.1.9 2020-03-22\n\nPerformance optimization by Avram Lubkin, PR #35.\nUpdated tables to Unicode Specification 13.0.0.\n\n\n0.1.8 2020-01-01\n\nUpdated tables to Unicode Specification 12.0.0. (PR #30).\n\n\n0.1.7 2016-07-01\n\nUpdated tables to Unicode Specification 9.0.0. (PR #18).\n\n\n0.1.6 2016-01-08 Production/Stable\n\nLICENSE file now included with distribution.\n\n\n0.1.5 2015-09-13 Alpha\n\nBugfix:\nResolution of \"combining character width\" issue, most especially\nthose that previously returned -1 now often (correctly) return 0.\nresolved by Philip Craig via PR #11.\nDeprecated:\nThe module path wcwidth.table_comb is no longer available,\nit has been superseded by module path wcwidth.table_zero.\n\n\n0.1.4 2014-11-20 Pre-Alpha\n\nFeature: wcswidth() now determines printable length\nfor (most) combining characters. The developer's tool\nbin/wcwidth-browser.py is improved to display combining\ncharacters when provided the --combining option\n(Thomas Ballinger and Leta Montopoli PR #5).\nFeature: added static analysis (prospector) to testing\nframework.\n\n\n0.1.3 2014-10-29 Pre-Alpha\n\nBugfix: 2nd parameter of wcswidth was not honored.\n(Thomas Ballinger, PR #4).\n\n\n0.1.2 2014-10-28 Pre-Alpha\n\nUpdated tables to Unicode Specification 7.0.0.\n(Thomas Ballinger, PR #3).\n\n\n0.1.1 2014-05-14 Pre-Alpha\n\nInitial release to pypi, Based on Unicode Specification 6.3.0\n\n\n\nThis code was originally derived directly from C code of the same name,\nwhose latest version is available at\nhttp://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c:\n* Markus Kuhn -- 2007-05-26 (Unicode 5.0)\n*\n* Permission to use, copy, modify, and distribute this software\n* for any purpose and without fee is hereby granted. The author\n* disclaims all warranties with regard to this software.\n\n\n\n", "description": "Measures number of wide characters in a terminal."}, {"name": "watchfiles", "readme": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nwatchfiles\nInstallation\nUsage\nwatch Usage\nawatch Usage\nrun_process Usage\narun_process Usage\nCLI\n\n\n\n\n\nREADME.md\n\n\n\n\nwatchfiles\n\n\n\n\n\nSimple, modern and high performance file watching and code reload in python.\n\nDocumentation: watchfiles.helpmanual.io\nSource Code: github.com/samuelcolvin/watchfiles\n\nUnderlying file system notifications are handled by the Notify rust library.\nThis package was previously named \"watchgod\",\nsee the migration guide for more information.\nInstallation\nwatchfiles requires Python 3.7 - 3.10.\npip install watchfiles\nBinaries are available for:\n\nLinux: x86_64, aarch64, i686, armv7l, musl-x86_64 & musl-aarch64\nMacOS: x86_64 & arm64 (except python 3.7)\nWindows: amd64 & win32\n\nOtherwise, you can install from source which requires Rust stable to be installed.\nUsage\nHere are some examples of what watchfiles can do:\nwatch Usage\nfrom watchfiles import watch\n\nfor changes in watch('./path/to/dir'):\n print(changes)\nSee watch docs for more details.\nawatch Usage\nimport asyncio\nfrom watchfiles import awatch\n\nasync def main():\n async for changes in awatch('/path/to/dir'):\n print(changes)\n\nasyncio.run(main())\nSee awatch docs for more details.\nrun_process Usage\nfrom watchfiles import run_process\n\ndef foobar(a, b, c):\n ...\n\nif __name__ == '__main__':\n run_process('./path/to/dir', target=foobar, args=(1, 2, 3))\nSee run_process docs for more details.\narun_process Usage\nimport asyncio\nfrom watchfiles import arun_process\n\ndef foobar(a, b, c):\n ...\n\nasync def main():\n await arun_process('./path/to/dir', target=foobar, args=(1, 2, 3))\n\nif __name__ == '__main__':\n asyncio.run(main())\nSee arun_process docs for more details.\nCLI\nwatchfiles also comes with a CLI for running and reloading code. To run some command when files in src change:\nwatchfiles \"some command\" src\n\nFor more information, see the CLI docs.\nOr run\nwatchfiles --help\n\n\n", "description": "File watching and code reloading."}, {"name": "wasabi", "readme": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nwasabi: A lightweight console printing and formatting toolkit\n\ud83d\udcac FAQ\nAre you going to add more features?\nCan I use this for my projects?\nWhy wasabi?\n\u231b\ufe0f Installation\n\ud83c\udf9b API\nfunctionmsg\nclassPrinter\nmethodPrinter.__init__\nmethodPrinter.text\nmethodPrinter.good, Printer.fail, Printer.warn, Printer.info\nmethodPrinter.divider\ncontextmanagerPrinter.loading\nmethodPrinter.table, Printer.row\npropertyPrinter.counts\nTables\nfunctiontable\nfunctionrow\nclassTracebackPrinter\nmethodTracebackPrinter.__init__\nmethodTracebackPrinter.__call__\nclassMarkdownRenderer\nmethodMarkdownRenderer.__init__\nmethodMarkdownRenderer.add\npropertyMarkdownRenderer.text\nmethodMarkdownRenderer.table\nmethodMarkdownRenderer.title\nmethodMarkdownRenderer.list\nmethodMarkdownRenderer.link\nmethodMarkdownRenderer.code_block\nmethodMarkdownRenderer.code, MarkdownRenderer.bold, MarkdownRenderer.italic\nUtilities\nfunctioncolor\nfunctionwrap\nfunctiondiff_strings\nEnvironment variables\n\ud83d\udd14 Run tests\n\n\n\n\n\nREADME.md\n\n\n\n\nwasabi: A lightweight console printing and formatting toolkit\nOver the years, I've written countless implementations of coloring and\nformatting utilities to output messages in our libraries like\nspaCy, Thinc and\nProdigy. While there are many other great open-source\noptions, I've always ended up wanting something slightly different or slightly\ncustom.\nThis package is still a work in progress and aims to bundle those utilities in a\nstandardised way so they can be shared across our other projects. It's super\nlightweight, has zero dependencies and works with Python 3.6+.\n\n\n\n\n\n\n\ud83d\udcac FAQ\nAre you going to add more features?\nYes, there's still a few of helpers and features to port over. However, the new\nfeatures will be heavily biased by what we (think we) need. I always appreciate\npull requests to improve the existing functionality \u2013 but I want to keep this\nlibrary as simple, lightweight and specific as possible.\nCan I use this for my projects?\nSure, if you like it, feel free to adopt it! Just keep in mind that the package\nis very specific and not intended to be a full-featured and fully customisable\nformatting library. If that's what you're looking for, you might want to try\nother packages \u2013 for example, colored,\ncrayons,\ncolorful,\ntabulate,\nconsole or\npy-term, to name a few.\nWhy wasabi?\nI was looking for a short and descriptive name, but everything was already\ntaken. So I ended up naming this package after one of my rats, Wasabi. \ud83d\udc00\n\u231b\ufe0f Installation\npip install wasabi\n\ud83c\udf9b API\nfunction msg\nAn instance of Printer, initialized with the default config. Useful as a quick\nshortcut if you don't need to customize initialization.\nfrom wasabi import msg\n\nmsg.good(\"Success!\")\nclass Printer\nmethod Printer.__init__\nfrom wasabi import Printer\n\nmsg = Printer()\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\npretty\nbool\nPretty-print output with colors and icons.\nTrue\n\n\nno_print\nbool\nDon't actually print, just return.\nFalse\n\n\ncolors\ndict\nAdd or overwrite color values, names mapped to 0-256.\nNone\n\n\nicons\ndict\nAdd or overwrite icon. Name mapped to unicode.\nNone\n\n\nline_max\nint\nMaximum line length (for divider).\n80\n\n\nanimation\nstr\nSteps of loading animation for Printer.loading.\n\"\u2819\u2839\u2838\u283c\u2834\u2826\u2827\u2807\u280f\"\n\n\nanimation_ascii\nstr\nAlternative animation for ASCII terminals.\n\"|/-\\\\\"\n\n\nhide_animation\nbool\nDon't display animation, e.g. for logs.\nFalse\n\n\nignore_warnings\nbool\nDon't output messages of type MESSAGE.WARN.\nFalse\n\n\nenv_prefix\nstr\nPrefix for environment variables, e.g. WASABI_LOG_FRIENDLY.\n\"WASABI\"\n\n\ntimestamp\nbool\nAdd timestamp before output.\nFalse\n\n\nRETURNS\nPrinter\nThe initialized printer.\n-\n\n\n\nmethod Printer.text\nmsg = Printer()\nmsg.text(\"Hello world!\")\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ntitle\nstr\nThe main text to print.\n\"\"\n\n\ntext\nstr\nOptional additional text to print.\n\"\"\n\n\ncolor\n\u00a0unicode / int\nColor name or value.\nNone\n\n\nicon\nstr\nName of icon to add.\nNone\n\n\nshow\nbool\nWhether to print or not. Can be used to only output messages under certain condition, e.g. if --verbose flag is set.\nTrue\n\n\nspaced\nbool\nWhether to add newlines around the output.\nFalse\n\n\nno_print\nbool\nDon't actually print, just return. Overwrites global setting.\nFalse\n\n\nexits\nint\nIf set, perform a system exit with the given code after printing.\nNone\n\n\n\nmethod Printer.good, Printer.fail, Printer.warn, Printer.info\nPrint special formatted messages.\nmsg = Printer()\nmsg.good(\"Success\")\nmsg.fail(\"Error\")\nmsg.warn(\"Warning\")\nmsg.info(\"Info\")\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ntitle\nstr\nThe main text to print.\n\"\"\n\n\ntext\nstr\nOptional additional text to print.\n\"\"\n\n\nshow\nbool\nWhether to print or not. Can be used to only output messages under certain condition, e.g. if --verbose flag is set.\nTrue\n\n\nexits\nint\nIf set, perform a system exit with the given code after printing.\nNone\n\n\n\nmethod Printer.divider\nPrint a formatted divider.\nmsg = Printer()\nmsg.divider(\"Heading\")\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ntext\nstr\nHeadline text. If empty, only the line is printed.\n\"\"\n\n\nchar\nstr\nSingle line character to repeat.\n\"=\"\n\n\nshow\nbool\nWhether to print or not. Can be used to only output messages under certain condition, e.g. if --verbose flag is set.\nTrue\n\n\nicon\nstr\nOptional icon to use with title.\nNone\n\n\n\ncontextmanager Printer.loading\nmsg = Printer()\nwith msg.loading(\"Loading...\"):\n # Do something here that takes longer\n time.sleep(10)\nmsg.good(\"Successfully loaded something!\")\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ntext\nstr\nThe text to display while loading.\n\"Loading...\"\n\n\n\nmethod Printer.table, Printer.row\nSee Tables.\nproperty Printer.counts\nGet the counts of how often the special printers were fired, e.g.\nMESSAGES.GOOD. Can be used to print an overview like \"X warnings\"\nmsg = Printer()\nmsg.good(\"Success\")\nmsg.fail(\"Error\")\nmsg.warn(\"Error\")\n\nprint(msg.counts)\n# Counter({'good': 1, 'fail': 2, 'warn': 0, 'info': 0})\n\n\n\nArgument\nType\nDescription\n\n\n\n\nRETURNS\nCounter\nThe counts for the individual special message types.\n\n\n\nTables\nfunction table\nLightweight helper to format tabular data.\nfrom wasabi import table\n\ndata = [(\"a1\", \"a2\", \"a3\"), (\"b1\", \"b2\", \"b3\")]\nheader = (\"Column 1\", \"Column 2\", \"Column 3\")\nwidths = (8, 9, 10)\naligns = (\"r\", \"c\", \"l\")\nformatted = table(data, header=header, divider=True, widths=widths, aligns=aligns)\nColumn 1 Column 2 Column 3\n-------- --------- ----------\n a1 a2 a3\n b1 b2 b3\n\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ndata\niterable / dict\nThe data to render. Either a list of lists (one per row) or a dict for two-column tables.\n\n\n\nheader\niterable\nOptional header columns.\nNone\n\n\nfooter\niterable\nOptional footer columns.\nNone\n\n\ndivider\nbool\nShow a divider line between header/footer and body.\nFalse\n\n\nwidths\niterable / \"auto\"\nColumn widths in order. If \"auto\", widths will be calculated automatically based on the largest value.\n\"auto\"\n\n\nmax_col\nint\nMaximum column width.\n30\n\n\nspacing\nint\nNumber of spaces between columns.\n3\n\n\naligns\niterable / unicode\nColumns alignments in order. \"l\" (left, default), \"r\" (right) or \"c\" (center). If If a string, value is used for all columns.\nNone\n\n\nmultiline\nbool\nIf a cell value is a list of a tuple, render it on multiple lines, with one value per line.\nFalse\n\n\nenv_prefix\nunicode\nPrefix for environment variables, e.g. WASABI_LOG_FRIENDLY.\n\"WASABI\"\n\n\ncolor_values\ndict\nAdd or overwrite color values, name mapped to value.\nNone\n\n\nfg_colors\niterable\nForeground colors, one per column. None can be specified for individual columns to retain the default background color.\nNone\n\n\nbg_colors\niterable\nBackground colors, one per column. None can be specified for individual columns to retain the default background color.\nNone\n\n\nRETURNS\nstr\nThe formatted table.\n\n\n\n\nfunction row\nfrom wasabi import row\n\ndata = (\"a1\", \"a2\", \"a3\")\nformatted = row(data)\na1 a2 a3\n\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ndata\niterable\nThe individual columns to format.\n\n\n\nwidths\nlist / int / \"auto\"\nColumn widths, either one integer for all columns or an iterable of values. If \"auto\", widths will be calculated automatically based on the largest value.\n\"auto\"\n\n\nspacing\nint\nNumber of spaces between columns.\n3\n\n\naligns\nlist\nColumns alignments in order. \"l\" (left), \"r\" (right) or \"c\" (center).\nNone\n\n\nenv_prefix\nunicode\nPrefix for environment variables, e.g. WASABI_LOG_FRIENDLY.\n\"WASABI\"\n\n\nfg_colors\nlist\nForeground colors for the columns, in order. None can be specified for individual columns to retain the default foreground color.\nNone\n\n\nbg_colors\nlist\nBackground colors for the columns, in order. None can be specified for individual columns to retain the default background color.\nNone\n\n\nRETURNS\nstr\nThe formatted row.\n\n\n\n\nclass TracebackPrinter\nHelper to output custom formatted tracebacks and error messages. Currently used\nin Thinc.\nmethod TracebackPrinter.__init__\nInitialize a traceback printer.\nfrom wasabi import TracebackPrinter\n\ntb = TracebackPrinter(tb_base=\"thinc\", tb_exclude=(\"check.py\",))\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ncolor_error\nstr / int\nColor name or code for errors (passed to color helper).\n\"red\"\n\n\ncolor_tb\nstr / int\nColor name or code for traceback headline (passed to color helper).\n\"blue\"\n\n\ncolor_highlight\nstr / int\nColor name or code for highlighted text (passed to color helper).\n\"yellow\"\n\n\nindent\nint\nNumber of spaces to use for indentation.\n2\n\n\ntb_base\nstr\nName of directory to use to show relative paths. For example, \"thinc\" will look for the last occurence of \"/thinc/\" in a path and only show path to the right of it.\nNone\n\n\ntb_exclude\ntuple\nList of filenames to exclude from traceback.\ntuple()\n\n\nRETURNS\nTracebackPrinter\nThe traceback printer.\n\n\n\n\nmethod TracebackPrinter.__call__\nOutput custom formatted tracebacks and errors.\nfrom wasabi import TracebackPrinter\nimport traceback\n\ntb = TracebackPrinter(tb_base=\"thinc\", tb_exclude=(\"check.py\",))\n\nerror = tb(\"Some error\", \"Error description\", highlight=\"kwargs\", tb=traceback.extract_stack())\nraise ValueError(error)\n Some error\n Some error description\n\n Traceback:\n \u251c\u2500 [61] in .env/lib/python3.6/site-packages/pluggy/manager.py\n \u251c\u2500\u2500\u2500 _multicall [187] in .env/lib/python3.6/site-packages/pluggy/callers.py\n \u2514\u2500\u2500\u2500\u2500\u2500 pytest_fixture_setup [969] in .env/lib/python3.6/site-packages/_pytest/fixtures.py\n >>> result = call_fixture_func(fixturefunc, request, kwargs)\n\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ntitle\nstr\nThe message title.\n\n\n\n*texts\nstr\nOptional texts to print (one per line).\n\n\n\nhighlight\nstr\nOptional sequence to highlight in the traceback, e.g. the bad value that caused the error.\nFalse\n\n\ntb\niterable\nThe traceback, e.g. generated by traceback.extract_stack().\nNone\n\n\nRETURNS\nstr\nThe formatted traceback. Can be printed or raised by custom exception.\n\n\n\n\nclass MarkdownRenderer\nHelper to create Markdown-formatted content. Will store the blocks added to the\nMarkdown document in order.\nfrom wasabi import MarkdownRenderer\n\nmd = MarkdownRenderer()\nmd.add(md.title(1, \"Hello world\"))\nmd.add(\"This is a paragraph\")\nprint(md.text)\nmethod MarkdownRenderer.__init__\nInitialize a Markdown renderer.\nfrom wasabi import MarkdownRenderer\n\nmd = MarkdownRenderer()\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\nno_emoji\nbool\nDon't include emoji in titles.\nFalse\n\n\nRETURNS\nMarkdownRenderer\nThe renderer.\n\n\n\n\nmethod MarkdownRenderer.add\nAdd a block to the Markdown document.\nfrom wasabi import MarkdownRenderer\n\nmd = MarkdownRenderer()\nmd.add(\"This is a paragraph\")\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ntext\nstr\nThe content to add.\n\n\n\n\nproperty MarkdownRenderer.text\nThe rendered Markdown document.\nmd = MarkdownRenderer()\nmd.add(\"This is a paragraph\")\nprint(md.text)\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\nRETURNS\nstr\nThe document as a single string.\n\n\n\n\nmethod MarkdownRenderer.table\nCreate a Markdown-formatted table.\nmd = MarkdownRenderer()\ntable = md.table([(\"a\", \"b\"), (\"c\", \"d\")], [\"Column 1\", \"Column 2\"])\nmd.add(table)\n| Column 1 | Column 2 |\n| --- | --- |\n| a | b |\n| c | d |\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ndata\nIterable[Iterable[str]]\nThe body, one iterable per row, containig an interable of column contents.\n\n\n\nheader\nIterable[str]\nThe column names.\n\n\n\naligns\nIterable[str]\nColumns alignments in order. \"l\" (left, default), \"r\" (right) or \"c\" (center).\nNone\n\n\nRETURNS\nstr\nThe table.\n\n\n\n\nmethod MarkdownRenderer.title\nCreate a Markdown-formatted heading.\nmd = MarkdownRenderer()\nmd.add(md.title(1, \"Hello world\"))\nmd.add(md.title(2, \"Subheading\", \"\ud83d\udc96\"))\n# Hello world\n\n## \ud83d\udc96 Subheading\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\nlevel\nint\nThe heading level, e.g. 3 for ###.\n\n\n\ntext\nstr\nThe heading text.\n\n\n\nemoji\nstr\nOptional emoji to show before heading.\nNone\n\n\nRETURNS\nstr\nThe rendered title.\n\n\n\n\nmethod MarkdownRenderer.list\nCreate a Markdown-formatted non-nested list.\nmd = MarkdownRenderer()\nmd.add(md.list([\"item\", \"other item\"]))\nmd.add(md.list([\"first item\", \"second item\"], numbered=True))\n- item\n- other item\n\n1. first item\n2. second item\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\nitems\nIterable[str]\nThe list items.\n\n\n\nnumbered\nbool\nWhether to use a numbered list.\nFalse\n\n\nRETURNS\nstr\nThe rendered list.\n\n\n\n\nmethod MarkdownRenderer.link\nCreate a Markdown-formatted link.\nmd = MarkdownRenderer()\nmd.add(md.link(\"Google\", \"https://google.com\"))\n[Google](https://google.com)\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ntext\nstr\nThe link text.\n\n\n\nurl\nstr\nThe link URL.\n\n\n\nRETURNS\nstr\nThe rendered link.\n\n\n\n\nmethod MarkdownRenderer.code_block\nCreate a Markdown-formatted code block.\nmd = MarkdownRenderer()\nmd.add(md.code_block(\"import spacy\", \"python\"))\n```python\nimport spacy\n```\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ntext\nstr\nThe code text.\n\n\n\nlang\nstr\nOptional code language.\n\"\"\n\n\nRETURNS\nstr\nThe rendered code block.\n\n\n\n\nmethod MarkdownRenderer.code, MarkdownRenderer.bold, MarkdownRenderer.italic\nCreate a Markdown-formatted text.\nmd = MarkdownRenderer()\nmd.add(md.code(\"import spacy\"))\nmd.add(md.bold(\"Hello!\"))\nmd.add(md.italic(\"Emphasis\"))\n`import spacy`\n\n**Hello!**\n\n_Emphasis_\nUtilities\nfunction color\nfrom wasabi import color\n\nformatted = color(\"This is a text\", fg=\"white\", bg=\"green\", bold=True)\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ntext\nstr\nThe text to be formatted.\n-\n\n\nfg\nstr / int\nForeground color. String name or 0 - 256.\nNone\n\n\nbg\nstr / int\nBackground color. String name or 0 - 256.\nNone\n\n\nbold\nbool\nFormat the text in bold.\nFalse\n\n\nunderline\nbool\nFormat the text by underlining.\nFalse\n\n\nRETURNS\nstr\nThe formatted string.\n\n\n\n\nfunction wrap\nfrom wasabi import wrap\n\nwrapped = wrap(\"Hello world, this is a text.\", indent=2)\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\ntext\nstr\nThe text to wrap.\n-\n\n\nwrap_max\nint\nMaximum line width, including indentation.\n80\n\n\nindent\nint\nNumber of spaces used for indentation.\n4\n\n\nRETURNS\nstr\nThe wrapped text with line breaks.\n\n\n\n\nfunction diff_strings\nfrom wasabi import diff_strings\n\ndiff = diff_strings(\"hello world!\", \"helloo world\")\n\n\n\nArgument\nType\nDescription\nDefault\n\n\n\n\na\nstr\nThe first string to diff.\n\n\n\nb\nstr\nThe second string to diff.\n\n\n\nfg\nstr / int\nForeground color. String name or 0 - 256.\n\"black\"\n\n\nbg\ntuple\nBackground colors as (insert, delete) tuple of string name or 0 - 256.\n(\"green\", \"red\")\n\n\nRETURNS\nstr\nThe formatted diff.\n\n\n\n\nEnvironment variables\nWasabi also respects the following environment variables. The prefix can be\ncustomised on the Printer via the env_prefix argument. For example, setting\nenv_prefix=\"SPACY\" will expect the environment variable SPACY_LOG_FRIENDLY.\n\n\n\nName\nDescription\n\n\n\n\nANSI_COLORS_DISABLED\nDisable colors.\n\n\nWASABI_LOG_FRIENDLY\nMake output nicer for logs (no colors, no animations).\n\n\nWASABI_NO_PRETTY\nDisable pretty printing, e.g. colors and icons.\n\n\n\n\ud83d\udd14 Run tests\nFork or clone the repo, make sure you have pytest installed and then run it on\nthe package directory. The tests are located in\n/wasabi/tests.\npip install pytest\ncd wasabi\npython -m pytest wasabi\n\n\n", "description": "Formatting and printing toolkit for console output."}, {"name": "Wand", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nWand\nDocs\nCommunity\n\n\n\n\n\nREADME.rst\n\n\n\n\n\n\nWand\nWand is a ctypes-based simple ImageMagick binding for Python,\nsupporting 2.7, 3.3+, and PyPy. All functionalities of MagickWand API are\nimplemented in Wand.\nYou can install the package from PyPI by using pip:\n$ pip install Wand\nOr would you like to enjoy the bleeding edge? Check out the head\nrevision of the source code from the GitHub repository:\n$ git clone git://github.com/emcconville/wand.git\n$ cd wand/\n$ python setup.py install\n\nDocs\n\nRecent version\nhttps://docs.wand-py.org/\nDevelopment version\nhttps://docs.wand-py.org/en/latest/\n\n\n\n\nCommunity\n\nWebsite\nhttp://wand-py.org/\nGitHub\nhttps://github.com/emcconville/wand\nPackage Index (Cheeseshop)\nhttps://pypi.python.org/pypi/Wand\n\n\nDiscord\nhttps://discord.gg/wtDWDE9fXK\nStack Overflow tag (Q&A)\nhttp://stackoverflow.com/questions/tagged/wand\nContinuous Integration (Travis CI)\nhttps://app.travis-ci.com/emcconville/wand\n\n\nContinuous Integration (GitHub Actions)\nhttps://github.com/emcconville/wand/actions\n\n\n\nCode Coverage\nhttps://coveralls.io/r/emcconville/wand\n\n\n\n\n\n", "description": "ImageMagick binding for Python."}, {"name": "uvloop", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nPerformance\nInstallation\nUsing uvloop\nBuilding From Source\nLicense\n\n\n\n\n\nREADME.rst\n\n\n\n\n\n\n\n\nuvloop is a fast, drop-in replacement of the built-in asyncio\nevent loop. uvloop is implemented in Cython and uses libuv\nunder the hood.\nThe project documentation can be found\nhere. Please also check out the\nwiki.\n\nPerformance\nuvloop makes asyncio 2-4x faster.\n\nThe above chart shows the performance of an echo server with different\nmessage sizes. The sockets benchmark uses loop.sock_recv() and\nloop.sock_sendall() methods; the streams benchmark uses asyncio\nhigh-level streams, created by the asyncio.start_server() function;\nand the protocol benchmark uses loop.create_server() with a simple\necho protocol. Read more about uvloop in a\nblog post\nabout it.\n\nInstallation\nuvloop requires Python 3.7 or greater and is available on PyPI.\nUse pip to install it:\n$ pip install uvloop\n\nNote that it is highly recommended to upgrade pip before installing\nuvloop with:\n$ pip install -U pip\n\n\nUsing uvloop\nimport asyncio\nimport sys\n\nimport uvloop\n\nasync def main():\n # Main entry-point.\n ...\n\nif sys.version_info >= (3, 11):\n with asyncio.Runner(loop_factory=uvloop.new_event_loop) as runner:\n runner.run(main())\nelse:\n uvloop.install()\n asyncio.run(main())\n\nBuilding From Source\nTo build uvloop, you'll need Python 3.7 or greater:\n\nClone the repository:\n$ git clone --recursive git@github.com:MagicStack/uvloop.git\n$ cd uvloop\n\n\nCreate a virtual environment and activate it:\n$ python3.7 -m venv uvloop-dev\n$ source uvloop-dev/bin/activate\n\n\nInstall development dependencies:\n$ pip install -e .[dev]\n\n\nBuild and run tests:\n$ make\n$ make test\n\n\n\n\nLicense\nuvloop is dual-licensed under MIT and Apache 2.0 licenses.\n\n\n", "description": "Drop-in asyncio event loop replacement."}, {"name": "uvicorn", "readme": "\n\n\n\n\nAn ASGI web server, for Python.\n\n\n\n\nDocumentation: https://www.uvicorn.org\nRequirements: Python 3.8+\nUvicorn is an ASGI web server implementation for Python.\nUntil recently Python has lacked a minimal low-level server/application interface for\nasync frameworks. The ASGI specification fills this gap, and means we're now able to\nstart building a common set of tooling usable across all async frameworks.\nUvicorn supports HTTP/1.1 and WebSockets.\nQuickstart\nInstall using pip:\n$ pip install uvicorn\n\nThis will install uvicorn with minimal (pure Python) dependencies.\n$ pip install 'uvicorn[standard]'\n\nThis will install uvicorn with \"Cython-based\" dependencies (where possible) and other \"optional extras\".\nIn this context, \"Cython-based\" means the following:\n\nthe event loop uvloop will be installed and used if possible.\nthe http protocol will be handled by httptools if possible.\n\nMoreover, \"optional extras\" means that:\n\nthe websocket protocol will be handled by websockets (should you want to use wsproto you'd need to install it manually) if possible.\nthe --reload flag in development mode will use watchfiles.\nwindows users will have colorama installed for the colored logs.\npython-dotenv will be installed should you want to use the --env-file option.\nPyYAML will be installed to allow you to provide a .yaml file to --log-config, if desired.\n\nCreate an application, in example.py:\nasync def app(scope, receive, send):\n assert scope['type'] == 'http'\n\n await send({\n 'type': 'http.response.start',\n 'status': 200,\n 'headers': [\n (b'content-type', b'text/plain'),\n ],\n })\n await send({\n 'type': 'http.response.body',\n 'body': b'Hello, world!',\n })\n\nRun the server:\n$ uvicorn example:app\n\n\nWhy ASGI?\nMost well established Python Web frameworks started out as WSGI-based frameworks.\nWSGI applications are a single, synchronous callable that takes a request and returns a response.\nThis doesn\u2019t allow for long-lived connections, like you get with long-poll HTTP or WebSocket connections,\nwhich WSGI doesn't support well.\nHaving an async concurrency model also allows for options such as lightweight background tasks,\nand can be less of a limiting factor for endpoints that have long periods being blocked on network\nI/O such as dealing with slow HTTP requests.\n\nAlternative ASGI servers\nA strength of the ASGI protocol is that it decouples the server implementation\nfrom the application framework. This allows for an ecosystem of interoperating\nwebservers and application frameworks.\nDaphne\nThe first ASGI server implementation, originally developed to power Django Channels, is the Daphne webserver.\nIt is run widely in production, and supports HTTP/1.1, HTTP/2, and WebSockets.\nAny of the example applications given here can equally well be run using daphne instead.\n$ pip install daphne\n$ daphne app:App\n\nHypercorn\nHypercorn was initially part of the Quart web framework, before\nbeing separated out into a standalone ASGI server.\nHypercorn supports HTTP/1.1, HTTP/2, and WebSockets.\nIt also supports the excellent trio async framework, as an alternative to asyncio.\n$ pip install hypercorn\n$ hypercorn app:App\n\nMangum\nMangum is an adapter for using ASGI applications with AWS Lambda & API Gateway.\n\nUvicorn is BSD licensed code.Designed & crafted with care.\u2014 \ud83e\udd84 \u2014\n", "description": "Lightning-fast ASGI server implementation.", "category": "Web"}, {"name": "ujson", "readme": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nUltraJSON\nUsage\nEncoder options\nencode_html_chars\nensure_ascii\nescape_forward_slashes\nindent\nBenchmarks\nTest machine\nVersions\nBuild options\nDebugging symbols\nUJSON_BUILD_NO_STRIP\nUsing an external or system copy of the double-conversion library\nUJSON_BUILD_DC_INCLUDES\nUJSON_BUILD_DC_LIBS\n\n\n\n\n\nREADME.md\n\n\n\n\nUltraJSON\n\n\n\n\n\n\n\nUltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for\nPython 3.8+.\nInstall with pip:\npython -m pip install ujson\nUsage\nMay be used as a drop in replacement for most other JSON parsers for Python:\n>>> import ujson\n>>> ujson.dumps([{\"key\": \"value\"}, 81, True])\n'[{\"key\":\"value\"},81,true]'\n>>> ujson.loads(\"\"\"[{\"key\": \"value\"}, 81, true]\"\"\")\n[{'key': 'value'}, 81, True]\nEncoder options\nencode_html_chars\nUsed to enable special encoding of \"unsafe\" HTML characters into safer Unicode\nsequences. Default is False:\n>>> ujson.dumps(\"\")\nMarkup('<script>alert(document.cookie);</script>')\n\n>>> # wrap in Markup to mark text \"safe\" and prevent escaping\n>>> Markup(\"Hello\")\nMarkup('hello')\n\n>>> escape(Markup(\"Hello\"))\nMarkup('hello')\n\n>>> # Markup is a str subclass\n>>> # methods and operators escape their arguments\n>>> template = Markup(\"Hello {name}\")\n>>> template.format(name='\"World\"')\nMarkup('Hello "World"')\n\n\nDonate\nThe Pallets organization develops and supports MarkupSafe and other\npopular packages. In order to grow the community of contributors and\nusers, and allow the maintainers to devote more time to the projects,\nplease donate today.\n\n\nLinks\n\nDocumentation: https://markupsafe.palletsprojects.com/\nChanges: https://markupsafe.palletsprojects.com/changes/\nPyPI Releases: https://pypi.org/project/MarkupSafe/\nSource Code: https://github.com/pallets/markupsafe/\nIssue Tracker: https://github.com/pallets/markupsafe/issues/\nChat: https://discord.gg/pallets\n\n\n", "description": "Implements a text object that escapes characters to make strings safe for using in HTML and XML."}, {"name": "markdownify", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nInstallation\nUsage\nOptions\nConverting BeautifulSoup objects\nCreating Custom Converters\nCommand Line Interface\nDevelopment\n\n\n\n\n\nREADME.rst\n\n\n\n\n \n\nInstallation\npip install markdownify\n\nUsage\nConvert some HTML to Markdown:\nfrom markdownify import markdownify as md\nmd('Yay GitHub') # > '**Yay** [GitHub](http://github.com)'\nSpecify tags to exclude:\nfrom markdownify import markdownify as md\nmd('Yay GitHub', strip=['a']) # > '**Yay** GitHub'\n...or specify the tags you want to include:\nfrom markdownify import markdownify as md\nmd('Yay GitHub', convert=['b']) # > '**Yay** GitHub'\n\nOptions\nMarkdownify supports the following options:\n\nstrip\nA list of tags to strip. This option can't be used with the\nconvert option.\nconvert\nA list of tags to convert. This option can't be used with the\nstrip option.\nautolinks\nA boolean indicating whether the \"automatic link\" style should be used when\na a tag's contents match its href. Defaults to True.\ndefault_title\nA boolean to enable setting the title of a link to its href, if no title is\ngiven. Defaults to False.\nheading_style\nDefines how headings should be converted. Accepted values are ATX,\nATX_CLOSED, SETEXT, and UNDERLINED (which is an alias for\nSETEXT). Defaults to UNDERLINED.\nbullets\nAn iterable (string, list, or tuple) of bullet styles to be used. If the\niterable only contains one item, it will be used regardless of how deeply\nlists are nested. Otherwise, the bullet will alternate based on nesting\nlevel. Defaults to '*+-'.\nstrong_em_symbol\nIn markdown, both * and _ are used to encode strong or\nemphasized texts. Either of these symbols can be chosen by the options\nASTERISK (default) or UNDERSCORE respectively.\nsub_symbol, sup_symbol\nDefine the chars that surround and text. Defaults to an\nempty string, because this is non-standard behavior. Could be something like\n~ and ^ to result in ~sub~ and ^sup^.\nnewline_style\nDefines the style of marking linebreaks (
) in markdown. The default\nvalue SPACES of this option will adopt the usual two spaces and a newline,\nwhile BACKSLASH will convert a linebreak to \\\\n (a backslash and a\nnewline). While the latter convention is non-standard, it is commonly\npreferred and supported by a lot of interpreters.\ncode_language\nDefines the language that should be assumed for all
 sections.\nUseful, if all code on a page is in the same programming language and\nshould be annotated with ```python or similar.\nDefaults to '' (empty string) and can be any string.\ncode_language_callback\nWhen the HTML code contains pre tags that in some way provide the code\nlanguage, for example as class, this callback can be used to extract the\nlanguage from the tag and prefix it to the converted pre tag.\nThe callback gets one single argument, an BeautifylSoup object, and returns\na string containing the code language, or None.\nAn example to use the class name as code language could be:\ndef callback(el):\n    return el['class'][0] if el.has_attr('class') else None\n\nDefaults to None.\n\nescape_asterisks\nIf set to False, do not escape * to \\* in text.\nDefaults to True.\nescape_underscores\nIf set to False, do not escape _ to \\_ in text.\nDefaults to True.\nkeep_inline_images_in\nImages are converted to their alt-text when the images are located inside\nheadlines or table cells. If some inline images should be converted to\nmarkdown images instead, this option can be set to a list of parent tags\nthat should be allowed to contain inline images, for example ['td'].\nDefaults to an empty list.\nwrap, wrap_width\nIf wrap is set to True, all text paragraphs are wrapped at\nwrap_width characters. Defaults to False and 80.\nUse with newline_style=BACKSLASH to keep line breaks in paragraphs.\n\nOptions may be specified as kwargs to the markdownify function, or as a\nnested Options class in MarkdownConverter subclasses.\n\nConverting BeautifulSoup objects\nfrom markdownify import MarkdownConverter\n\n# Create shorthand method for conversion\ndef md(soup, **options):\n    return MarkdownConverter(**options).convert_soup(soup)\n\nCreating Custom Converters\nIf you have a special usecase that calls for a special conversion, you can\nalways inherit from MarkdownConverter and override the method you want to\nchange:\nfrom markdownify import MarkdownConverter\n\nclass ImageBlockConverter(MarkdownConverter):\n    \"\"\"\n    Create a custom MarkdownConverter that adds two newlines after an image\n    \"\"\"\n    def convert_img(self, el, text, convert_as_inline):\n        return super().convert_img(el, text, convert_as_inline) + '\\n\\n'\n\n# Create shorthand method for conversion\ndef md(html, **options):\n    return ImageBlockConverter(**options).convert(html)\n\nCommand Line Interface\nUse markdownify example.html > example.md or pipe input from stdin\n(cat example.html | markdownify > example.md).\nCall markdownify -h to see all available options.\nThey are the same as listed above and take the same arguments.\n\nDevelopment\nTo run tests and the linter run pip install tox once, then tox.\n\n\n", "description": "HTML to Markdown converter."}, {"name": "markdown2", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nInstall\nQuick Usage\nExtra Syntax (aka extensions)\nProject\nContributing\nTest Suite\n\n\n\n\n\nREADME.md\n\n\n\n\nMarkdown is a light text markup format and a processor to convert that to HTML.\nThe originator describes it as follows:\n\nMarkdown is a text-to-HTML conversion tool for web writers.\nMarkdown allows you to write using an easy-to-read,\neasy-to-write plain text format, then convert it to\nstructurally valid XHTML (or HTML).\n-- http://daringfireball.net/projects/markdown/\n\nThis (markdown2) is a fast and complete Python implementation of Markdown. It\nwas written to closely match the behaviour of the original Perl-implemented\nMarkdown.pl. Markdown2 also comes with a number of extensions (called\n\"extras\") for things like syntax coloring, tables, header-ids. See the\n\"Extra Syntax\" section below. \"markdown2\" supports all Python versions\n3.5+ (and pypy and jython, though I don't frequently test those).\nThere is another Python\nmarkdown.py. However, at\nleast at the time this project was started, markdown2.py was faster (see the\nPerformance\nNotes) and,\nto my knowledge, more correct (see Testing\nNotes).\nThat was a while ago though, so you shouldn't discount Python-markdown from\nyour consideration.\nFollow @trentmick\nfor updates to python-markdown2.\nInstall\nTo install it in your Python installation run one of the following:\npip install markdown2\npip install markdown2[all]  # to install all optional dependencies (eg: Pygments for code syntax highlighting)\npypm install markdown2      # if you use ActivePython (activestate.com/activepython)\neasy_install markdown2      # if this is the best you have\npython setup.py install\n\nHowever, everything you need to run this is in \"lib/markdown2.py\". If it is\neasier for you, you can just copy that file to somewhere on your PythonPath\n(to use as a module) or executable path (to use as a script).\nQuick Usage\nAs a module:\n>>> import markdown2\n>>> markdown2.markdown(\"*boo!*\")  # or use `html = markdown_path(PATH)`\n'

boo!

\\n'\n\n>>> from markdown2 import Markdown\n>>> markdowner = Markdown()\n>>> markdowner.convert(\"*boo!*\")\n'

boo!

\\n'\n>>> markdowner.convert(\"**boom!**\")\n'

boom!

\\n'\nAs a script (CLI):\n$ python markdown2.py foo.md > foo.html\nor\n$ python -m markdown2 foo.md > foo.html\nI think pip-based installation will enable this as well:\n$ markdown2 foo.md > foo.html\nSee the project wiki,\nlib/markdown2.py\ndocstrings and/or python markdown2.py --help for more details.\nExtra Syntax (aka extensions)\nMany Markdown processors include support for additional optional syntax\n(often called \"extensions\") and markdown2 is no exception. With markdown2 these\nare called \"extras\". Using the \"footnotes\" extra as an example, here is how\nyou use an extra ... as a module:\n$ python markdown2.py --extras footnotes foo.md > foo.html\nas a script:\n>>> import markdown2\n>>> markdown2.markdown(\"*boo!*\", extras=[\"footnotes\"])\n'

boo!

\\n'\nThere are a number of currently implemented extras for tables, footnotes,\nsyntax coloring of
-blocks, auto-linking patterns, table of contents,\nSmarty Pants (for fancy quotes, dashes, etc.) and more. See the Extras\nwiki page for full\ndetails.\nProject\nThe python-markdown2 project lives at\nhttps://github.com/trentm/python-markdown2/.  (Note: On Mar 6, 2011 this\nproject was moved from Google Code\nto here on Github.) See also, markdown2 on the Python Package Index\n(PyPI).\nThe change log: https://github.com/trentm/python-markdown2/blob/master/CHANGES.md\nTo report a bug: https://github.com/trentm/python-markdown2/issues\nContributing\nWe welcome pull requests from the community. Please take a look at the TODO for opportunities to help this project. For those wishing to submit a pull request to python-markdown2 please ensure it fulfills the following requirements:\n\nIt must pass PEP8.\nIt must include relevant test coverage.\nBug fixes must include a regression test that exercises the bug.\nThe entire test suite must pass.\nThe README and/or docs are updated accordingly.\n\nTest Suite\nThis markdown implementation passes a fairly extensive test suite. To run it:\nmake test\nThe crux of the test suite is a number of \"cases\" directories -- each with a\nset of matching .text (input) and .html (expected output) files. These are:\ntm-cases/                   Tests authored for python-markdown2 (tm==\"Trent Mick\")\nmarkdowntest-cases/         Tests from the 3rd-party MarkdownTest package\nphp-markdown-cases/         Tests from the 3rd-party MDTest package\nphp-markdown-extra-cases/   Tests also from MDTest package\n\nSee the Testing Notes wiki\npage for full\ndetails.\n\n\n", "description": "Fast and complete Markdown parser for Python."}, {"name": "lxml", "readme": "\n\n\n\n\n\n\n\n\n\n\n\nWhat is lxml?\nSupport the project\nProject income report\nLegal Notice for Donations\n\n\n\n\n\nREADME.rst\n\n\n\n\nWhat is lxml?\nlxml is the most feature-rich and easy-to-use library for processing XML and HTML in the Python language.\nIt's also very fast and memory friendly, just so you know.\nFor an introduction and further documentation, see doc/main.txt.\nFor installation information, see INSTALL.txt.\nFor issue tracker, see https://bugs.launchpad.net/lxml\n\nSupport the project\nlxml has been downloaded from the Python Package Index\nmillions of times and is also available directly in many package\ndistributions, e.g. for Linux or macOS.\nMost people who use lxml do so because they like using it.\nYou can show us that you like it by blogging about your experience\nwith it and linking to the project website.\nIf you are using lxml for your work and feel like giving a bit of\nyour own benefit back to support the project, consider sending us\nmoney through GitHub Sponsors, Tidelift or PayPal that we can use\nto buy us free time for the maintenance of this great library, to\nfix bugs in the software, review and integrate code contributions,\nto improve its features and documentation, or to just take a deep\nbreath and have a cup of tea every once in a while.\nPlease read the Legal Notice below, at the bottom of this page.\nThank you for your support.\nSupport lxml through GitHub Sponsors\nvia a Tidelift subscription\nor via PayPal:\n\nPlease contact Stefan Behnel\nfor other ways to support the lxml project,\nas well as commercial consulting, customisations and trainings on lxml and\nfast Python XML processing.\nNote that we are not accepting donations in crypto currencies.\nMuch of the development and hosting for lxml is done in a carbon-neutral way\nor with compensated and very low emissions.\nCrypto currencies do not fit into that ambition.\nAppVeyor and GitHub Actions\nsupport the lxml project with their build and CI servers.\nJetbrains supports the lxml project by donating free licenses of their\nPyCharm IDE.\nAnother supporter of the lxml project is\nCOLOGNE Webdesign.\n\nProject income report\nlxml has about 60 million downloads\nper month on PyPI.\n\nTotal project income in 2022: EUR 2566.38  (213.87 \u20ac / month)\nTidelift: EUR 2539.38\nPaypal: EUR 27.00\n\n\nTotal project income in 2021: EUR 4640.37  (386.70 \u20ac / month)\nTidelift: EUR 4066.66\nPaypal: EUR 223.71\nother: EUR 350.00\n\n\nTotal project income in 2020: EUR 6065,86  (506.49 \u20ac / month)\nTidelift: EUR 4064.77\nPaypal: EUR 1401.09\nother: EUR 600.00\n\n\nTotal project income in 2019: EUR 717.52  (59.79 \u20ac / month)\nTidelift: EUR 360.30\nPaypal: EUR 157.22\nother: EUR 200.00\n\n\n\n\nLegal Notice for Donations\nAny donation that you make to the lxml project is voluntary and\nis not a fee for any services, goods, or advantages.  By making\na donation to the lxml project, you acknowledge that we have the\nright to use the money you donate in any lawful way and for any\nlawful purpose we see fit and we are not obligated to disclose\nthe way and purpose to any party unless required by applicable\nlaw.  Although lxml is free software, to the best of our knowledge\nthe lxml project does not have any tax exempt status.  The lxml\nproject is neither a registered non-profit corporation nor a\nregistered charity in any country.  Your donation may or may not\nbe tax-deductible; please consult your tax advisor in this matter.\nWe will not publish or disclose your name and/or e-mail address\nwithout your consent, unless required by applicable law.  Your\ndonation is non-refundable.\n\n\n", "description": "Pythonic XML processing library using libxml2 and libxslt."}, {"name": "loguru", "readme": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nInstallation\nFeatures\nTake the tour\nReady to use out of the box without boilerplate\nNo Handler, no Formatter, no Filter: one function to rule them all\nEasier file logging with rotation / retention / compression\nModern string formatting using braces style\nExceptions catching within threads or main\nPretty logging with colors\nAsynchronous, Thread-safe, Multiprocess-safe\nFully descriptive exceptions\nStructured logging as needed\nLazy evaluation of expensive functions\nCustomizable levels\nBetter datetime handling\nSuitable for scripts and libraries\nEntirely compatible with standard logging\nPersonalizable defaults through environment variables\nConvenient parser\nExhaustive notifier\n10x faster than built-in logging\nDocumentation\n\n\n\n\n\nREADME.rst\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nLoguru is a library which aims to bring enjoyable logging in Python.\nDid you ever feel lazy about configuring a logger and used print() instead?... I did, yet logging is fundamental to every application and eases the process of debugging. Using Loguru you have no excuse not to use logging from the start, this is as simple as from loguru import logger.\nAlso, this library is intended to make Python logging less painful by adding a bunch of useful functionalities that solve caveats of the standard loggers. Using logs in your application should be an automatism, Loguru tries to make it both pleasant and powerful.\n\nInstallation\npip install loguru\n\nFeatures\n\nReady to use out of the box without boilerplate\nNo Handler, no Formatter, no Filter: one function to rule them all\nEasier file logging with rotation / retention / compression\nModern string formatting using braces style\nExceptions catching within threads or main\nPretty logging with colors\nAsynchronous, Thread-safe, Multiprocess-safe\nFully descriptive exceptions\nStructured logging as needed\nLazy evaluation of expensive functions\nCustomizable levels\nBetter datetime handling\nSuitable for scripts and libraries\nEntirely compatible with standard logging\nPersonalizable defaults through environment variables\nConvenient parser\nExhaustive notifier\n 10x faster than built-in logging \n\n\nTake the tour\n\nReady to use out of the box without boilerplate\nThe main concept of Loguru is that there is one and only one logger.\nFor convenience, it is pre-configured and outputs to stderr to begin with (but that's entirely configurable).\nfrom loguru import logger\n\nlogger.debug(\"That's it, beautiful and simple logging!\")\nThe logger is just an interface which dispatches log messages to configured handlers. Simple, right?\n\nNo Handler, no Formatter, no Filter: one function to rule them all\nHow to add a handler? How to set up logs formatting? How to filter messages? How to set level?\nOne answer: the add() function.\nlogger.add(sys.stderr, format=\"{time} {level} {message}\", filter=\"my_module\", level=\"INFO\")\nThis function should be used to register sinks which are responsible for managing log messages contextualized with a record dict. A sink can take many forms: a simple function, a string path, a file-like object, a coroutine function or a built-in Handler.\nNote that you may also remove() a previously added handler by using the identifier returned while adding it. This is particularly useful if you want to supersede the default stderr handler: just call logger.remove() to make a fresh start.\n\nEasier file logging with rotation / retention / compression\nIf you want to send logged messages to a file, you just have to use a string path as the sink. It can be automatically timed too for convenience:\nlogger.add(\"file_{time}.log\")\nIt is also easily configurable if you need rotating logger, if you want to remove older logs, or if you wish to compress your files at closure.\nlogger.add(\"file_1.log\", rotation=\"500 MB\")    # Automatically rotate too big file\nlogger.add(\"file_2.log\", rotation=\"12:00\")     # New file is created each day at noon\nlogger.add(\"file_3.log\", rotation=\"1 week\")    # Once the file is too old, it's rotated\n\nlogger.add(\"file_X.log\", retention=\"10 days\")  # Cleanup after some time\n\nlogger.add(\"file_Y.log\", compression=\"zip\")    # Save some loved space\n\nModern string formatting using braces style\nLoguru favors the much more elegant and powerful {} formatting over %, logging functions are actually equivalent to str.format().\nlogger.info(\"If you're using Python {}, prefer {feature} of course!\", 3.6, feature=\"f-strings\")\n\nExceptions catching within threads or main\nHave you ever seen your program crashing unexpectedly without seeing anything in the log file? Did you ever notice that exceptions occurring in threads were not logged? This can be solved using the catch() decorator / context manager which ensures that any error is correctly propagated to the logger.\n@logger.catch\ndef my_function(x, y, z):\n    # An error? It's caught anyway!\n    return 1 / (x + y + z)\n\nPretty logging with colors\nLoguru automatically adds colors to your logs if your terminal is compatible. You can define your favorite style by using markup tags in the sink format.\nlogger.add(sys.stdout, colorize=True, format=\"{time} {message}\")\n\nAsynchronous, Thread-safe, Multiprocess-safe\nAll sinks added to the logger are thread-safe by default. They are not multiprocess-safe, but you can enqueue the messages to ensure logs integrity. This same argument can also be used if you want async logging.\nlogger.add(\"somefile.log\", enqueue=True)\nCoroutine functions used as sinks are also supported and should be awaited with complete().\n\nFully descriptive exceptions\nLogging exceptions that occur in your code is important to track bugs, but it's quite useless if you don't know why it failed. Loguru helps you identify problems by allowing the entire stack trace to be displayed, including values of variables (thanks better_exceptions for this!).\nThe code:\n# Caution, \"diagnose=True\" is the default and may leak sensitive data in prod\nlogger.add(\"out.log\", backtrace=True, diagnose=True)\n\ndef func(a, b):\n    return a / b\n\ndef nested(c):\n    try:\n        func(5, c)\n    except ZeroDivisionError:\n        logger.exception(\"What?!\")\n\nnested(0)\nWould result in:\n2018-07-17 01:38:43.975 | ERROR    | __main__:nested:10 - What?!\nTraceback (most recent call last):\n\n  File \"test.py\", line 12, in \n    nested(0)\n    \u2514 \n\n> File \"test.py\", line 8, in nested\n    func(5, c)\n    \u2502       \u2514 0\n    \u2514 \n\n  File \"test.py\", line 4, in func\n    return a / b\n           \u2502   \u2514 0\n           \u2514 5\n\nZeroDivisionError: division by zero\n\nNote that this feature won't work on default Python REPL due to unavailable frame data.\nSee also: Security considerations when using Loguru.\n\nStructured logging as needed\nWant your logs to be serialized for easier parsing or to pass them around? Using the serialize argument, each log message will be converted to a JSON string before being sent to the configured sink.\nlogger.add(custom_sink_function, serialize=True)\nUsing bind() you can contextualize your logger messages by modifying the extra record attribute.\nlogger.add(\"file.log\", format=\"{extra[ip]} {extra[user]} {message}\")\ncontext_logger = logger.bind(ip=\"192.168.0.1\", user=\"someone\")\ncontext_logger.info(\"Contextualize your logger easily\")\ncontext_logger.bind(user=\"someone_else\").info(\"Inline binding of extra attribute\")\ncontext_logger.info(\"Use kwargs to add context during formatting: {user}\", user=\"anybody\")\nIt is possible to modify a context-local state temporarily with contextualize():\nwith logger.contextualize(task=task_id):\n    do_something()\n    logger.info(\"End of task\")\nYou can also have more fine-grained control over your logs by combining bind() and filter:\nlogger.add(\"special.log\", filter=lambda record: \"special\" in record[\"extra\"])\nlogger.debug(\"This message is not logged to the file\")\nlogger.bind(special=True).info(\"This message, though, is logged to the file!\")\nFinally, the patch() method allows dynamic values to be attached to the record dict of each new message:\nlogger.add(sys.stderr, format=\"{extra[utc]} {message}\")\nlogger = logger.patch(lambda record: record[\"extra\"].update(utc=datetime.utcnow()))\n\nLazy evaluation of expensive functions\nSometime you would like to log verbose information without performance penalty in production, you can use the opt() method to achieve this.\nlogger.opt(lazy=True).debug(\"If sink level <= DEBUG: {x}\", x=lambda: expensive_function(2**64))\n\n# By the way, \"opt()\" serves many usages\nlogger.opt(exception=True).info(\"Error stacktrace added to the log message (tuple accepted too)\")\nlogger.opt(colors=True).info(\"Per message colors\")\nlogger.opt(record=True).info(\"Display values from the record (eg. {record[thread]})\")\nlogger.opt(raw=True).info(\"Bypass sink formatting\\n\")\nlogger.opt(depth=1).info(\"Use parent stack context (useful within wrapped functions)\")\nlogger.opt(capture=False).info(\"Keyword arguments not added to {dest} dict\", dest=\"extra\")\n\nCustomizable levels\nLoguru comes with all standard logging levels to which trace() and success() are added. Do you need more? Then, just create it by using the level() function.\nnew_level = logger.level(\"SNAKY\", no=38, color=\"\", icon=\"\ud83d\udc0d\")\n\nlogger.log(\"SNAKY\", \"Here we go!\")\n\nBetter datetime handling\nThe standard logging is bloated with arguments like datefmt or msecs, %(asctime)s and %(created)s, naive datetimes without timezone information, not intuitive formatting, etc. Loguru fixes it:\nlogger.add(\"file.log\", format=\"{time:YYYY-MM-DD at HH:mm:ss} | {level} | {message}\")\n\nSuitable for scripts and libraries\nUsing the logger in your scripts is easy, and you can configure() it at start. To use Loguru from inside a library, remember to never call add() but use disable() instead so logging functions become no-op. If a developer wishes to see your library's logs, they can enable() it again.\n# For scripts\nconfig = {\n    \"handlers\": [\n        {\"sink\": sys.stdout, \"format\": \"{time} - {message}\"},\n        {\"sink\": \"file.log\", \"serialize\": True},\n    ],\n    \"extra\": {\"user\": \"someone\"}\n}\nlogger.configure(**config)\n\n# For libraries, should be your library's `__name__`\nlogger.disable(\"my_library\")\nlogger.info(\"No matter added sinks, this message is not displayed\")\n\n# In your application, enable the logger in the library\nlogger.enable(\"my_library\")\nlogger.info(\"This message however is propagated to the sinks\")\nFor additional convenience, you can also use the loguru-config library to setup the logger directly from a configuration file.\n\nEntirely compatible with standard logging\nWish to use built-in logging Handler as a Loguru sink?\nhandler = logging.handlers.SysLogHandler(address=('localhost', 514))\nlogger.add(handler)\nNeed to propagate Loguru messages to standard logging?\nclass PropagateHandler(logging.Handler):\n    def emit(self, record: logging.LogRecord) -> None:\n        logging.getLogger(record.name).handle(record)\n\nlogger.add(PropagateHandler(), format=\"{message}\")\nWant to intercept standard logging messages toward your Loguru sinks?\nclass InterceptHandler(logging.Handler):\n    def emit(self, record: logging.LogRecord) -> None:\n        # Get corresponding Loguru level if it exists.\n        level: str | int\n        try:\n            level = logger.level(record.levelname).name\n        except ValueError:\n            level = record.levelno\n\n        # Find caller from where originated the logged message.\n        frame, depth = inspect.currentframe(), 0\n        while frame and (depth == 0 or frame.f_code.co_filename == logging.__file__):\n            frame = frame.f_back\n            depth += 1\n\n        logger.opt(depth=depth, exception=record.exc_info).log(level, record.getMessage())\n\nlogging.basicConfig(handlers=[InterceptHandler()], level=0, force=True)\n\nPersonalizable defaults through environment variables\nDon't like the default logger formatting? Would prefer another DEBUG color? No problem:\n# Linux / OSX\nexport LOGURU_FORMAT=\"{time} | {message}\"\n\n# Windows\nsetx LOGURU_DEBUG_COLOR \"\"\n\nConvenient parser\nIt is often useful to extract specific information from generated logs, this is why Loguru provides a parse() method which helps to deal with logs and regexes.\npattern = r\"(?P