Saravanan666/pypi-org huggingface dataset:
Package: pyramid-autowire
pyramid_autowireis a package that allows your pyramid views to use pyramids registry for dependency injection.frompyramid_autowireimportautowired@view_defaults(route_name='test_route',mapper=autowired)classPosts:def__init__(# Standard pyramid (context, request) and (request,) arguments# are available through position-only argsself,request,/,# the database and user objects will be injected from the registrydatabase:IDatabase,active_user:IUser):self.request=requestself.database=databaseself.active_user=active_user@view_config()defview_post(self,*,# the matchdict is injected as keyword-only argspost_id):returnself.database.query(Post,post_id)defincludeme(config):registry=config.registry# pretend for the example that the database session is globalregistry.registerUtility(MyDatabase(),IDatabase)defget_active_user(request):# Fetch active user from the request data...registry.registerAdapter(get_active_user,(IRequest,),IUser)
Package: pyramid-avro
pyramid-avro============This project is a Pyramid plugin built for integrating Avro protocol files into a pyramid application.Python Version Support----------------------Current Supported Versions:* 2.7* 3.3* 3.4* 3.5A Note On Compilation---------------------While this plugin provides for auto-compiling your avro protocol into an avro schema, this is rarely something you'd want in all environments your application might be deployed into.When defining a service configuration, you **must have at least a schema defined**.This means that the protocol file itself isn't actually ever required **UNLESS** the auto_compile flag is turned on.For non-development configs, we suggest compiling your schema files prior to deployments and simply specifying them in your config rather turning auto_compile on.Lastly, the tools jar must be provided by you, the developer, not this plugin.In addition to not wanting a compilation at runtime in non-dev environments, you probably don't want that jar hanging around either.Actual Docs-----------The official documentation can be found at: https://pyramid-avro.readthedocs.org/* **PyPI**: https://pypi.python.org/pypi/pyramid-avro/* **Coverage**: [![Coverage Status](https://coveralls.io/repos/github/packagelib/pyramid-avro/badge.svg?branch=master)](https://coveralls.io/github/packagelib/pyramid-avro?branch=master)* **Build Status**: [![Build Status](https://travis-ci.org/packagelib/pyramid-avro.svg?branch=master)](https://travis-ci.org/packagelib/pyramid-avro)* **License**: Apache License (2.0)0.1.0-----* Add python3 support.0.0.2-----* Update Pyramid Version Requirement
Package: pyramid_backend
pyramid_backend===============A backend development kit for pyramid, feel free to email me *hoc3010 at gmail dot com* about this package.Usage-----config.include('pyramid_backend')### Configurations:1. *pyramid_backend.admin_site*: related path for backend site from root2. *pyramid_backend.manager_factories*: the list of backend manager factories. Default is :pyramid_backend.backend_manager.sqlalchemy:factory3. *pyramid_backend.models*: list of class to be managed automatically by pyramid_backendFor each model, the display configurations can be:Model.__backend_id_attr__ = name of list of names in Model's primary keyModel.__backend_schema_cls__ = a Colander/Deform SchemaModel.__backend_slug__ = value to use on url, default = auto detectModel.__backend_display_name__ = display name for model, default = auto detectModel.__backend_id_attr__ = id attribute name, default = "id"Model.__backend_list__columns_to_display__ = List Attributes, default = auto detectModel.__backend_detail__columns_to_display__ = List Attributes, default = auto detectModel.__backend_list__items_per_page__ = Number of items per page, default = 50Model.__backend_detail__relations_to_display__ = List Attributes, default = auto detect#### List AttributesThis is a list of attributes to display, each item can be:1. a string: attribute name2. a tuple: first element is attribute name. The rest is limit (if it's a list) and display name,order is not important#### Backend manager's configuration:##### SQLAlchemyDBSession for a model will be searched in order: Model.__dbsession__, configured DBSession1. *pyramid_backend.sqlalchemy.dbsession*: the full path to Session object.I.e: app.db:DBSession### API> Updating#### @model_view_config, add_model_view#### @model_action_config, add_model_action#### @object_action_config, add_object_actionCHANGE LOG----------# Version 1.3.4* Fix bugs at 1.3.2# Version 1.3.3* Mirror fixs for python 2.7# Version 1.3.2* Fix error when update model schema contains primary key in cqlengine# Version 1.3.1* Fix some mirror bugs* Remove SQLAlchemy multi DBSession supporting. This feature will be do atengine binding from main project's scope.# Version 1.3.0* Add python3 support* Fixbug when cqlengine is not installed* SQLAlchemy: Support multi DBSession:* DBSession for a model will be searched in order: Model.__dbsession__, configured DBSession# Version 1.1.0* Add python3 support# Version 1.0.7* Fix important bug for fetch_object from id### Version 1.0.6* Make SQLAlchemy adatper more accurate### Version 1.0.5* Add support for multi field primary key### Version 1.0.4* Add backend manager for cqlengine models.### Version 1.0.x* Initialize
Package: pyramid_backend_vgid_oauth2
Hệ thống quản trị người dùng backend mặc định dành cho pyramid_backend dựa trên pyramid_vgid_oauth2Sử dụng# cần inlcude “pyramid_backend”, “pyramid_vgid_oauth2” cùng configuration trước đó
config.include(‘pyramid_backend_vgid_oauth2’)
config.set_authorization_policy(…)### Configurationpyramid_backend_vgid_oauth2.auth_secret = option, key để mã hóa cookie đăng nhập
pyramid_backend_vgid_oauth2.roles = các role cho User, ngăn cách bởi “,”Hệ thống này sử dụng backend để lưu trữ User dựa trên SQLAlchemy, chỉ cần config biến DBSession
là đượcpyramid_backend_vgid_oauth2.sa.dbsession = ‘đường dẫn đến dbsession’CHANGE LOG### 1.0.xPackaging
Package: pyramid-basemodel
pyramid_basemodelpyramid_basemodelis a thin, low level package that provides an SQLAlchemy
declarativeBaseand a thread local scopedSessionthat can be used by
different packages whilst only needing to be bound to a db engine once.UsageYou can use these as base classes for declarative model definitions, e.g.:frompyramid_basemodelimportBase,BaseMixin,Session,saveclassMyModel(Base,BaseMixin):"""Example model class."""@classmethoddefdo_foo(cls):instance=Session.query(cls).first()save(instance)You can then bind these to thesqlalchemy.urlin your paster.iniconfig by
importing your model and this package, e.g.:# for example in yourapp.__init__.pyimportmymodeldefmain(global_config,**settings):config=Configurator(settings=settings)config.include('pyramid_basemodel')config.include('pyramid_tm')returnconfig.make_wsgi_app()Or if this is all too much voodoo, you can just use thebind_enginefunction:.. code-block:: pythonfrom pyramid_basemodel import bind_engine
from mypackage import mymodel# assumingengineis a bound SQLAlchemy engine.
bind_engine(engine)Note that theSessionis designed to be used in tandem with [pyramid_tm][].
If you don’t includepyramid_tm, you’ll need to take care of committing
transactions yourself.TestsTo run the tests use:py.test -v --cov pyramid_basemodel tests/[pyramid_basemodel]:http://github.com/fizyk/pyramid_basemodel[pyramid_simpleauth]:http://github.com/thruflo/pyramid_simpleauth[pyramid_tm]:http://pyramid_tm.readthedocs.orgReleaseInstall pipenv and –dev dependencies first, Then run:pipenv run tbump [NEW_VERSION]
Package: pyramid_beaker
Provides a session factory for thePyramidweb framework backed by theBeakersessioning
system.Seethe Pylons Project documentationfor
more information.0.8 (2013-06-28)On Python 3, the CSRF token returned by new_csrf_token was a bytestring
instead of correctly being a string.  Seehttps://github.com/Pylons/pyramid_beaker/pull/12A new argument to PyramidBeakerSessionFactoryConfig namedconstant_csrf_tokenis now permitted for test configuration purposes.
Seehttps://github.com/Pylons/pyramid_beaker/pull/13for more information.0.7 (2012-07-10)Python 3.2 compatibility.Dropped Jython support (may be re-added after Jython releases a 2.7-
compatible version).Dropped Python 2.5 support.Made compatible with zope.interface 4.0.0 (symptom:TypeError: Class advice impossible in Python3.  Use the @implementer class decorator instead.when run under Python 2 ororPython 3)Adddevanddocssetup.py aliases.0.6.1 (2011-11-19)Beaker 1.6+ compat: added support forkey_lengthandenabledoptions.0.6 (2011-11-12)Add a tox.ini for Jenkins testing.Add includeme function to ease application setup.0.5 (2011-03-30)The default value for thecookie_on_exceptionparameter topyramid_beaker.BeakerSessionFactoryConfigis nowTrue.  This means
that when view code causes an exception to be raised, and the session has
been mutated, a cookie will be sent back in the response.  Previously its
default value wasFalse.0.4 (2011-01-08)Allow cache regions to inherit URL configuration from main cache options.Respect acookie_on_exceptionconfiguration value passed to theBeakerSessionFactoryConfigconstructor.  If this value is passed and
it’s not false, session cookies will be set even on responses resulting
from an exception.Update to new relationship betweennew_csrf_tokenandget_csrf_tokenas described in Pyramid 1.0a9 interfaces.0.3 (2010-12-29)Support ISession flash/csrf API added to Pyramid 1.0a8+.0.2 (2010-11-27)Add cache_region support viapyramid_beaker.set_cache_regions_from_settings(and documented).0.1Initial release.
Package: pyramid-blacksmith
Pyramid bindings forBlacksmithrest api client.IntroductionThis plugin create a request proterty namedblacksmiththat bind
clients to do API Call usingBlacksmith.Clients are configured via the pyramid configurator and its settings.Then you can access the client factory behind a blacksmith property of
the request.def my_view(request):
   api_dummy = request.blacksmith.client("api_dummy")
   dummy = api_dummy.dummies.get({"name": "alice"})In the example above, a dummy resource has been fetch using the service api_dummy.
The client method is a configuredBlacksmith Factory.The configuration of the factory is simply made throw the pyramid configurator.Go ahead andget familiar with the documentation.
Package: pyramid-bootstrap
MaintainerJoe Black |me@joeblack.nyc|githubIntroductionPyramid extension that bundles all bootstrap 4 resources, including
font-awesome.  Allows for locally hosted development and CDN hosted production.Also includes master layout template for jinja2 and chameleon template languages.Installationpip3installpyramid_bootstrapUsageApp Factory ConfigInclude in your pyramid config either through .ini file, ZCML, or in python, ex:config.include('pyramid_bootstrap')Example templateshome.jinja2{% extends "pyramid_bootstrap:/templates/bs4/layout.jinja2" %}

{% block title %}Quick Tutorial: {{ name }}{% endblock title %}

{% block content %}
<h1>Hi {{ name }}</h1>
{% endblock content %}home.pt<metal:macro use-macro="master">
  <metal:slot fill-slot="title">
    <title>Quick Tutorial: ${name}</title>
  </metal:slot>

  <metal:slot fill-slot="content">
    <h1>Hi ${name}</h1>
    <p>Chameleon is an XML-based templating language</p>
  </metal:slot>
</metal:macro>ChangesCHANGELOG
Package: pyramid-bootstrap4
MaintainerJoe Black |me@joeblack.nyc|githubIntroductionPyramid extension that bundles all bootstrap 4 resources, including
font-awesome.  Allows for locally hosted development and CDN hosted production.Also includes master layout template for jinja2 and chameleon template languages.Installationpip3installpyramid_bootstrap4UsageApp Factory ConfigInclude in your pyramid config either through .ini file, ZCML, or in python, ex:config.include('pyramid_bootstrap')Example templateshome.jinja2{% extends "pyramid_bootstrap:/templates/bs4/layout.jinja2" %}

{% block title %}Quick Tutorial: {{ name }}{% endblock title %}

{% block content %}
<h1>Hi {{ name }}</h1>
{% endblock content %}home.pt<metal:macro use-macro="master">
  <metal:slot fill-slot="title">
    <title>Quick Tutorial: ${name}</title>
  </metal:slot>

  <metal:slot fill-slot="content">
    <h1>Hi ${name}</h1>
    <p>Chameleon is an XML-based templating language</p>
  </metal:slot>
</metal:macro>ChangesCHANGELOG
Package: pyramid_boto3
Adaptboto3topyramidwithpyramid_servicesInstallfrom PyPI:pip install pyramid_boto3How to useIn configuration phase, includepyramid_boto3afterpyramid_services:from pyramid.config import Configurator

def main(global_config, **settings):
    config = Configurator(settings=settings)
    config.include('pyramid_boto3')

    # Your configuration

    return config.make_wsgi_app()In view or traversing, you can get predefinedboto3’sClientorResourceinstances throughrequest.find_service():@view_config()
def some_view(request):
    client = request.find_service(name='boto3.client.filepot')
    client.list_buckets()You need to define servie’s name (ex/'boto3.client.filepot') and
arguments in your config file:[app:main]

# your-config

boto3.cache_factory = threading.local
boto3.sessions = mysession
boto3.session.mysession.core.config_file = /path/to/aws/config.ini
boto3.session.mysession.core.credentials_file = /path/to/aws/credentials.ini
boto3.session.mysession.core.profile = prof1
boto3.clients = filepot
boto3.client.filepot.session = mysession
boto3.client.filepot.service_name = s3Configuration Keysboto3.namespace prefixboto3.cache_factoryfull qualified callable name.
default isthreading.local.
if you would like to disable, set blankboto3.sessionslist of session’s namesboto3.session.NAME.*See:boto3.session.Session’s docs.
parambotocore_sessionare created from
blowcore.sub params.boto3.session.NAME.core.See:botocore.session.Session’s docs.boto3.configslist of client config’s namesboto3.config.NAME.*See:botocore.config.Config’s docs.boto3.config.NAME.s3.*See:s3parameter inbotocore.config.Config’s docs.boto3.clientslist of client’s namesboto3.client.NAME.sessionname of session to create client.boto3.client.NAME.config(optional) name of config to create client.boto3.client.NAME.*See:boto3.session.Session.client()’s
docs.boto3.resourceslist of resource’s names.boto3.resource.NAME.sessionname of session to create resource.boto3.resource.NAME.config(optional) name of config to create resource.boto3.resource.NAME.*See:boto3.session.Session.resource()’s
docs.Change History0.3 - 2018-11-06fixes imcompatibilities with botocore-1.12.38 later (#1)include pre-requirements (pyramid_services)drop python-3.3 support, add python-3.7 supportblackify and linted0.2.1 - 2017-06-14fixes resource cache0.2 - 2017-06-14botocore.session.Session.create_clientdoes not support threading. See: boto/botocore#1033per-thread cache.tox support.universal wheel support.0.1 - 2016-04-09Initial release.
Package: pyramid_bowerstatic
pyramid_bowerstatic: BowerStatic integration for Pyramidpyramid_bowerstatic integratesBowerStaticintoPyramid.When you create a pyramid app, make sure to include pyramid_bowerstatic:config.include('pyramid_bowerstatic')Resources can be added to the bowerstatic repository by:components = pyramid_bowerstatic.create_components('myapp', os.path.join(os.path.dirname(__file__), 'bower_components'))And resources can be used in views by:request.include(components, 'jquery')Resource can also be inserted in the view/template directly by using:request.get_bowerstatic_url('myapp', 'jquery', 'jquery.js')CHANGES0.3 (2014-11-19)BowerStatic 0.7 has changed the API for tweens, which is
changed in version 0.3 of pyramid_bowerstatic.0.2 (2014-11-13)With the release of bowestatic 0.6 it can be used as tweens.
As a consequence bower.wrap is not needed anymore. Which
makes it pyramid_bowerstatic easier to use.0.1 (2014-11-08)Initial public release.
Package: pyramid_bpython
bpythonbindings forPyramid.Installation$ $VENV/bin/pip install pyramid_bpythonUsageEnsure the shell is available:$ $VENV/bin/pshell --list-shells
Available shells:
  bpython
  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 bpython development.ini
Package: pyramid_bpython_curses
bpythonbindings forPyramidin a curses variant (forWindows).InstallationInstallcurses for windows$ pip install pyramid_bpython_cursesUsageEnsure the shell is available:$ pshell --list-shells
Available shells:
  bpython_curses
  pythonThe shell should be auto-selected when runningpshell:$ pshell development.iniHowever, if there are multiple shells you can also be explicit:$ pshell -p bpython_curses development.ini
Package: pyramid_braintree
Braintree initializer for the Pyramid Web Framework. 100% Test Covered.The following configuration options are required in your config.ini:pyramid.includes =
    pyramid_braintree

braintree.environment = sandbox
braintree.merchant_id = MY_MERCHANT_ID
braintree.public_key = MY_PUBLIC_KEY
braintree.private_key = MY_PRIVATE_KEYThe following configuration options are supported forenvironment:developmentproductionsandboxAdditionally, theuse_unsafe_ssloption may be specified (otherwise, this
configuration wisely defaults toFalse):braintree.use_unsafe_ssl = True0.1.1 (2013-07-02)Relying on Pyramid’s asbool helper for more robust boolean detection.0.1 (2013-06-27)Allow for the following Braintree configuration options:environment,merchant_id,public_key, andprivate_key
Package: pyramid_cachebust
# Pyramid CachebustBust cache on static assets via query string params.## InstallationVia pip:pip install pyramid_cachebust## SetupAdd to your configurator via the `include` method:config = Configurator()config.include('pyramid_cachebust')config.add_static_view('static', 'myapp:static')Now `pyramid.request.Request` has two new methods: `cachebusted_path` and `cachebusted_url`. These methods are wrappers for `request.static_path` and `request.static_url`, with the addition of tagging on cache-busting query parameters:request.cachebusted_path('myapp:static/file.css')>>> '/static/file.css?_=394a82fdd72eed3ac45d113bd8af554e'request.cachebusted_url('myapp:static/file.css')>>> 'http://localhost/static/file.css?_=394a82fdd72eed3ac45d113bd8af554e'The querystring gets generated in one of two ways. The default is an MD5 hexdigest of the file contents. The two alternatives are the file's mtime ('mtime') or the time of app init ('init'). Generation of the hash/lookup of the mtime happens once per asset. Results are cached and served upon resultant calls.## ConfigurationTo place in your Pyramid `.ini`:| name                    | type    | default   | description|-------------------------|---------|-----------|-------------| cachebust.enabled       | bool    | true      | toggles plugin on/off| cachebust.reload_files  | bool    | false     | when true, cache is ignored and query param is calculated on every request| cachebust.method        | str     | md5       | method of file calculation (md5, mtime or init)| cachebust.param_key     | str     | _         | key of query param## ContributorsThanks for your contributions:* Richard Maisano (maisano)* Marius Gedminas (mgedmin)
Package: pyramid_caching
Key versioning caching for pyramid.ChangelogTODODOCUMENTATION.IntrospectablesContent negociation: we should add content type in cache key.0.2.3New release to fix packaging issue0.2.2Add the HTTP scheme to the cache key (mostly for generated links in response)0.2.1Bypass cache when an error occurs while getting the cache key version or the
cached data.0.2.0ext.sqlalchemy: Increment new and deleted entities and table identities.Simple dependency resolution for location-aware resources.ext.royal: New extension for caching pyramid_royal resources.Allow key identity generators to define resources that don’t need to be
invalidated.0.1.2Breaking changes:cache_factorykeyword argumentsdepends_onis a
list of callables which receiving request as positional argument. Callables
return the dependency to be identified by cache manager.Add argumentspredicatestocache_factorywhich permits to add
predicates to cache key used for the view (useful for query strings).0.1.1Switch back to d2to1.0.1First draft of interfacesAdd a highly not efficient implementation of a key versionerAdd a model versioner which depends on key versioner and model identity
inspectorAdd an example application with dummy sqla model to run tests againstAdd an sqla specific extention with hook on session events to get model
modifications.Add and removecache_basicdecorator to cache basic function with primitive
typed argument. Let’s focus at view level. We’ll do basic decoraor later.Addcache_factoryto construct a decorator to pass toconfig.add_viewmethod.Add a cache manager which plug all components.Add serializers to adapt objects to store on cache. Serializer objects follow
a standardloads/dumpsinterface.Add Redis client for caching and versioningImplement master-version in redis version-storeThe cache manager emits CacheHit and CacheMiss events. These events can be
forwarded to a statistics aggregator by using the pyramid_metrics extension.Sets the reponse ETag and custom X-View-Cache HTTP headers based on the
versioned key of the resource.
Package: pyramid-captcha
Pyramid CaptchaThis Python package provides a captcha implementation for use with thePyramid Web Framework.
It is based on thecaptchalibrary and uses
Pyramid sessions for captcha validation. Please refer to thedocumentationfor further information.NoteDevelopment builds of this package can be found athttps://test.pypi.org/project/pyramid-captcha/.UsageTo generate a captcha, you have to import the classCaptcha.frompyramid_captchaimportCaptchaThe simplest solution is to use this class directly in your
view definition.config.add_route('captcha_generate','/captcha')config.add_view(Captcha,attr='generate',route_name='captcha_generate',request_method='GET')In this case, the route/captchawill return a captcha image
with the default length of 6 characters. If you want to adjust the
captcha properties, you have to wrap it into a view callable, for
example to change the number of characters.defgenerate(request):returnCaptcha(request,length=4).generate()The generated captcha value is stored in the current session. It
can be checked against a submitted form value using thevalidate()method.try:Captcha(request).validate()exceptCaptchaErrorase:raiseHTTPForbidden(e)DemoYou can check out the code and run a little demo by callingmake serve.Changelog1.0.0https://gitlab.com/geo-bl-ch/pyramid-captcha/-/milestones/1Add parameter for value validationConfigurable captcha lengthInitial version
Package: pyramid-cas
Introductionpyramid_casallows your application to authenticate against a Jasig CAS server.
It takes borrowed concepts from different packages like django.cas, anz.client, and collective.cas.Licensepyramid_casis licensed under the Apache License 2.0.Installationpip install pyramid_casInstructionsRequired:Include pyramid_cas under pyramid.includes directive in your .ini file like this:pyramid.includes =
    [... other packages ...]
    pyramid_casSet the cas server that will be used for authentication:pyramid_cas.cas_server = your-cas-server
pyramid_cas.redirect_route    - allows you to specify what route name to redirect to after succesful authenticationOptional:pyramid_cas.callback.get_user - allows you to use a callback function to store a different User object after CAS authentication.
                                By default pyramid_cas will store (using the pyramid remember method) only the user id returned by CAS.Example:pyramid_cas.callback.get_user = adminsite.security.getUserObject
pyramid_cas.redirect_route = profile  # redirects to profile page on successful authenticationUse the following route names for login and logout in your application:cas-login
cas-logoutTODOImplement CAS 1.0 protocolAdd login and logout by injection and makes it configurable using tweensAdd testsAdd demosPrevent adding pyramid_cas without settingsAdd came_from parameter0.4 [2/14/23]Fix a python 3 import error0.3 [7/21/14]Now Apache licensedLogin and logout routes are now namedAdded redirect route after successful authentication0.2 [6/17/14]Brought into compliance with PEP8Clarified documentationFixed bug related to iteration over headers (thanks, Szymon:https://github.com/zefciu/pyramid_cas/commit/3b67e69ea2418e64fcf8312e00fa17e10198788f)0.1 alpha[April 13, 2012] Initial version