Saravanan666/pypi-org huggingface dataset:
Package: pyramid-i18n-helper
Pyramid I18N HelperThis is a helper for internationalization and localization inPyramidviewsThis package add 3 view to your pyramid based application:i18n_helper.domain view in route /translatei18n_helper.pot view in route /translate/{domain}i18n_helper.po view in route /translate/{domain}/{lang}in/translateyou see available domains and also you can create new domain.in/translate/{domain}you can edit pot file for selected domain.in/translate/{domain}/{lang}you can translate msgid to selected lang in selected domain. also you can update po file from pot file.additional objectThis package addBabellocale object to request.
This package usePyramid_flash_messageto handle flash messages.collecting msgidsyou can also use auto collect msgids. for this seti18n_helper.collect_msgid = truein your project config file.
by enabling auto collect. new msgids for any domain add to its own pot file. even if pot file for specific is not available it will create automaticallytranslation directoryyou can specify translation directory in config file viai18n_helper.locale_dirInstallationpipinstallpyramid_i18n_helperadd then add this package to your applicationpyramid.includes=pyramid_layoutpyramid_jinja2pyramid_i18n_helperorconfig.include('pyramid_layout')config.include('pyramid_jinja2')config.include('pyramid_i18n_helper')now user withi18n_helperpermission can access this pages.SupportYou can useproject issue pageto submit your issueKhown IssuesAfter translating a msgid you have to restart your applicationAt now this package use pyramid_layout default layout. formpyramid_layout documentation pagemain_template is the template object that provides the main template (aka, o-wrap) for the view.
if your application don’t have main_layout some default main_template will be used but it is so simple and you may have problem.
at now templates will be load in block named content.main_layout template have to designed via jinja2.excuse me for my bad english knowledge.Changesv 0.3.5get locale_dir from config file viai18n_helper.locale_dirv 0.3.4remove dependency to master_layout. master_layout is optional.v 0.3.3encoding bug fix.v 0.3.2bug fix.v 0.3.1documentation.remove unnecessary dependency.v 0.3.0many change. so new version released.documentationv 0.2.14complete domain viewv 0.2.13handle duplication errorcreate new domain if not existv 0.2.11compatible with pyramid_flash_message 0.2v 0.2.9add flash message.v 0.2.8set permission to ‘i18n_helper’. so user want to access pages have to have this permission.v 0.2.7modify create lang and select langerror in creating new lang if lang not valid in babelv 0.2.6add ability to collect msgids in pot file viai18n_helper.collect_msgidsetting astruesome debugv 0.2.5add babel locale object to requestv 0.2.4some bug fixv 0.2.3some bug fixv 0.2add (newlang / go to lang) fieldsome bug fixv 0.1some modificationapply suggestion from #1. thank @mmerickelv 0.0init project and create skeleton of it
Package: pyramid_iniherit
Thepyramid-iniheritpackage enables pyramid configuration INI file
inheritance via the “iniherit” package. Seeiniheritfor
documentation on how to use INI file inheritance.Installation$pipinstallpyramid-iniheritUsageTo be able to use%inherit-enabled INI files, do the following:Usei-pserveinstead ofpserve(same goes for pshell,
proutes, pviews, ptweens, prequest, pscheduler, and alembic).Add this linebeforeyou import any pyramid, paster, or other
server application module (such as in your WSGI loader):# add support for inherited INI filesimportpyramid_iniherit.installThat’s it!
Package: pyramid_ipauth
An authentication policy for Pyramid that sets identity and effective
principals based on the remote IP address of the request.OverviewTo perform IP-address-based authentication, create an IPAuthenticationPolicy
and specify the target IP range, userid and effective principals.  Then set it
as the authentication policy in your configurator:authn_policy = IPAuthenticationPolicy("127.0.*.*", "myuser", ["locals"])
config.set_authentication_policy(authn_policy)This will cause all requests from IP addresses in the 127.0.*.* range to be
authenticated as user “myuser” and have the effective principal “locals”.It is also possible to specify the configuration options in your deployment
file:[app:pyramidapp]
use = egg:mypyramidapp

ipauth.ipaddrs = 127.0.0.* 127.0.1.*
ipauth.principals = localsYou can then simply include the pyramid_ipauth package into your configurator:config.include("pyramid_ipauth")It will detect the ipauth settings and construct an appropriate policy.Note that this package only supports matching against a single set of IP
addresss.  If you need to assign different credentials to different sets
of IP addresses, you can use the pyramid_multiauth package in conjunction
with pyramid_ipauth:http://github.com/mozilla-services/pyramid_multiauthIf you don’t want to hard-code the userid or principals at configuration time,
you may specify a “get_userid” and/or “get_principals” callback instead.Specifying IP AddressesIP addresses can be specified in a variety of forms, including:“all”:        all possible IPv4 and IPv6 addresses“local”:      all local addresses of the machine“A.B.C.D”     a single IP address“A.B.C.D/N”   a network address specification“A.B.C.*”     a glob matching against all possible numbers“A.B.C.D-E”   a glob matching against a range of numbersa whitespace- or comma-separated string of any of the abovea netaddr IPAddress, IPRange, IPGlob, IPNetork of IPSet objecta list, tuple or iterable of any of the aboveProxiesThis module does not respect the X-Forwarded-For header by default, since it
can be spoofed easily by malicious clients.  If your server is behind a
trusted proxy that sets the X-Forwarded-For header, you should explicitly
declare the set of trusted proxies like so:IPAuthenticationPolicy("127.0.*.*",
                       principals=["local"],
                       proxies = "127.0.0.1")The set of trusted proxy addresses can be specified using the same syntax as
the set of IP addresses to authenticate.0.3.3 - 2017-02-02Fix splitting ipset strings on whitespace; thanks @kaleposhobios0.3.2 - 2017-01-22Resolve some warnings and clean up some tests; thanks Scott Searcy0.3.1 - 2016-03-18Fixes for python3 compatibility0.3.0 - 2016-03-18Add support for python30.2.0 - 2013-10-14Add get_userid and get_principals callback functions; thanks mrijkenConvert principals into a list if necessary; thanks janakj0.1.1 - 2012-01-30Update license to MPL 2.00.1.0 - 2011-11-11Initial release
Package: pyramid_ipython
IPythonbindings forPyramid.Installation$ $VENV/bin/pip install pyramid_ipythonUsageEnsure the shell is available:$ $VENV/bin/pshell --list-shells
Available shells:
  ipython
  pythonThe shell should be auto-selected when runningpshell:$ $VENV/bin/pshell development.iniHowever, if there are multiple shells you can also be explicit:$ $VENV/bin/pshell -p ipython development.ini
Package: pyramid-is-live
pyramid-is-liveuses a tween to add anis_liveproperty to Pyramid
requests, which isTrueif the request came from a HTTP interaction andFalseotherwise, e.g. if the request came frompyramid.paster.bootstrap.Getting StartedInstall this package:pip install pyramid-is-liveInclude it in your application startup:defmain(global_config,**settings):config=Configurator(...)config.include("pyramid_is_live")...Userequest.is_livein your views and scripts!ContributingWe usetoxto run our tests and
linters.Runtoxto run all tests and linters.Runtox-eformatto reformat your code usingBlackandisort.
Package: pyramid-jinja2-webpack
Pyramid integration of jinja2_webpackFree software: BSD licenseInstallationpip install pyramid-jinja2-webpackDocumentationhttps://pyramid-jinja2-webpack.readthedocs.io/DevelopmentTo run the all tests run:toxTo run on a specific version of python run e.g.:tox -e py34
tox -e py27Changelog0.1.0 (2017-06-01)First release on PyPI.
Package: pyramid_jitt
Thepyramid_jittpackage is a wrapper around thejstcJavaScript
template compiler that allows client-side templates to be defined in
disparate server-side files and be assembled, pre-compiled, packaged,
cached, and access-controlled for inline, deferred, and restricted
delivery.ImportantAs of 2016/10/09, “restricted” delivery (i.e. access-controlled
delivery control of all or a subset of the templates) and
per-template JIT rendering is not yet available.Currently,jQuery(v1.9.1+) is required for non-inline template
delivery.ProjectHomepage:https://github.com/canaryhealth/pyramid_jittBugs:https://github.com/canaryhealth/pyramid_jitt/issuesInstallation$pipinstallpyramid_jittUsageEnable the package either in your INI file via:pyramid.includes=pyramid_beakerpyramid_jitt(it is highly recommended to usepyramid_beakerfor caching of
rendered templates) or in code in your package’s application
initialization via:defmain(global_config,**settings):# ...config.include('pyramid_beaker')config.include('pyramid_jitt')# ...Configure pyramid_jitt’s behaviour by setting the various options in
your INI file (see theManualfor details), for example:# use pyramid_beaker for caching!cache.type=memorycache.regions=pyramid_jittcache.pyramid_jitt.expire=3600# override all template attributes to disable deferred loadingjitt.overrides.inline=true# define where the "webapp" templates (Handlebars, in this case) are# located and disable pre-compilation (only for "webapp" templates)jitt.@webapp.assets=myapp:static/scripts/**.hbsjitt.@webapp.overrides.precompile=falseThen, add the delivery payload to your HTML file, here aMakoexample:<html>
  <body>${request.registry.jitt.render('webapp')|n}<script type="text/javascript">
      // NOTE: this must come **after** the `jitt.render` call!
      $(function() {
        $('#Templates').data('jitt').ready(function() {
          // start your client-side app that uses your templates here!...
        });
      });
    </script>

  </body>
</html>More DocumentationMore documentation can be found in theManual.
Package: pyramid_jqm
pyramid_jqmpyramid_jqmis a package which provides “starter” scaffolding for
creating ajQuery MobilePyramid application.Seehttp://docs.pylonsproject.org/projects/pyramid_jqm/en/latest/for
detailed documentation.0.3 (2012-04-17)Make compatible with Venusian 1.0a4 (dont rely onview_config(www)to
be scanned).Prevent import warning when installed on Pyramid 1.2.AddFramework :: Pyramidtrove classifier.Addtestinganddocsextras to setup.py.0.2 (2011-12-14)Made scaffolding compatible withpcreatefor Pyramid 1.3a2+.Useegg:pyramid#wsgirefserver instead ofegg:Paste#httpserver.
This change will require users to use any of Pyramid 1.1.3, Pyramid 1.2.5,
or Pyramid 1.3a2+.  Older minor versions in any of those series will fail.Updated the scaffold’s version ofjquery.mobileto version 1.0.
[WouterVH]Updated the scaffold’s version ofjquery.mobileto version 1.0rc3.Updated the scaffold’s version ofjqueryto version 1.6.4.0.1 (2011-11-02)Initial release.
Package: pyramid-jsroutes
Pyramid JSRoutes================A pyramid routes composer for javascript.Installation------------pip install -U pyramid-jsroutesUsage-----Include the package in your Pyramid app's main function:```pythondef main():...config.include('jsroutes')...return config.make_wsgi_app()```this will make `jsroutes` available to all your template context, then you can use it like:<script type="text/javascript">${jsroutes|n}</script>then you can start composing your Pyramid routes from javascript like:```javascriptJSROUTES.blog_post(1)  // /posts/1```Settings--------By default it'll only collect the routes once and store it in the registry but you can force reloading everytime for development by settings the following settings:jsroutes.reload_routes = trueNote----Each time your modify your Pyramid routes, you need to refresh your page to refetch the updated routes... :changelog:History-------0.1.2 (2013-07-07)+++++++++++++++++++- Removed rendering of build route args when route doesn't have args0.1.1 (2013-07-06)+++++++++++++++++++- Added `jsroutes.reload_routes` settings0.1.0 (2013-07-06)+++++++++++++++++++- Initial commit
Package: pyramid_jwtauth
NOTE: This is an early version of the code is the library is likely to change.This is a Pyramid authenitcation plugin for JSON Web Token (JWT)
Authentication:http://self-issued.info/docs/draft-ietf-oauth-json-web-token.htmlTo access resources using JWT Access Authentication, the client must have
obtained a JWT to make signed requests to the server.  This library also makes
JSON Web Tokens for the client.  The Token can be opaque to client although,
unless it is encrypted, the client can read the claims made in the token.When accessing a protected resource, the server will generate a 401 challenge
response with the scheme “JWT” as follows:> GET /protected_resource HTTP/1.1
> Host: example.com

< HTTP/1.1 401 Unauthorized
< WWW-Authenticate: JWTThe client will use their JWT to build a request signature and
include it in the Authorization header like so:> GET /protected_resource HTTP/1.1
> Host: example.com
> Authorization: JWT token=eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt
 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ.dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk

< HTTP/1.1 200 OK
< Content-Type: text/plain
<
< For your eyes only:  secret data!(NB depending on the number of claims in the JWT the token can get large.
For all practical purposes, it should be kept short.)This plugin uses the PyJWT library for verifying JWTs:http://github.com/progrium/pyjwtAlso see the library for generating the JWT for the client in the first place
although any language can be used to generate it.InspirationThis module isheavilybased on (and copied from) the Mozilla Services
pyramid_macauth package and macauthlib package:https://github.com/mozilla-services/pyramid_macauthhttps://github.com/mozilla-services/macauthlibWithout it, I would not have been able to make the small number of
modifications to this package and get it to work with Pyramid.LicenceThis Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one athttp://mozilla.org/MPL/2.0/.PENDINGInitial dev version 0.0.1.dev1.Forked fromhttps://github.com/mozilla-services/pyramid_macauthversion 0.4.0-dev10.0.1.dev5Updated package requires to need PyJWT.0.0.1.dev4Updated package so that it can be downloaded for use by Python 3.3/3.40.0.1.dev3Now works properly with RSA keys and fixed issue with not doing a 401 with
the appropriate challenge.
Dropped support for Python 2.6 and 3.20.1.1Works with PyJWT 0.4.x (also unpinned).  Contributions by (Wichert Akkerman
<wichert@wiggy.net>) that enable the auth to use a ‘Bearer’ header rather than
the custom header ‘JWT’.Dropped support for Python 3.3 in tox, but it should still work fine.Addition (from development) perspective of using Vagrant to develop and
tox-test the package against python 2.7 and 3.40.1.2Added ability to disable various checks via the PyJWT options{} in the decode()
method.  This is configured in the policy via the Pyramid setting system.0.1.3Merged PR#11 from Shadizzle to provide ability to configure ‘scheme’ from the
INI file. Bumped version to 0.1.3.
Package: pyramid-keycloak
Keycloak based authentication policy for Pyramid frameworkAuthentication policy which uses Keycloak's OpenID API via a client
to authenticate the user. It uses cookies to hold the access token and
the refresh token.This package is dependant on the packagepython-keycloak.UsagefromkeycloakimportKeycloakOpenIDfrompyramid.configimportConfiguratorfromkeycloak_auth_policyimportKeycloakBasedAuthenticationPolicydefmain():openid_client=KeycloakOpenID(...)config=Configurator()config.set_authentication_policy(KeycloakBasedAuthenticationPolicy(openid_client))You have to handle the redirect logic in your forbidden view based on your
needs:frompyramid.httpexceptionsimportHTTPFound,HTTPForbiddenfrompyramid.requestimportRequestfrompyramid.viewimportforbidden_view_config@forbidden_view_config()defforbidden_view(request:Request):if...:# user has no privilegesraiseHTTPForbidden("You don't have permissions for this action")# Keycloak's URL to redirect to where the user can log inurl=...# you can either redirect to the URL or return it if you have a client# which consumes your APIreturnHTTPFound(url)You also need to have a callback endpoint where Keycloak redirects to after a
successful loginfromkeycloak.exceptionsimportKeycloakErrorfrompyramid.httpexceptionsimportHTTPFoundfrompyramid.requestimportRequestfrompyramid.viewimportview_defaults,view_config@view_defaults(renderer='json')classAuthApi:def__init__(self,request:Request)->None:self.request=requestself._openid_client=...# get OpenID client@view_config(route_name='auth.exchange',request_method='GET',permission='public')defexchange(self):try:token_response=self._openid_client.exchange(self.request.GET.get("code"),self.request.route_url("auth.exchange"))# the redirect URIexceptKeycloakErrorase:...# handle exceptionaccess_token=token_response.get("access_token")refresh_token=token_response.get("refresh_token")# set the tokens as cookies to the client and return a response# you can either redirect from here or if your application is consumed# as an API you can return a successful responseresponse=HTTPFound(...)response.set_cookie("refresh_token_cookie_name",refresh_token)response.set_cookie("access_token_cookie_name",access_token)returnresponseYou can also implement a logout endpoint if you feel like tofrompyramid.securityimportforget...@view_config(route_name='auth.logout',request_method='GET',permission='private')deflogout(self):headers=forget(self.request)response=self.request.responseresponse.headerlist.extend(headers)returnresponseFor more information see the docstrings of each method in the source.
Package: pyramid_layer
pyramid_layerpyramid_layer allows to address templates with two parameters,
category and name. Also it is possible to use set of directories
for each layer, in that casepyramid_layersearches templates
in each directory. It allows to override templates without changing
code. For example form library can define layerfield:>> ls ./fields/
.. bool.pt
.. file.pt
...
.. textarea.ptIn your application you can override any of this template by defining
new layer forfieldcategory:>> ls ./myproject/fields/
.. bool.ptUsually top level directory is a category and file in directory is template.
For example ‘form:view.lt’:`form` - layer category
`view` - template name
`.lt`  - custom pyramid renderer factoryLayer can to be defined withadd_layerconfig directive:>>config=Configurator()..config.include('pyramid_layer')....config.add_layer('form',path='./path_to_form_dirctory/form/')formdirectory can contain any template:>>./form/..view.pt..actions.jinja2It is possible to use any of this templates as pyramid renderer path:>>config.add_view(..name='view.html',..renderer='form:view.lt')or :>>config.add_view(..name='actions.html',..renderer='form:actions.lt')It is possible to run python code before rendering template.
There areadd_tmpl_filterdirective andpyramid_layer.tmpl_filterdecorator:>>defform_actions(context,request):..return{'url':...}>>config.add_tmpl_filter('form:actions',form_action,name='custom')or:>>importpyramid_layer>>@pyramid_layer.tmpl_filter('form:actions',name='custom')..defform_actions(context,request):..return{'url':...}form_actionsfunction gets call just before rendering template.
Layer has to be defined withadd_layerdirectve before registering
template filter function.CustomizationAny number of layer categories can be registered and any number of
layers can be registered in each category. It doesnt require to override
all templates from category. For example it is possible to override just
view.pt template:>> config.add_layer('form', 'custom', path='path_to_form_directory_2/form')and content of this new directory:>> ./another_path/form/
..   view.jinja2Now viewview.htmlusesview.jinja2template. Butactions.htmlstil
uses original template.Another example, if you want customizeboolfield from ptah.form package
all you need is to create some folder, add it as ‘fields’ layer, and putbool.pttemplate to this folder, something like that:>> config.add_layer('fields', 'custom', 'mypackage:fields')and>> .mypackage/fields/
..    bool.ptRequest methodpyramid_layeralso provides request methodrender_tmpl. It acccepts
path:..  ${structure: request.render_tmpl('form:actions').ltextension is optional in this case.player…Licensepyramid_layer is offered under the BSD license.CHANGES0.2 (11-01-2012)Addedlayoutsubsystem0.1 (10-30-2012)Initial release
Package: pyramid_layout
Pyramid Layout is an add-on for the Pyramid Web Framework which allows
developers to utilize the concept of a UI layout to your Pyramid application.
Different layouts may be registered for use in different contexts of your
application.  The concept of panels is also introduced to facilitate rendering
of subsections of a page in a consistent way across different views in a
reusable way.See thedocumentation at Read the Docs.pyramid_layout changelog1.0 (2014-08-29)Fixed a compatability issue with pyramid_jinja>=2.0.0.9 (2014-04-17)Fixed compatability issues with Pyramid 1.5.  This version and later will
require Pyramid 1.5 or later.Fixed issue where panel context could not be a boolean.0.8 (2013-08-31)Added configure.zcml file to top-level package for easier inclusion in client
ZCML configurations.Switched fromConfigurator.with_contextmethod, which was removed from
Pyramid in 1.3 release, topyramid_zcml.with_context.  This change
introduces new dependency - pyramid_zcml.Fixed Python 3.1 and 3.2 support inzcmlmodule by removing unicode
literals.It is now possible to use panels without a layout.It is now possible to provide a context other than the current request’s
context to a panel.0.7 (2012-02-06)Allow views for which no layout is found to function.0.6 (2012-12-26)Fixed bug where class panels couldn’t have args.Added error handling for the case where a BeforeRender event is not preceded
by a ContextFound event.  This can happen in the case where an error occurs
before a context is found and then a renderer is called by an error handler,
as would be the case using pyramid_debugtoolbar.  In this case there will be
no layout_manager, since the layout manager depends on the context.Removed Sphinx as an installation dependency.  It is still required by the
‘docs’ extra.0.5 (2012-10-23)Added a layout predicate to allow selection of a named layout declaratively
when using Pyramid >= 1.4.0.4 (2012-08-21)Changed name from pyramid_bottlecap to pyramid_layout.Completed documentation and unit tests.0.3 (2012-04-19)Removed Popper layout.Various minor improvements.0.2 (2012-01-04)initial release