pyramid-helpers


Namepyramid-helpers JSON
Version 1.9.2 PyPI version JSON
download
home_pagehttps://gitlab.com/yack/pyramid-helpers
SummaryHelpers to develop Pyramid applications
upload_time2024-03-14 08:37:30
maintainer
docs_urlNone
authorCyril Lacoux
requires_python>=3.7,<4.0
licenseAGPL-3.0-or-later
keywords web wsgi pylons pyramid helpers
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pyramid-Helpers

Pyramid-Helpers is a set of helpers to develop applications using Pyramid framework.

It includes authentication, forms, i18n and pagination helpers.


## Prerequisites
The project is managed using [Poetry](https://poetry.eustace.io/docs/#installation)

### PostgreSQL adapter (Optional)
In order to use a PostgreSQL database, it is recommended to install the [psycopg](https://www.psycopg.org/) adapter. You should check the [build prerequisites](https://www.psycopg.org/docs/install.html#build-prerequisites) in order to install this package (source only).

### LDAP client (Optional)
LDAP client relies on the [python-ldap](https://www.python-ldap.org/en/latest/) client. You should check the [build prerequisites](https://www.python-ldap.org/en/latest/installing.html#build-prerequisites) in order to install this package.


## Development
```
# Create virtualenv
mkdir .venv
python3 -m venv .venv

# Activate virtualenv
source .venv/bin/activate

# Update virtualenv
pip install -U pip setuptools

# Install Poetry
pip install wheel
pip install poetry

# Install application in development mode
poetry install --extras "[api-doc] [auth-ldap] [auth-radius]"
poetry run invoke i18n.generate

# Copy and adapt conf/ directory
cp -a conf .conf

# Initialize database
phelpers-init-db .conf/application.ini

# Run web server in development mode
poetry run invoke service.httpd --config-uri=.conf/application.ini --env=.conf/environment

# Run static and functional tests:
poetry run invoke test
```

## Tests
### Static code validation
```
# ESLint
poetry run invoke test.eslint

# flake8
poetry run invoke test.flake8

# pylint
poetry run invoke test.pylint

# All
poetry run invoke test.static
```

### Functional tests
```
# Validators
poetry run invoke test.functional --test='tests/test_01_validators.py'

# Forms
poetry run invoke test.functional --test='tests/test_02_forms.py'

# Authentication client
poetry run invoke test.functional --test='tests/test_10_auth_client.py'

# LDAP client
poetry run invoke test.functional --test='tests/test_11_ldap_client.py'

# RADIUS client
poetry run invoke test.functional --test='tests/test_12_radius_client.py'

# Common views
poetry run invoke test.functional --test='tests/test_50_common_views.py'

# API views
poetry run invoke test.functional --test='tests/test_51_api_views.py'

# Articles views
poetry run invoke test.functional --test='tests/test_52_articles_views.py'

# All
poetry run invoke test.functional
```


## I18n
Extract messages
```
poetry run invoke i18n.extract i18n.update
```

Compile catalogs and update JSON files
```
poetry run invoke i18n.generate
```

Create new language
```
poetry run invoke i18n.init {locale_name}
```


## Installation

```
pip install pyramid-helpers

# And optionally:
phelpers-init-db conf/application.ini
```


## Files list

```
.
├── .coveragerc                         Coverage configuration file
├── .eslintrc.json                      ESLint configuration file
├── babel.cfg                           Babel configuration file (i18n)
├── CHANGES.md
├── pylintrc                            Pylint configuration file
├── pyproject.toml                      Poetry configuration file
├── README.md                           This file
├── setup.cfg
├── conf
│   ├── application.ini                 main configuration file
│   ├── auth.ini                        authentication configuration
│   ├── ldap.ini                        LDAP configuration file (auth)
│   └── radius.ini                      RADIUS configuration file (auth)
├── pyramid_helpers
│   ├── __init__.py                     initialization
│   ├── api_doc.py                      API documentation helper
│   ├── auth.py                         authentication helper
│   ├── ldap.py                         LDAP client
│   ├── models.py                       SQLAlchemy model for demo app
│   ├── paginate.py                     pagination class, decorator and setup
│   ├── predicates.py                   custom route predicates (Enum, Numeric)
│   ├── radius.py                       RADIUS client
│   ├── resources.py                    basic resource file for demo app
│   ├── forms
│   │   ├── __init__.py                 form class, decorator and setup, largely inspired from formhelpers[1]
│   │   ├── articles.py                 formencode schemas for articles for demo app
│   │   ├── auth.py                     formencode schema for authentication for demo app
│   │   └── validators.py               various formencode validators
│   ├── funcs
│   │   └── articles.py                 functions for articles management
│   ├── i18n.py                         i18n setup and helpers
│   ├── locale
│   │   ├── fr
│   │   │   └── LC_MESSAGES
│   │   │       └── pyramid-helpers.po
│   │   └── pyramid-helpers.pot
│   ├── scripts
│   │   └── initializedb.py             script for database initialization
│   ├── static
│   │   ├── css
│   │   │   ├── api-doc-bs3.css         javascript code for API documentation (Bootstrap 3)
│   │   │   ├── api-doc-bs4.css         javascript code for API documentation (Bootstrap 4)
│   │   │   ├── api-doc-bs5.css         javascript code for API documentation (Bootstrap 5)
│   │   │   └── pyramid-helpers.css     stylesheet for demo app
│   │   └── js
│   │       ├── api-doc.js              javascript code for API documentation
│   │       └── pyramid-helpers.js      javascript code for demo app
│   ├── templates                       Mako templates
│   │   ├── articles                    Mako templates for demo app
│   │   │   ├── edit.mako
│   │   │   ├── index.mako
│   │   │   └── view.mako
│   │   ├── confirm.mako
│   │   ├── errors.mako
│   │   ├── form-tags.mako              Mako template for forms rendering - derivates from formhelpers[1]
│   │   ├── login.mako
│   │   ├── paginate.mako               Mako template for pagination rendering
│   │   ├── site.mako                   Main template for demo app
│   │   └── validators.mako             Mako template to test validators
│   └── views                           views for demo app
│       ├── api
│       │   └── articles.py
│       └── articles.py
├── tasks                               Invoke tasks
│   ├── __init__.py                     initialization
│   ├── common.py                       common file
│   ├── i18n.py                         i18n tasks
│   ├── service.py                      service tasks
│   └── test.py                         test tasks
└── tests                               functional tests (pytest)
    ├── conftest.py                     configuration file for pytest
    ├── test_01_validators.py           test functions for forms validators
    ├── test_02_forms.py                test functions for forms
    ├── test_03_utils.py                test functions for utilities
    ├── test_10_auth_client.py          test functions for authentication
    ├── test_11_ldap_client.py          test functions for LDAP client
    ├── test_12_radius_client.py        test functions for radius client
    ├── test_50_common_views.py         test functions for common views
    ├── test_51_api_views.py            test functions for articles API
    └── test_52_articles_views.py       test functions for articles views
```


## Useful documentation

* https://docs.pylonsproject.org/projects/pyramid/en/latest/
* https://docs.pylonsproject.org/projects/pyramid/en/latest/#api-documentation
* https://techspot.zzzeek.org/2008/07/01/better-form-generation-with-mako-and-pylons/

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/yack/pyramid-helpers",
    "name": "pyramid-helpers",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "web,wsgi,pylons,pyramid,helpers",
    "author": "Cyril Lacoux",
    "author_email": "clacoux@easter-eggs.com",
    "download_url": "https://files.pythonhosted.org/packages/88/11/78471daf3bfc60c44faf167f29870be934985ff767ebb9ac7c4db7637925/pyramid_helpers-1.9.2.tar.gz",
    "platform": null,
    "description": "# Pyramid-Helpers\n\nPyramid-Helpers is a set of helpers to develop applications using Pyramid framework.\n\nIt includes authentication, forms, i18n and pagination helpers.\n\n\n## Prerequisites\nThe project is managed using [Poetry](https://poetry.eustace.io/docs/#installation)\n\n### PostgreSQL adapter (Optional)\nIn order to use a PostgreSQL database, it is recommended to install the [psycopg](https://www.psycopg.org/) adapter. You should check the [build prerequisites](https://www.psycopg.org/docs/install.html#build-prerequisites) in order to install this package (source only).\n\n### LDAP client (Optional)\nLDAP client relies on the [python-ldap](https://www.python-ldap.org/en/latest/) client. You should check the [build prerequisites](https://www.python-ldap.org/en/latest/installing.html#build-prerequisites) in order to install this package.\n\n\n## Development\n```\n# Create virtualenv\nmkdir .venv\npython3 -m venv .venv\n\n# Activate virtualenv\nsource .venv/bin/activate\n\n# Update virtualenv\npip install -U pip setuptools\n\n# Install Poetry\npip install wheel\npip install poetry\n\n# Install application in development mode\npoetry install --extras \"[api-doc] [auth-ldap] [auth-radius]\"\npoetry run invoke i18n.generate\n\n# Copy and adapt conf/ directory\ncp -a conf .conf\n\n# Initialize database\nphelpers-init-db .conf/application.ini\n\n# Run web server in development mode\npoetry run invoke service.httpd --config-uri=.conf/application.ini --env=.conf/environment\n\n# Run static and functional tests:\npoetry run invoke test\n```\n\n## Tests\n### Static code validation\n```\n# ESLint\npoetry run invoke test.eslint\n\n# flake8\npoetry run invoke test.flake8\n\n# pylint\npoetry run invoke test.pylint\n\n# All\npoetry run invoke test.static\n```\n\n### Functional tests\n```\n# Validators\npoetry run invoke test.functional --test='tests/test_01_validators.py'\n\n# Forms\npoetry run invoke test.functional --test='tests/test_02_forms.py'\n\n# Authentication client\npoetry run invoke test.functional --test='tests/test_10_auth_client.py'\n\n# LDAP client\npoetry run invoke test.functional --test='tests/test_11_ldap_client.py'\n\n# RADIUS client\npoetry run invoke test.functional --test='tests/test_12_radius_client.py'\n\n# Common views\npoetry run invoke test.functional --test='tests/test_50_common_views.py'\n\n# API views\npoetry run invoke test.functional --test='tests/test_51_api_views.py'\n\n# Articles views\npoetry run invoke test.functional --test='tests/test_52_articles_views.py'\n\n# All\npoetry run invoke test.functional\n```\n\n\n## I18n\nExtract messages\n```\npoetry run invoke i18n.extract i18n.update\n```\n\nCompile catalogs and update JSON files\n```\npoetry run invoke i18n.generate\n```\n\nCreate new language\n```\npoetry run invoke i18n.init {locale_name}\n```\n\n\n## Installation\n\n```\npip install pyramid-helpers\n\n# And optionally:\nphelpers-init-db conf/application.ini\n```\n\n\n## Files list\n\n```\n.\n\u251c\u2500\u2500 .coveragerc                         Coverage configuration file\n\u251c\u2500\u2500 .eslintrc.json                      ESLint configuration file\n\u251c\u2500\u2500 babel.cfg                           Babel configuration file (i18n)\n\u251c\u2500\u2500 CHANGES.md\n\u251c\u2500\u2500 pylintrc                            Pylint configuration file\n\u251c\u2500\u2500 pyproject.toml                      Poetry configuration file\n\u251c\u2500\u2500 README.md                           This file\n\u251c\u2500\u2500 setup.cfg\n\u251c\u2500\u2500 conf\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 application.ini                 main configuration file\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 auth.ini                        authentication configuration\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 ldap.ini                        LDAP configuration file (auth)\n\u2502   \u2514\u2500\u2500 radius.ini                      RADIUS configuration file (auth)\n\u251c\u2500\u2500 pyramid_helpers\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 __init__.py                     initialization\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 api_doc.py                      API documentation helper\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 auth.py                         authentication helper\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 ldap.py                         LDAP client\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 models.py                       SQLAlchemy model for demo app\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 paginate.py                     pagination class, decorator and setup\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 predicates.py                   custom route predicates (Enum, Numeric)\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 radius.py                       RADIUS client\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 resources.py                    basic resource file for demo app\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 forms\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 __init__.py                 form class, decorator and setup, largely inspired from formhelpers[1]\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 articles.py                 formencode schemas for articles for demo app\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 auth.py                     formencode schema for authentication for demo app\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 validators.py               various formencode validators\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 funcs\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 articles.py                 functions for articles management\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 i18n.py                         i18n setup and helpers\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 locale\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 fr\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 LC_MESSAGES\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0     \u2514\u2500\u2500 pyramid-helpers.po\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 pyramid-helpers.pot\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 scripts\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 initializedb.py             script for database initialization\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 static\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 css\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 api-doc-bs3.css         javascript code for API documentation (Bootstrap 3)\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 api-doc-bs4.css         javascript code for API documentation (Bootstrap 4)\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 api-doc-bs5.css         javascript code for API documentation (Bootstrap 5)\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 pyramid-helpers.css     stylesheet for demo app\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 js\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0  \u00a0\u00a0 \u251c\u2500\u2500 api-doc.js              javascript code for API documentation\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0  \u00a0\u00a0 \u2514\u2500\u2500 pyramid-helpers.js      javascript code for demo app\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 templates                       Mako templates\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 articles                    Mako templates for demo app\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 edit.mako\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 index.mako\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 view.mako\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 confirm.mako\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 errors.mako\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 form-tags.mako              Mako template for forms rendering - derivates from formhelpers[1]\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 login.mako\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 paginate.mako               Mako template for pagination rendering\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 site.mako                   Main template for demo app\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 validators.mako             Mako template to test validators\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 views                           views for demo app\n\u2502\u00a0\u00a0  \u00a0\u00a0 \u251c\u2500\u2500 api\n\u2502\u00a0\u00a0  \u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 articles.py\n\u2502\u00a0\u00a0     \u2514\u2500\u2500 articles.py\n\u251c\u2500\u2500 tasks                               Invoke tasks\n\u2502 \u00a0 \u251c\u2500\u2500 __init__.py                     initialization\n\u2502 \u00a0 \u251c\u2500\u2500 common.py                       common file\n\u2502 \u00a0 \u251c\u2500\u2500 i18n.py                         i18n tasks\n\u2502 \u00a0 \u251c\u2500\u2500 service.py                      service tasks\n\u2502 \u00a0 \u2514\u2500\u2500 test.py                         test tasks\n\u2514\u2500\u2500 tests                               functional tests (pytest)\n    \u251c\u2500\u2500 conftest.py                     configuration file for pytest\n    \u251c\u2500\u2500 test_01_validators.py           test functions for forms validators\n    \u251c\u2500\u2500 test_02_forms.py                test functions for forms\n    \u251c\u2500\u2500 test_03_utils.py                test functions for utilities\n    \u251c\u2500\u2500 test_10_auth_client.py          test functions for authentication\n    \u251c\u2500\u2500 test_11_ldap_client.py          test functions for LDAP client\n    \u251c\u2500\u2500 test_12_radius_client.py        test functions for radius client\n    \u251c\u2500\u2500 test_50_common_views.py         test functions for common views\n    \u251c\u2500\u2500 test_51_api_views.py            test functions for articles API\n    \u2514\u2500\u2500 test_52_articles_views.py       test functions for articles views\n```\n\n\n## Useful documentation\n\n* https://docs.pylonsproject.org/projects/pyramid/en/latest/\n* https://docs.pylonsproject.org/projects/pyramid/en/latest/#api-documentation\n* https://techspot.zzzeek.org/2008/07/01/better-form-generation-with-mako-and-pylons/\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0-or-later",
    "summary": "Helpers to develop Pyramid applications",
    "version": "1.9.2",
    "project_urls": {
        "Homepage": "https://gitlab.com/yack/pyramid-helpers",
        "Repository": "https://gitlab.com/yack/pyramid-helpers"
    },
    "split_keywords": [
        "web",
        "wsgi",
        "pylons",
        "pyramid",
        "helpers"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2e1e146552480c314816af8c451c0eb884a38f5baeb4bc5277b4e106c021e219",
                "md5": "bb373836298e7727689c3ea858ad3f96",
                "sha256": "b77364645f09a77a6f3d26f0abdbb2126911a677af1c4c835768ad74d0ff39c5"
            },
            "downloads": -1,
            "filename": "pyramid_helpers-1.9.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bb373836298e7727689c3ea858ad3f96",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 123444,
            "upload_time": "2024-03-14T08:37:28",
            "upload_time_iso_8601": "2024-03-14T08:37:28.316898Z",
            "url": "https://files.pythonhosted.org/packages/2e/1e/146552480c314816af8c451c0eb884a38f5baeb4bc5277b4e106c021e219/pyramid_helpers-1.9.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "881178471daf3bfc60c44faf167f29870be934985ff767ebb9ac7c4db7637925",
                "md5": "acdd29ee36fb1271735533d8d324aaba",
                "sha256": "8381b3b273392ecc26ea274ba2e6446f66f71ff9ca905bc7dcdd9a4c099500d6"
            },
            "downloads": -1,
            "filename": "pyramid_helpers-1.9.2.tar.gz",
            "has_sig": false,
            "md5_digest": "acdd29ee36fb1271735533d8d324aaba",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 85409,
            "upload_time": "2024-03-14T08:37:30",
            "upload_time_iso_8601": "2024-03-14T08:37:30.564967Z",
            "url": "https://files.pythonhosted.org/packages/88/11/78471daf3bfc60c44faf167f29870be934985ff767ebb9ac7c4db7637925/pyramid_helpers-1.9.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-14 08:37:30",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "yack",
    "gitlab_project": "pyramid-helpers",
    "lcname": "pyramid-helpers"
}
        
Elapsed time: 0.32509s