Skip to main content

Collection of utility functions and modules for cherrypy web servers

Project description

Overview

This is a generic utility library full of helper functions relating to cherrypy webservice routines. Included are handlers for:

  • authentication (authentication.py)
  • sqlalchemy with cherrypy (cherrypy_sqlalchemy_utils.py & database.py)
  • json parsing and constructing orm entities from json (json_utils.py)
  • timestamp (ISO and posix epoch) parsing (timestamp.py)
  • url construction and parsing from parts (similar to os.path.join) (url_utils.py)
  • ldap login utilities (login/ldap_auth.py & login/models.py)

Usage

To use this package in your project as a dependency (using pipenv), you can add it as a package with the following definition:

[packages]
cherrypy_utils = { git = "${USERNAME}:${PASSWORD}@git.mindmodeling.org:ian.davis/CherrypyUtils.git" }

You will need to export appropriate environment variables for USERNAME and PASSWORD. See this page for more info: https://pipenv.pypa.io/en/latest/advanced/#injecting-credentials-into-pipfiles-via-environment-variables Alternatively, if you save your username/password in git config, pipenv will intelligently use that if you provide the http link instead:

[packages]
cherrypy_utils = { git = "https://git.mindmodeling.org/ian.davis/CherrypyUtils.git" }

Development

This package is developed using Pipenv for package management, which makes dealing with pip packages easier. Check out more here: https://pipenv.pypa.io/en/latest/install/#using-installed-packages

It also uses pyenv to manage multiple different installed versions of python. Currently, this package targets python 3.6.8.

The package uses the black formatter and enforces a strict formatting policy, automatic formatting on save is required.

GCP Deployment

https://packaging.python.org/en/latest/tutorials/packaging-projects/ https://cloud.google.com/artifact-registry/docs/python/authentication#keyring https://cloud.google.com/artifact-registry/docs/python/manage-packages

gcloud artifacts print-settings python --project=afrl-il2-sbx-rh-mm-lab-i9sv --repository=online-experiment-python-utilities --location=us-central1

Setup requires pip packages:

  • hatchling
  • keyring
  • keyrings.google-artifactregistry-auth

Build and deploy using deploy_package_gcp.py Documentation on hatch: https://hatch.pypa.io/dev/

pip install keyring
pip install keyrings.google-artifactregistry-auth
keyring --list-backends
gcloud artifacts print-settings python --project=afrl-il2-sbx-rh-mm-lab-i9sv --repository=online-experiment-python-utilities --location=us-central1
gcloud auth login

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cherrypy_utils-1.0.48.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

cherrypy_utils-1.0.48-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file cherrypy_utils-1.0.48.tar.gz.

File metadata

  • Download URL: cherrypy_utils-1.0.48.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for cherrypy_utils-1.0.48.tar.gz
Algorithm Hash digest
SHA256 f8b2d402e7eb477221c0ad0b104ca47db8a793ff397363fffe0d91a889525bf6
MD5 b2935a3d2a2a538d4a13abd5744d4f44
BLAKE2b-256 abff46de04c0e8e7ef282113f8df25e6329b91a087f92fc54a90f6ea1458902e

See more details on using hashes here.

File details

Details for the file cherrypy_utils-1.0.48-py3-none-any.whl.

File metadata

File hashes

Hashes for cherrypy_utils-1.0.48-py3-none-any.whl
Algorithm Hash digest
SHA256 5b6b6f3d2d27ae7fc320585d9d1f8e3d46db749b9aec702b798ec20e835faec7
MD5 06262b5e3b3b01bedbc4358fc64ba939
BLAKE2b-256 b50048f42b7adf3ef86e531ff0eaa4590d98a59fae9bec93f4bda75ac464c918

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page