Saravanan666/pypi-org huggingface dataset:
Package: quart-auth
Quart-Auth is an extension forQuartto provide for secure cookie
authentication (session management). It allows for a session to be
logged in, authenticated and logged out.UsageTo use Quart-Auth with a Quart app you have to create an QuartAuth and
initialise it with the application,app=Quart(__name__)QuartAuth(app)or via the factory pattern,auth_manager=QuartAuth()defcreate_app():app=Quart(__name__)auth_manager.init_app(app)returnappIn addition you will need to configure Quart-Auth, which defaults to
the most secure. At a minimum you will need to set secret key,app.secret_key="secret key"# Do not use this keywhich you can generate via,>>>importsecrets>>>secrets.token_urlsafe(16)Tou may also need to disable secure cookies to use in development, see
configuration below.With QuartAuth initialised you can use thelogin_requiredfunction to decorate routes that should only be accessed by
authenticated users,fromquart_authimportlogin_required@app.route("/")@login_requiredasyncdefrestricted_route():...If no user is logged in, anUnauthorizedexception is raised. To catch it,
install an error handler,@app.errorhandler(Unauthorized)asyncdefredirect_to_login(*_:Exception)->ResponseReturnValue:returnredirect(url_for("login"))You can also use thelogin_user, andlogout_userfunctions to
start and end sessions for a specificAuthenticatedUserinstance,fromquart_authimportAuthUser,login_user,logout_user@app.route("/login")asyncdeflogin():# Check Credentials here, e.g. username & password....# We'll assume the user has an identifying ID equal to 2login_user(AuthUser(2))...@app.route("/logout")asyncdeflogout():logout_user()...The user (authenticated or not) is available via the globalcurrent_userincluding within templates,fromquartimportrender_template_stringfromquart_authimportcurrent_user@app.route("/")asyncdefuser():returnawaitrender_template_string("{{ current_user.is_authenticated }}")ContributingQuart-Auth is developed onGitHub. You are very welcome to
openissuesor
proposepull requests.TestingThe best way to test Quart-Auth is with Tox,$pipinstalltox$toxthis will check the code style and run the tests.HelpThe Quart-Authdocumentationis the best places to
start, after that try searchingstack overflowor ask for helpon gitter. If you still
can’t find an answer pleaseopen an issue.
Package: quart_babel
Quart BabelImplements i18n and l10n support for Quart.  This is based on the Pythonbabelmodule as well aspytzboth of which are installed automatically
for you if you install this library.The original code for this extension was taken from Flask-Babel and Flask-BabelPlus.
Flask-Babel can be foundhereand Flask-BabelPlus can be foundhereInstallationInstall the extension with the following command:$ pip3 install quart-babelUsageTo use the extension simply import the class wrapper and pass the Quart app
object back to here. Do so like this:from quart import Quart
from quart_babel import Babel 

app = Quart(__name__)
babel = Babel(app)DocumentationThe for Quart-Babel and is availablehere.
Package: quart-bcrypt
Quart-BcryptQuart-Bcrypt is a Quart extension that provides bcrypt hashing utilities for
your application. Orginal code from Flash-Bcrypt, which can be found athttps://github.com/maxcountryman/flask-bcryptDue to the recent increased prevelance of powerful hardware, such as modern
GPUs, hashes have become increasingly easy to crack. A proactive solution to
this is to use a hash that was designed to be "de-optimized". Bcrypt is such
a hashing facility; unlike hashing algorithms such as MD5 and SHA1, which are
optimized for speed, bcrypt is intentionally structured to be slow.For sensitive data that must be protected, such as passwords, bcrypt is an
advisable choice.InstallationInstall the extension with the following command:$ pip3 install quart-bcryptUsageTo use the extension simply import the class wrapper and pass the Quart app
object back to here. Do so like this:from quart import Quart
from quart_bcrypt import Bcrypt

app = Quart(__name__)
bcrypt = Bcrypt(app)Two primary hashing methods are now exposed by way of the bcrypt object. Note that you
need to use decode('utf-8') on generate_password_hash().pw_hash = bcrypt.generate_password_hash('hunter2').decode('utf-8')
bcrypt.check_password_hash(pw_hash, 'hunter2') # returns TrueDocumentationView documentation athttps://quart-bcrypt.readthedocs.io/en/latest/
Package: quart-compress
Quart-CompressQuart-Compress allows you to easily compress yourQuartapplication's responses with gzip.The preferred solution is to have a server (likeNginx) automatically compress the static files for you. If you don't have that option Quart-Compress will solve the problem for you.How it worksQuart-Compress both adds the various headers required for a compressed response and gzips the response data. This makes serving gzip compressed static files extremely easy.Internally, every time a request is made the extension will check if it matches one of the compressible MIME types and will automatically attach the appropriate headers.InstallationIf you use pip then installation is simply:$pipinstallquart-compressor, if you want the latest github version:$pipinstallgit+git://github.com/AceFire6/quart-compress.gitUsing Quart-CompressQuart-Compress is incredibly simple to use. In order to start gzip'ing your Quart application's assets, the first thing to do is let Quart-Compress know about yourquart.Quartapplication object.fromquartimportQuartfromquart_compressimportCompressapp=Quart(__name__)Compress(app)In many cases, however, one cannot expect a Quart instance to be ready at import time, and a common pattern is to return a Quart instance from within a function only after other configuration details have been taken care of. In these cases, Quart-Compress provides a simple function,quart_compress.Compress.init_app, which takes your application as an argument.fromquartimportQuartfromquart_compressimportCompresscompress=Compress()defstart_app():app=Quart(__name__)compress.init_app(app)returnappIn terms of automatically compressing your assets using gzip, passing yourquart.Quartobject to thequart_compress.Compressobject is all that needs to be done.OptionsWithin your Quart application's settings you can provide the following settings to control the behavior of Quart-Compress. None of the settings are required.OptionDescriptionDefaultCOMPRESS_MIMETYPESSet the list of mimetypes to compress here.['text/html','text/css','text/xml','application/json','application/javascript']COMPRESS_LEVELSpecifies the gzip compression level.6COMPRESS_MIN_SIZESpecifies the minimum file size threshold for compressing files.500COMPRESS_CACHE_KEYSpecifies the cache key method for lookup/storage of response data.NoneCOMPRESS_CACHE_BACKENDSpecified the backend for storing the cached response data.NoneCOMPRESS_REGISTERSpecifies if compression should be automatically registered.True
Package: quart-compress2
Quart-CompressDescriptionQuart is a Python ASGI web microframework.
It is intended to provide the easiest way to use asyncio functionality in a web context, especially with existing Flask apps.
This is possible as the Quart API is a superset of the Flask API.--Quart ProjectAs I wanted to seamlessly migrate from Flask to Quart and noticed, that there are a few issues in usingFlask-Compresstogether with Quart, I decided to create my own Quart-Compress packages, which is based on the Flask-Compress project.InstallationInstalling the package is as easy as:$pipinstallquart-compress2UsageTo compress your Quart responses, you only need to compress your Quart object at the beginning using theCompressclass:fromquartimportQuartfromquart_compressimportCompressapp=Quart(__name__)Compress(app)
Package: quartcord
quartcordTable of ContentsAboutInstallationRequirementsSetupBasic ExampleDocumentationSupportCreditsLicenseAboutDiscord OAuth2 extension for Quart.InstallationRequirementsQuartpyjwtaiohttpoauthlibdiscord.pycachetoolsAsync-OAuthlibSetupTo install current latest release you can use following command:python-mpipinstallquartcordBasic ExamplefromquartimportQuart,redirect,url_forfromquartcordimportDiscordOAuth2Session,requires_authorization,Unauthorizedapp=Quart(__name__)app.secret_key=b"random bytes representing quart secret key"app.config["DISCORD_CLIENT_ID"]=490732332240863233# Discord client ID.app.config["DISCORD_CLIENT_SECRET"]=""# Discord client secret.app.config["DISCORD_REDIRECT_URI"]=""# URL to your callback endpoint.app.config["DISCORD_BOT_TOKEN"]=""# Required to access BOT resources.discord=DiscordOAuth2Session(app)@app.route("/login/")asyncdeflogin():returnawaitdiscord.create_session()@app.route("/callback/")asyncdefcallback():awaitdiscord.callback()returnredirect(url_for(".me"))@app.errorhandler(Unauthorized)asyncdefredirect_unauthorized(e):returnredirect(url_for("login"))@app.route("/me/")@requires_authorizationasyncdefme():user=awaitdiscord.fetch_user()returnf"""<html><head><title>{user.name}</title></head><body><img src='{user.avatar_url}' /></body></html>"""if__name__=="__main__":app.run()DocumentationHead over todocumentationfor full API reference.SupportProject IssuesFumeStop Community Server(Help > quartcord)CreditsFlask-DiscordQuart-Discord(Do not use; no longer maintained)LicenseMIT LicenseCopyright © 2023 Sayan "Sn1F3rt" Bhattacharyya
Package: quart-csrf
Quart-CsrfQuart-Csrf is an extension forQuartto provide CSRF protection.
The code is taked fromFlask-WTF.UsageTo enable CSRF protection globally for a Quart app, you have to create an CSRFProtect and
initialise it with the application,fromquart_csrfimportCSRFProtectapp=Quart(__name__)CSRFProtect(app)or via the factory pattern,csrf=CSRFProtect()defcreate_app():app=Quart(__name__)csrf.init_app(app)returnappNote: CSRF protection requires a secret key to securely sign the token. By default this will
use the QUART app's SECRET_KEY. If you'd like to use a separate token you can set QUART_CSRF_SECRET_KEY.HTML Forms: render a hidden input with the token in the form.<formmethod="post"><inputtype="hidden"name="csrf_token"value="{{ csrf_token() }}"/></form>JavaScript Requests: When sending an AJAX request, add the X-CSRFToken header to it. For example, in jQuery you can configure all requests to send the token.<metaname="csrf-token"content="{{ csrf_token() }}"><script>varcsrf_token=$('meta[name=csrf-token]').attr('content');// var csrf_token = "{{ csrf_token() }}";$.ajaxSetup({beforeSend:function(xhr,settings){if(!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type)&&!this.crossDomain){xhr.setRequestHeader("X-CSRFToken",csrf_token);}}});</script>ContributingQuart-Csrf is developed onGitLab. You are very welcome to
openissuesor
proposemerge requests.HelpThis README is the best place to start, after that try opening anissue.
Package: quart-db
Quart-DB is a Quart extension that provides managed connection(s) to
postgresql or sqlite database(s).QuickstartQuart-DB is used by associating it with an app and a DB (via a URL)
and then utilising theg.connectionconnection,fromquartimportg,Quart,websocketfromquart_dbimportQuartDBapp=Quart(__name__)db=QuartDB(app,url="postgresql://user:pass@localhost:5432/db_name")@app.get("/<int:id>")asyncdefget_count(id:int):result=awaitg.connection.fetch_val("SELECT COUNT(*) FROM tbl WHERE id = :id",{"id":id},)return{"count":result}@app.post("/")asyncdefset_with_transaction():asyncwithg.connection.transaction():awaitdb.execute("UPDATE tbl SET done = :done",{"done":True})...return{}@app.get("/explicit")asyncdefexplicit_usage():asyncwithdb.connection()asconnection:...ContributingQuart-DB is developed onGitHub. If you come across an issue,
or have a feature request please open anissue. If you want to
contribute a fix or the feature-implementation please do (typo fixes
welcome), by proposing amerge request.TestingThe best way to test Quart-DB is withTox,$pipinstalltox$toxthis will check the code style and run the tests.HelpThe Quart-DBdocumentationis the best places to
start, after that try searchingstack overflowor ask for helpon gitter. If you still
can’t find an answer pleaseopen an issue.
Package: quart-doh
quart-dohquart-doh is a simple DOH (DNS Over HTTPS) server. It resolves DNS query on HTTP.ImplementationRFC 8484https://www.rfc-editor.org/rfc/rfc8484.txtJson implementationhttps://developers.cloudflare.com/1.1.1.1/dns-over-https/json-format/Quick startopenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodespipenv sync -dpipenv run doh_serverUse with Firefoxin about:config edit::network.trr.mode;3
network.trr.uri;https://127.0.0.1/dns-queryFor the URI, add your URI for your reverse proxy serving your Quart app.Firefox seems to only accept port 443.InstallationVia Pippip install quart-dohThen :Generate a certificate and a private key :openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodesdoh-server --debug --cert [path]cert.pem --key [path]key.pemdoh-client --noverifyVia Dockeropenssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodesdocker build -f Dockerfile -t quart-doh/doh-server .docker run --rm -p 443:443 quart-doh/doh-serverBenchmarkMacbook Pro 2019
Processor 2,4 GHz Intel Core i5
Memory 8 GB 2133 MHz LPDDR3apib -c 100 -d 60 @benchmark_get_url.txtHTTP/1.1
Duration:             60.024 seconds
Attempted requests:   15757
Successful requests:  15757
Non-200 results:      0
Connections opened:   100
Socket errors:        0

Throughput:           262.511 requests/second
Average latency:      376.399 milliseconds
Minimum latency:      103.082 milliseconds
Maximum latency:      2846.580 milliseconds
Latency std. dev:     456.340 milliseconds
50% latency:          202.483 milliseconds
90% latency:          862.423 milliseconds
98% latency:          2044.469 milliseconds
99% latency:          2409.697 milliseconds

Client CPU average:    0%
Client CPU max:        0%
Client memory usage:    0%

Total bytes sent:      2.25 megabytes
Total bytes received:  5.08 megabytes
Send bandwidth:        0.30 megabits / second
Receive bandwidth:     0.68 megabits / second
Package: quartet_capture
.d8888b.      d8888  8888888b. 88888888888 888     888 8888888b.  8888888888
d88P  Y88b    d8P888  888   Y88b    888     888     888 888   Y88b 888
888    888   d8P 888  888    888    888     888     888 888    888 888
888         d8P  888  888   d88P    888     888     888 888   d88P 8888888
888        d88   888  8888888P"     888     888     888 8888888P"  888
888    888 8888888888 888           888     888     888 888 T88b   888
Y88b  d88P       888  888           888     Y88b. .d88P 888  T88b  888
 "Y8888P"        888  888           888      "Y88888P"  888   T88b 8888888888A capture and queuing interface for the QU4RTET open source EPCIS platform.
This package defines the
generic structure of the QU4RTET rule engine and defines the base classes
necessary for use when extending the functionality of QU4RTET.DocumentationThe full documentation here includes an overall explanation and example of
implementing rules and steps along with installation instructions:https://serial-lab.gitlab.io/quartet_captureQuickstartInstall quartet_capturepip install quartet_captureAdd it to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'quartet_capture.apps.QuartetCaptureConfig',
    ...
)Add quartet_capture’s URL patterns:from quartet_capture import urls as quartet_capture_urls

urlpatterns = [
    ...
    url(r'^', include(quartet_capture_urls)),
    ...
]FeaturesAccepts inbound HTTP Post messages and queues them up for processing.Stores inbound messages in RabbitMQ backend for processing with the Celery Task Queue.Keeps track of messages and their processing state.Running The Unit Testssource <YOURVIRTUALENV>/bin/activate
(myenv) $ python runtests.py
Package: quartet_epcis
Built on top of the world-class EPCPyYes python package.
Real EPCIS support for serious people running real systems.________  ___   ___  _______   ________  ________  ___  ________
|\   __  \|\  \ |\  \|\  ___ \ |\   __  \|\   ____\|\  \|\   ____\
\ \  \|\  \ \  \\_\  \ \   __/|\ \  \|\  \ \  \___|\ \  \ \  \___|_
 \ \  \\\  \ \______  \ \  \_|/_\ \   ____\ \  \    \ \  \ \_____  \
  \ \  \\\  \|_____|\  \ \  \_|\ \ \  \___|\ \  \____\ \  \|____|\  \
   \ \_____  \     \ \__\ \_______\ \__\    \ \_______\ \__\____\_\  \
    \|___| \__\     \|__|\|_______|\|__|     \|_______|\|__|\_________\
          \|__|                                            \|_________|The essential Open-Source EPCIS component for the QU4RTET traceability
platform.For more on QU4RTET seehttp://www.serial-lab.comThe quartet_epcis python package is a Django application that
contains the base database models necessary for the support of
EPCIS 1.2 data persistence to an RDBMS. The quartet_epcis.parsing
package contains an EPCIS XML parser that will take an input stream
of XML data and save it to a configured database back-end.The quartet_epcis.app_models directory contains a set of
Django ORM models that are used to define the database scheme
and store EPCIS data in the database.DocumentationFind the latest docs here:https://serial-lab.gitlab.io/quartet_epcis/The full (pre-built )documentation is under the docs directory in this project.QuickstartInstall QU4RTET EPCISpip install quartet_epcisAdd it to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'quartet_epcis',
    ...
)FeaturesMaintains the database schema for EPCIS 1.2 support.Parses EPCIS 1.2 XML streams to the configured backend database system.Enforces business rules around decommissioning, commissioning, aggregation,
disaggregation, etc.Running The Unit Testssource <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ python runtests.py
Package: quartet_integrations
Third party integrations for the QU4RTET open-source EPCIS platform.  For
more on QU4RTET and SerialLab, seethe SerialLab websitethe SerialLab website:http://serial-lab.comDocumentationThe full documentation is athttps://serial-lab.gitlab.io/quartet_integrations/QuickstartInstall quartet_integrations:pip install quartet_integrationsAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'quartet_integrations.apps.QuartetIntegrationsConfig',...)Add quartet_integrations’s URL patterns:fromquartet_integrationsimporturlsasquartet_integrations_urlsurlpatterns=[...url(r'^',include(quartet_integrations_urls)),...]FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackage
Package: quartet_manifest
Reports back QU4RTET configuration and capabilities to quartet-ui.DocumentationDependenciesFirst, make sure you haveDjangoand theDjango Rest Frameworkinstalled and
you have an active project started.  See the Django and Django Rest Framework
documentation below if you are unfamiliar with this process.Modfiy settings.pyTo use quartet_manifest in a project, first, add it to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'rest_framework',
    'quartet_manifest',
    ...
)Add the URL patternsIn your project’surls.py, add quartet_manifest’s URL patterns:from quartet_manifest import urls as quartet_manifest_urls


urlpatterns = [
    ...
    path('manifest/', include('quartet_manifest.urls')),
    ...
]Test the URLNavigate to the configured host/port and url using the structure below:http://[yourhost name]:[your port]/manifest/quartet-manifest/?format=jsonYou should get a return value as below
Package: quartet_masterdata
GS1 CBV 1.2 Implementation for Trade Items and Location Master DataModels and APIs to support material, lot and location master data within
QU4RTET as defined in theGS1 Core Business Vocabulary.Geo-Location/History APIsBy cross-referencing BizLocation and other information from thequartet_epcismodule,quartet_masterdataprovides full geo-location (lat, long) by
item by EPCIS event.  This provides thequartet-uiinterface a mechanism
by which to display mapping and geo-location visual assets.DocumentationThe full documentation is athttps://serial-lab.gitlab.io/quartet_masterdata/QuickstartThe QU4RTET Master Data module comes pre-configured in the QU4RTET project;
however, if you need to add it to a test installation manually peform the
following:Install quartet_masterdata:pip install quartet_masterdataAdd it to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'quartet_masterdata.apps.QuartetMasterdataConfig',
    ...
)Add quartet_masterdata’s URL patterns:from quartet_masterdata import urls as quartet_masterdata_urls


urlpatterns = [
    ...
    url(r'^', include(quartet_masterdata_urls)),
    ...
]FeaturesGeoLocation APIsAPI and Database Support For Product Master MaterialAPI and Database Support forRunning Tests** REQUIRES PYTHON 3 **Does the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ python runtests.py
Package: quartet_output
Output Rules and logic for the QU4RTET open-source EPCIS / Level-4
supply chain and trading-partner messaging framework.IntroThequartet_outputmodule is responsible for inspecting inbound messages
and, based on criteria defined by users, singling out some of those messages
for further processing.  Once a message has been filtered, it is typically
used to create a new message from some existing EPCIS data or to simply
create a new message using the same data with the intent of sending that
message to another system.CriteriaThequartet_outputmodule allows users to defineEPCIS Output Criteriadefinitions.  These definitions allow users to instruct the module to look
at inbound EPCIS events and look for events that meet certain selection
criteria.  For example, users can define criteria that would inspect all
inboundTransaction Eventsof actionADDfrom a specificbizLocationwith aPurchase Orderbusiness transaction attached.  Once an event
arrives meeting these criteria, the system allows a user to use that event
to trigger the generation of a shipping event along with all of the serial
numbers for the epcs specified in the triggering event.  Other scenarios are
possible as well and, of course, users can implementRulesandStepsof
their own that do just about anything once an inbound event has been filtered.Transportquartet_outputallows users to configure transport configurations using
bothEndPointandAuthenticationInfodatabase models.  These models are
attached to the criteria that filter EPCIS events and allow the user to
specify where messages should be sent once an event has been filtered and
has triggered any outbound processing logic.DocumentationThe full documentation is located here:https://serial-lab.gitlab.io/quartet_outputQuickstartInstall quartet_outputpip install quartet_outputAdd it to yourINSTALLED_APPS:INSTALLED_APPS = (
    ...
    'quartet_output.apps.QuartetOutputConfig',
    ...
)Add quartet_output’s URL patterns:from quartet_output import urls as quartet_output_urls


urlpatterns = [
    ...
    url(r'^', include(quartet_output_urls)),
    ...
]FeaturesOutput determination allows you to create filters on inbound EPCIS data
and determine which inbound EPCIS events trigger outbound business messaging.Define HTTP and HTTPS end points for trading partners.Define various authentication schemes for external end points.Outbound messages take advantage of thequartet_capturerule engine by
creating a new outbound task for every message.  This puts every outbound
task on the Celery Task Queue- allowing you to scale your outbound messaging
to your liking.Running The Unit Testssource <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox
Package: quartet_tracelink
An EPCIS to TraceLink Codec that overcomes (or tries to) many of the
quirks, garbage, non-standard BS and other well-known shortcomings of the Tracelink EPCIS interface.DocumentationThe full documentation is athttps://serial-lab.gitlab.io/quartet_tracelink/QuickstartInstall quartet_tracelink:pip install quartet_tracelinkAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'quartet_tracelink.apps.QuartetTracelinkConfig',...)Add quartet_tracelink’s URL patterns:fromquartet_tracelinkimporturlsasquartet_tracelink_urlsurlpatterns=[...url(r'^',include(quartet_tracelink_urls)),...]Running TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxHistory0.1.0 (2018-09-06)First release on PyPI.