Saravanan666/pypi-org huggingface dataset:
Package: pyramid_alchemy
Good frameworks, like [Pyramid][] and [Angular][], help developers writetestable code. [SQLAlchemy][] is a great framework. However, the sheerconvenience of having model instances returned from a database queryencourages developers to write large ORM classes which can be hard to test.One way to avoid this is to keep model classes [thin][] and write separate codeto instantiate and manipulate them. The downside of this approach is the loss inconvenience: the separated, easily testable code isn't provided by default asan attribute of the model instances returned from a database query.[pyramid_alchemy][] provides an `add_model_method` Pyramid[configuration directive]() that extends [SQLAlchemy ORM][] classes in the sameway that `add_request_method` [extends the Pyramid Request][]. Using thisdirective allows developers to write easily testable code that is convenientlyavailable as a model instance attribute. For example, if you [include][] thisin your Pyramid application:```pythonfrom .model import Spamdef get_eggs(instance, source='hens', limit=9, offset=0):"""Example ORM instance method, implemented as a standalone function."""query = instance.query.filter_by(source=source)return query.offset(offset).limit(limit)def includeme(config):config.add_model_method(Spam, get_eggs, 'get_eggs')```You can then use the `get_eggs` method from `Spam` instances:```pythonspam = Session.query(Spam).get(1)eggs = spam.get_eggs()```### InterfacesJust as you can hang a Pyramid view off any context object implementing aspecific interface, you can extend any model instance implementing an interface.For example, if your model looked something like this:```pythonfrom sqlalchemy.ext.declarative import declarative_basefrom zope.interfaces import implementerfrom .interfaces import IFillingBase = declarative_base()@implementer(IFilling)class Ham(Base):# ...@implementer(IFilling)class Spam(Base):# ...```Then you could extend all fillings -- current and future -- with:```pythonconfig.add_model_method(IFilling, get_eggs, 'get_eggs')```### LimitationsNote that it's highly unlikely to be a good idea to use `add_model_method` toadd dynamic or hybrid methods that affect the underlying sql table or mapping.[Pyramid]: http://docs.pylonsproject.org/projects/pyramid/en/latest[Angular]: http://angularjs.org[SQLAlchemy]: http://docs.sqlalchemy.org/en/latest[pyramid_alchemy]: https://github.com/thruflo/pyramid_alchemy[configuration directive]: http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/extconfig.html[SQLAlchemy ORM]: http://docs.sqlalchemy.org/en/latest/orm[extends the Pyramid Request]: http://docs.pylonsproject.org/projects/pyramid/en/latest/api/config.html#pyramid.config.Configurator.add_request_method[include]: http://docs.pylonsproject.org/projects/pyramid/en/latest/api/config.html#pyramid.config.Configurator.include[thin]: http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/
Package: pyramid_amdjs
pyramid_amdjsallows to manage js and css resources as amdjs modulesconfig.include('pyramid_amdjs')config.add_amd_js('jquery','pyramid_amdjs:static/lib/jquery-1.8.2.min.js','JQuery Library')Then you can use jquery in your amd moduledefine('my-package',['jquery'],function($){$('...').})To include your module to page:defmy_view(request):request.require_js('my-package')Support and DocumentationOn irc, use the freenode network and find us on channels, #ptahproject and #pyramid.Documentation can be found indocsdirectory.  You can also see it online athttp://pyramid_amdjs.readthedocs.org/Report bugs atpyramid_amdjs @ GithubLicensepyramid_amdjs is offered under the MIT license.CHANGES0.5.4 (02-19-2013)Upgrade handlebars compiler0.5.3 (02-15-2013)Bootstrap - 2.3.0JQuery - 1.9.1Handlebars - 1.0.0.rc.30.5.2 (01-18-2013)Fix css resource registration0.5.1 (01-18-2013)Do not add .css to css module namerequest.require alias for require_js0.5 (01-17-2013)js refactoringhb templates splited to separate jsdatetimehb helper is optionaladded backbonejs0.4 (01-15-2013)Automatic mods inclusionStatic resource managementjQuery 1.9.00.3.2 (01-08-2013)Fixed reading resource files with non ascii content0.3.1 (01-07-2013)Show amd module define exception (curljs)Added helper pform js mod0.3 (01-03-2013)Added debug modeAdded_vquery param that allow stong cachingcurl.js 0.7.3uglify.js 1.3.40.2.1 (12-18-2012)Fixed: use route_url for amd ini js path0.2 (12-11-2012)Added twitter bootstrap (2.2.2)Allow to pass all params in options for pyramid.Object (javascript)0.1 (11-01-2012)Initial release
Package: pyramid_angularstarter
# Pyramid Angular StarterThis is a project scaffold for the [pyramid webframework](http://www.pylonsproject.org/projects/pyramid/about) thatis setup for javascript development using[angularjs](https://angularjs.org/) and other nice things.Hopefully it will save you an hour or 2 when you are starting thatnext awesome twitter clone.## Project generationThis is a project scaffold so you use it in the normal pyramid way.```bash$ pcreate -lAvailable scaffolds:alchemy:                 Pyramid SQLAlchemy project using url dispatchangularjs:               Pyramid + Angularjsangularjs_w_user:        Pyramid + Angularjs + User model, registration, forgot passwordpyramid_jinja2_starter:  pyramid jinja2 starter projectstarter:                 Pyramid starter projectzodb:                    Pyramid ZODB project using traversal```Note the additional scaffold "angularjs" and "angularjs_w_user", running pcreate with either of thesescaffolds will generate a project skeleton with the following"features".* pyramid project setup with jinja2, sqlalchemy, and a request local session attribute "db"* a javascript project under <project_name>/client-src setup with bower, gulp, coffeescript and sass* a skeleton angularjs project + foundation cssadditionally, angular_js_w_user provides a user model and views for the following.* login* logout* registration* forgot passworddatabase migrations via alembic are already configured with this template as well.Hopefully everything else is self explanatory. :)# 0.1new template angularjs_w_user, which provides configured db migrationsvia alembic, a user model, and views for login/logout/register/forgotpassword# 0.0Initial project generation
Package: pyramid-arima
pyramidPyramid is a no-nonsense statistical Python library with a solitary objective: bring R'sauto.arimafunctionality to Python. Pyramid operates by wrappingstatsmodels.tsa.ARIMAandstatsmodels.tsa.statespace.SARIMAXinto one estimator class and creating a more user-friendly estimator interface for programmers familiar with scikit-learn.InstallationPyramid is on pypi under the package namepyramid-arimaand can be downloaded viapip:$pipinstallpyramid-arimaTo ensure the package was built correctly, import the following module in python:frompyramid.arimaimportauto_arimaDocumentationAll of your questions and more (including examples and guides) can be answered
by thePyramid documentation. If not,
always feel free to file an issue.
Package: pyramid_assetmutator
Copyright: (c) 2016 Seth Davishttp://github.com/seedifferently/pyramid_assetmutatorSynopsisPyramid AssetMutator provides simple and dynamic asset mutation (also known as
compiling or piping) for yourPyramidapplications.Inspired by other more powerful asset management packages, its goal is to
provide a basic and straightforward mechanism for assetcompilation(e.g.
CoffeeScript/LESS),minification(e.g. jsmin), andoptimization(e.g.
pngcrush).As of version 0.3, it also adds experimental support for template language
parsing (e.g. you could use view helpers likerequest.route_url()in your
CoffeeScript by installing thepyramid_jinja2package and using
application.coffee.jinja2 as the asset source filename).InstallationTo install, simply:pip install pyramid_assetmutatorYou’ll need to havePython2.6+ andpipinstalled.DocumentationYou can read the documentation at:https://pyramid-assetmutator.readthedocs.io/Known Issues and LimitationsExperimental support for Py3k/pypy.Doesn’t clean up after itself (compiled/mutated assets aren’t removed
automatically).Mutator “commands” must print to stdout (see the documentation for more info).Hopefully obvious, but you have to actually have the specified compiler
command installed and accessible from your working path in order for it to
work.Disclaimers and WarningsThis is Alpha software–use at your own risk!THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.Latest Changesv0.4 – 09/16/2016Fixed a bug where mutated files could be created with incorrect filenames if
theeach_bootsetting was enabled with aremutate_checkvalue ofmtimeorchecksum.Fixed a Windows bug due toshlex.splitusage (thanks @tdamsma).Added apurge_mutated_pathsetting which can be used to remove all files
from a specifiedmutated_pathupon application boot.
Package: pyramid_assetviews
pyramid_assetviews is a small module that allows you to add Root-Relative
views to your project. This enables you to serve assets that need to be
accessed from the root of your domain such as robots.txt or favicon.ico
without having to setup a static media server such as nginx or lighttpd.1.0a3Included the sphinx documentation as part of the distribution package.Cleaned up the MANIFEST.in so there are no more warnings when installing
the package.1.0a2Updated the add_asset_view methods method signature to accept a filename or
list of filenames instead of using*namesargument as a catch all.Added http_cache setting that addes Cache-Control: max-age and Expires
headers. http_cache accepts time in seconds.  For example: http_cache=5000.Dropped zope.interface dependency and picked up a webob dependency instead.Added License Information.1.0a1Initial version
Package: pyramid-asyncio
A lib that override pyramid to build asyncio web application.Basically, it change views to asyncio coroutine.ImportantThis library is a proof of concept and has not been ported to recent version
of Pyramid and aiohttp.Getting Startedpyramid_asyncio add two directives to treat views as coroutine.config.add_coroutine_view()This is a coroutine version of theconfig.add_view.
pyramid_asyncio provide also a decoratorcoroutine_view_configwhich
is the view_config version for coroutine view.config.make_asyncio_app()This create the wsgi app that work with the aiohttp gunicorn worker.
aiohttp.worker.AsyncGunicornWorkerconfig.make_wsgi_app() could not be used because the pyramid router
must be changed.The simple way to create the pyramid app with asyncio is to use the
scaffold.pyramid_asyncio comme with a scaffold that create a “hello world” application,
check itpcreate -s aio_jinja2 helloworldChangelog0.2 Released on 2017-05-07Pin version of Pyramid 1.5The ViewDeriver has evolved and is now an interface IViewDeriver.
Unfortunately, this make things harder for replacing the default ViewDeriver
installed.Pin version of aiohttp.WSGI/Gunicorn support has been dropped in version 2.0.1 Released on 2015-03-30Initial Release
Package: pyramid-authsanity
An auth policy for thePyramid Web Frameworkwith sane defaults that works withMichael
Merickel’sabsolutely fantasticpyramid_services.
Provides an easy to use authorization policy that incorporates web security
best practices.InstallationInstall fromPyPIusingpiporeasy_installinside a virtual environment.$ $VENV/bin/pip install pyramid_authsanityOr install directly from source.$ git clone https://github.com/usingnamespace/pyramid_authsanity.git
$ cd pyramid_authsanity
$ $VENV/bin/pip install -e .SetupActivatepyramid_authsanityby including it into your pyramid application.config.include('pyramid_authsanity')2.0.0 (2021-03-07)Remove support for Python 2, 3.4, and 3.5Updated to use new Pyramid 2.0 import locations, please use 1.1.0 if you want
compatibility with lower versions of Pyramid.1.1.0 (2017-11-29)Add new Authorization header based authentication sourceThis provides out of the box support for “Bearer” like tokens.1.0.0 (2017-05-19)Remove Python 2.6 supportFix a bug whereby the policy was storing a dict instead of a list in the
source, which of course broke things subtly when actually using the policy.Send empty cookie when forgetting the authentication for the cookie source
Package: pyramid_authstack
Pyramid authentication stackThepyramid_authstackpackage makes it possible to stack multiple
authentication policies in apyramidproject.
This can be useful in several scenarios:You need to be able to identify a user for a long period of time, while
requiting a recent login to access personal information. Amazon is an
example of a site doing this.You want to send a newsletter to users and log the user in automatically when
they follow a link in the newsletter, but not give automatically give them
access to sensitive information.Confusing a multi-authentication policy is simple: create an instance
of theAuthenticationStackPolicyobject, add the authentication policies
you want to it and then tell Pyramid to use it.from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid_authstack import AuthenticationStackPolicy

auth_policy = AuthenticationStackPolicy()
# Add an authentication policy with a one-hour timeout to control
# access to sensitive information.
auth_policy.add_policy(
    'sensitive',
    AuthTktAuthenticationPolicy('secret', timeout=60 * 60))
# Add a second authentication policy with a one-year timeout so
# we can identify the user.
auth_policy.add_policy(
    'identity',
    AuthTktAuthenticationPolicy('secret', timeout=60 * 60 * 24 * 365))
config.set_authentication_policy(auth_policy)The name used for the sub-policy (sensitiveandidentityin the example
above) will be added to the principals if the sub-policy can authenticate the
user. This makes it very easy to check which authentication policies matched
in an ACL:class MyModel(object):
    # Only allow access if user authenticated recently.
    __acl__ = [(Allow, 'auth:sensitive', 'view')]When you callremember()orforget()all sub-policies will be trigged. You can filter the list
of policies used by adding apoliciesparameter. A use case where this
is important is a user coming to the site via a link in a newsletter: in
that scenario you can identify the user, but do not want to give access
to sensitive information without asking for extra credentials.from pyramid.security import remember

# Only set identity-authentication.
headers = remember(request, 'chrism', policies=['identity'])Comparison to pyramid_multiauthMozilla has a similar project:pyramid_multiauth. There are a few difference
between that package and this one:pyramid_multiauth has no way to indicate which authentication policy matched,
which makes it unusable for my uses causes unless you always use custom
authentication sub-policies which add custom an extra principal.  This could
be fixed, but it would require changing the API in a non-backward compatible
way.pyramid_multiauth duplicates some of the callback-handling code instead of
reusing pyramid’s CallbackAuthenticationPolicy.pyramid_multiauth allows configuration via the PasteDeploy .ini file, which
pyramid_authstack does not support.Changelog1.0.1 - August 10, 2013Fix use of obsolete naming in the README.Add callback parameter to constructor.1.0.0 - August 10, 2013First release.
Package: pyramid_authz
WarningThis package is still in the design/planning stage, so there is no
code available yet. Check back soon.Thepyramid_authzPython package provides helper routines to make
theauthorizationcomponent of access control easier. Note that this
package doesNOTaddressauthenticationin any way (there are
many other packages for that). Authentication is the process of
determiningwhothe request is coming from, authorization is the
process of determiningwhatthat identity is allowed to do.This package exposes a postgres-like approach to access control, which
basically means that access control is broken down into “roles” and
“privileges”.In short:APrivilegeis the permission to perform an action;ARoleis a collection of privileges;Roles can inherit from other roles;Any database object can be made to be a role; andAccess to a resource or action isalwaysbased on privileges,neveron roles, i.e. your code should always ask “does this
user have this privilege”, not “is this user a member of this
role”.For more information on postgres’ approach, please seehttp://www.postgresql.org/docs/9.0/static/user-manag.html.ProjectHomepage:https://github.com/canaryhealth/pyramid_authzBugs:https://github.com/canaryhealth/pyramid_authz/issuesInstallation$pipinstallpyramid_authzUsageRequire static privilegeuser.valid:frompyramid_authzimportprivilege# restrict the 'core' view to authenticated users@view_config(route_name='core')@privilege('user.valid')defcore(request):...Require dynamic privilege for path route/blog/{blog_id}/{page_id}which depends on which blog, which page, and what method is being
requested:frompyramid_authzimportprivilege,Method,PathParam# restrict the 'blog.page' view to users that have the blog-# and method-specific privilege@view_config(route_name='blog.page')defblog(request):blog_id=request.matchdict['blog_id']page_id=request.matchdict['page_id']priv=privilege(blog_id=blog_id,page_id=page_id,method=request.method)# checkifnotpriv.allow(request):raiseHTTPForbidden()# same as check, but also raises the exception all-in-onepriv.require(request)# same, but raise 404 instead 401/403priv.require(request,failto=HTTPNotFound)...Same thing, but using the declarative helpersPathParam(which
returns the specifiedrequest.matchdict[{PARAMNAME}]path
component) andMethod(which returns the value ofrequest.method):Method(# same thing, but specified declaratively:frompyramid_authzimportprivilege,PathParam,Method@view_config(route_name='blog.page')@privilege(blog_id=PathParam('blog_id'),page_id=PathParam('page_id'),method=RequestMethod,)defblog(request):...
Package: pyramid_autodoc
pyramid_autodocSphinx extension for documenting your Pyramid APIs.Installpipinstallpyramid_autodocGetting StartedTo usepyramid_autodocyou just need to add it to theextensionssection of your Sphinxconf.pyfile:# conf.pyextensions=[...,'pyramid_autodoc']Then just create a new.rstdocument that uses thepyramid-autodocdirective and provide the path to your Pyramid’s .ini file. Here is an example:Welcome to my Pyramid app's API docs====================================These are the best APIs in the world!..autopyramid::/path/to/development.iniThen you can just run yoursphinx-buildcommand and it will autogenerate
API documentation from your Pyramid routes and view docstrings.We also support usingsphinxcontrib-httpdomainformat, just use the:format:setting:Welcome to my Pyramid app's API docs====================================These are the best APIs in the world!..autopyramid::/path/to/development.ini:format:httpdomainIgnoring EndpointsIf you have a set of endpoints that you don’t want to group or skip entirely
there are a few options you can use::match-path:- Whitelist only a specific set of paths:skip-path:- Blacklist a specific set of paths:match-module:- Whitelist a set of modules:skip-module:- Blacklist a set of modulesWelcome to my Pyramid app's API docs====================================These are the best APIs in the world!..autopyramid::/path/to/development.ini:skip-module:^myapp.v1.*:match-path:^/dataLinking to Source CodeIf you want to link from the endpoint to the source code for the corresponding
views and you are usingsphinx.ext.viewcode, you can generate links to the
source code pages it generates.  Alternatively, if your source is on the web,
you can generate external links instead.:link-code:- Enable links from endpoints to source code.  Assumessphinx.ext.viewcodeis being used unlesslink-code-patternis specified.:link-code-pattern:- Pattern URL for generating links to source code.
Tokens in the pattern are replaced by the following values.{file}is replaced by the file path, e.g.pyramid_autodoc/utils.py.{lineno_start}is replaced by the beginning line number of the view, e.g.17.{lineno_end}is replaced by the end line number of the view, e.g.22.Welcome to my Pyramid app's API docs====================================Links to source code within the docs...autopyramid::/path/to/development.ini:link-code:Links to source code on GitHub...autopyramid::/path/to/development.ini:link-code::link-code-pattern:https://github.com/SurveyMonkey/pyramid_autodoc/blob/master/{file}#L{lineno_start}-L{lineno_end}In the last example, a generated link would look likehttps://github.com/SurveyMonkey/pyramid_autodoc/blob/master/pyramid_autodoc/utils.py#L17-L22.
Package: pyramid-auto-env
Pyramid auto envA pyramid library to help overwrite ini configs with environment variables.Getting StartedThese instructions will help you install library and use its features.Installingpip install pyramid-auto-envRunning the testsInstall test dependenciespip install -e ".[test]"Run testpytestUsingReplacing the mail.password of the inifile with environment variableINI FILE###
# app configuration
# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html
###

[app:main]
use = egg:myproject

pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en
pyramid.includes =
    pyramid_debugtoolbar

mail.password = local

# By default, the toolbar only appears for clients from IP addresses
# '127.0.0.1' and '::1'.
# debugtoolbar.hosts = 127.0.0.1 ::1

###
# wsgi server configuration
###

[server:main]
use = egg:waitress#main
listen = localhost:6543

###
# logging configuration
# https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html
###

[loggers]
keys = root, pyramid_auto_env

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = INFO
handlers = console

[logger_pyramid_auto_env]
level = INFO
handlers = console
qualname = pyramid_auto_env
propagate = 0

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s:%(lineno)s][%(threadName)s] %(message)sENVIRONMENTexport MYPROJ_MAIL_PASSWORD = S3kr3tCODEfrompyramid.configimportConfiguratorfrompyramid_auto_envimportget_env_or_ini@autoenv_settings(prefix='myproj')defmain(global_config,**settings):""" This function returns a Pyramid WSGI application."""config=Configurator(settings=settings)config.include('pyramid_jinja2')config.add_static_view('static','static',cache_max_age=3600)config.add_route('home','/')config.scan()returnconfig.make_wsgi_app()ENVVAR FormatThe environment variable lookup will search for<prefix.upper()>_<settings_name.upper().replace(['.-', '_'])>Examples (prefix=MYPROJ):host.url -> MYPROJ_HOST_URL
mail-smtp -> MYPROJ_MAIL_SMTP
my.project.super-secret -> MYPROJ_MY_PROJECT_SUPER_SECRET
Package: pyramid-autoroute
pyramid_autoroute is a package for generating pyramid routes for URL Dispath base on view location in python packages starting from predefined root module.i.e. if a view is located in views.foo.bar.baz:AView and the root_module is views
automatic path to view will be genereated as /foo/bar/baz/aviewInstallationinstall egg using pip or easy_installin your application’s configuration you must add config.include(‘pyramid_autoroute’) before config.scan()in configuration .ini file you have to add views root module:[app:myapp]
pyramid.autoroute.root_module = myapp.viewsafter launching application you will see i.e.:Auto generated routes:Name                             Pathadd3                             /myview
home3                            /my_view
add                              /abc/myview
home                             /abc/my_view
home2                            /abc/my_view2
home5                            /test_aaa/my_view1.2.0:
- Python 3 compatibility1.1.1:
- omit None values for query string params in url_for