dryxPyramid

https://img.shields.io/pypi/pyversions/dryxPyramid https://img.shields.io/pypi/v/dryxPyramid https://img.shields.io/github/license/thespacedoctor/dryxPyramid https://img.shields.io/pypi/dm/dryxPyramid

http://157.245.42.153:8080/buildStatus/icon?job=dryxPyramid%2Fmaster&subject=build%20master http://157.245.42.153:8080/buildStatus/icon?job=dryxPyramid%2Fdevelop&subject=build%20dev https://cdn.jsdelivr.net/gh/thespacedoctor/dryxPyramid@master/coverage.svg https://readthedocs.org/projects/dryxPyramid/badge/?version=master https://img.shields.io/github/issues/thespacedoctor/dryxPyramid/type:%20bug?label=bug%20issues

basic, reusable code for pyramid webapps.

Documentation for dryxPyramid is hosted by Read the Docs (development version and master version). The code lives on github. Please report any issues you find here.

Features

Installation

The easiest way to install dryxPyramid is to use pip (here we show the install inside of a conda environment):

conda create -n dryxPyramid python=3.7 pip
conda activate dryxPyramid
pip install dryxPyramid

Or you can clone the github repo and install from a local version of the code:

git clone git@github.com:thespacedoctor/dryxPyramid.git
cd dryxPyramid
python setup.py install

To upgrade to the latest version of dryxPyramid use the command:

pip install dryxPyramid --upgrade

To check installation was successful run dryxPyramid -v. This should return the version number of the install.

Development

If you want to tinker with the code, then install in development mode. This means you can modify the code from your cloned repo:

git clone git@github.com:thespacedoctor/dryxPyramid.git
cd dryxPyramid
python setup.py develop

Pull requests are welcomed!

Initialisation

Before using dryxPyramid you need to use the init command to generate a user settings file. Running the following creates a yaml settings file in your home folder under ~/.config/dryxPyramid/dryxPyramid.yaml:

dryxPyramid init

The file is initially populated with dryxPyramid’s default settings which can be adjusted to your preference.

If at any point the user settings file becomes corrupted or you just want to start afresh, simply trash the dryxPyramid.yaml file and rerun dryxPyramid init.

Modifying the Settings

Once created, open the settings file in any text editor and make any modifications needed.

Basic Python Setup

If you plan to use dryxPyramid in your own scripts you will first need to parse your settings file and set up logging etc. One quick way to do this is to use the fundamentals package to give you a logger, a settings dictionary and a database connection (if connection details given in settings file):

## SOME BASIC SETUP FOR LOGGING, SETTINGS ETC
from fundamentals import tools
from os.path import expanduser
home = expanduser("~")
settingsFile  = home + "/.config/dryxPyramid/dryxPyramid.yaml"
su = tools(
    arguments={"settingsFile": settingsFile},
    docString=__doc__,
)
arguments, settings, log, dbConn = su.setup()

Todo List

Todo

  • nice!

(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/dryxpyramid/checkouts/develop/docs/source/_template_.md, line 1.)

Release Notes

v0.4.5 - June 15, 2022

  • FIXED - removing tests from release

v0.4.3 - May 10, 2022

  • FIXED - fixing docs

v0.4.2 - December 11, 2020

  • FIXED - doc dependencies

v0.4.1 - June 24, 2020

  • enhancements - added some tweaks for the python 3 version of webapps

v0.4.0 - May 25, 2020

  • Now compatible with Python 3.*

API Reference

Classes

dryxPyramid.models.models_base.base_model

A superclass model for pyramid apps

dryxPyramid.models.models_login_post.RootFactory

dryxPyramid.renderers.renderer_csv

The CSV renderer - can return plain text in browser or a file to download

dryxPyramid.renderers.renderer_json

The json renderer - can return content to browser or a file to download

dryxPyramid.renderers.renderer_plain_table

The plain_table renderer - can return content to browser or a file to download

dryxPyramid.renderers.renderer_plain_text

The plain_text renderer - can return content to browser or a file to download

dryxPyramid.templates.responses.templates_download

The worker class for the templates_download module

dryxPyramid.templates.responses.templates_login

The worker class for the templates_login module

dryxPyramid.views.views_base.base_view

The base view that can be used for any API resource

dryxPyramid.views.views_base_element.base_element_view

dryxPyramid.views.views_download.download_view

dryxPyramid.views.views_login.login_view

Functions

dryxPyramid.security.get_users_and_groups

Get the users and groups from the database

dryxPyramid.security.groupfinder

*If the userid exists in the system, it will return a sequence of group identifiers (or an empty sequence if the user isn’t a member of any groups).

dryxPyramid.views.views_login.forbidden

dryxPyramid.views.views_logout.logout

A-Z Index

Modules

dryxPyramid.models

dryxPyramid.renderers

dryxPyramid.templates

dryxPyramid.templates.responses

dryxPyramid.views

dryxPyramid.models.models_base

The base model for other model modules to build on top of

dryxPyramid.models.models_login_post

dryxPyramid.security

dryxPyramid.views.views_base

dryxPyramid.views.views_base_element

dryxPyramid.views.views_download

dryxPyramid.views.views_login

dryxPyramid.views.views_logout

Classes

dryxPyramid.models.models_base.base_model

A superclass model for pyramid apps

dryxPyramid.models.models_login_post.RootFactory

dryxPyramid.renderers.renderer_csv

The CSV renderer - can return plain text in browser or a file to download

dryxPyramid.renderers.renderer_json

The json renderer - can return content to browser or a file to download

dryxPyramid.renderers.renderer_plain_table

The plain_table renderer - can return content to browser or a file to download

dryxPyramid.renderers.renderer_plain_text

The plain_text renderer - can return content to browser or a file to download

dryxPyramid.templates.responses.templates_download

The worker class for the templates_download module

dryxPyramid.templates.responses.templates_login

The worker class for the templates_login module

dryxPyramid.views.views_base.base_view

The base view that can be used for any API resource

dryxPyramid.views.views_base_element.base_element_view

dryxPyramid.views.views_download.download_view

dryxPyramid.views.views_login.login_view

Functions

dryxPyramid.security.get_users_and_groups

Get the users and groups from the database

dryxPyramid.security.groupfinder

*If the userid exists in the system, it will return a sequence of group identifiers (or an empty sequence if the user isn’t a member of any groups).

dryxPyramid.views.views_login.forbidden

dryxPyramid.views.views_logout.logout

Release Notes

v0.4.5 - June 15, 2022

  • FIXED - removing tests from release

v0.4.3 - May 10, 2022

  • FIXED - fixing docs

v0.4.2 - December 11, 2020

  • FIXED - doc dependencies

v0.4.1 - June 24, 2020

  • enhancements - added some tweaks for the python 3 version of webapps

v0.4.0 - May 25, 2020

  • Now compatible with Python 3.*