Skip to main content

CCDCOE package

GitHub Release GPLv3 License

This package contains generic re-usable code.

Install the full package:

pip install ccdcoe[all]

This package has several modules which can be installed separately by specifying them as an extra requirement. To install the http_apis module only, specify:

pip install ccdcoe[http_apis]

Or for multiple modules:

pip install ccdcoe[http_apis, loggers]

Command line interface

The ccdcoe package contains a cli application for providentia/gitlab communication and controlling the vm deployment pipelines; if this is the only thing you would like to use from the package please run:

pip install ccdcoe[cli_code]

After the installation run ccdcoe from the command line and have a look at the help section for the available commands.

The settings for the cli are controlled from a .env file located at ~/.ccdcoe/.env and has the following defaults which are put there when you first run the application:

TRIGGER_TOKEN=<<MANDATORY_VALUE>>
PAT_TOKEN=<<MANDATORY_VALUE>>
GITLAB_URL=<<MANDATORY_VALUE>>
NEXUS_HOST=<<MANDATORY_VALUE>>
PROVIDENTIA_URL=<<MANDATORY_VALUE>>
PROVIDENTIA_TOKEN=<<MANDATORY_VALUE>>
PROJECT_ROOT=<<MANDATORY_VALUE>>
PROJECT_VERSION=<<MANDATORY_VALUE>>

These settings are, like you can see, all mandatory. Consult ccdcoe/deployments/deployment_config.py for more, optional, settings.

The CLI application supports tab completion; for bash add eval "$(_CCDCOE_COMPLETE=bash_source ccdcoe)" to your .bashrc to activate the tab completion. Or you could save the output of the following command as a script somewhere _FOO_BAR_COMPLETE=bash_source foo-bar > ~/.foo-bar-complete.bash and source that file in your .bashrc like so: . ~/.foo-bar-complete.bash

Other shells (Zsh, Fish) are supported as well; please check the click documentation

Examples

Example for BT28, deploying up to tier 7 on branch cicd-update:

ccdcoe deploy tier --level 7 -b cicd-update -t 28

Example for BT24, deploying just tier 4 on branch cicd-update:

ccdcoe deploy tier --limit 4 -b cicd-update -t 24

You can exclude hosts from the pipeline deployment:

ccdcoe deploy tier --limit 4 -t 24 --skip_hosts host1,host2,host3

^ Will deploy tier4 for BT24 except host1,host2,host3

Or you can deploy only some selected hosts:

ccdcoe deploy tier --limit 4 -t 24 --only_hosts host1,host2,host3

^ Will deploy only host1,host2,host3 from tier4 for BT24

Adding modules and/or groups

Everything for this package is defined in the pyproject.toml file. Dependencies are managed by poetry and grouped in, you guessed it, groups. Every poetry group can be installed as an extra using pip.

Extra extras or group on group/extra dependencies can also be defined in the [tool.ccdcoe.group.dependencies] section. Everything defined here will also become an extra if no group already exists. You can use everything defined here as dependency for another group, order does not matter.

example:

[tool.ccdcoe.group.dependencies]
my_awesome_extra = ["my_awesome_group", "my_other_group"]
my_awesome_group = ["my_logging_group"]

[tool.poetry.group.my_awesome_group.dependencies]
<dependency here>

[tool.poetry.group.my_other_group.dependencies]
<dependency here>

[tool.poetry.group.my_logging_group.dependencies]
<dependency here>

Using this example the following extras exist with the correct dependencies:

pip install ccdcoe[all]
pip install ccdcoe[my-awesome-extra]
pip install ccdcoe[my-awesome-group]
pip install ccdcoe[my-other-group]
pip install ccdcoe[my-logging-group]

Modules

The following modules are available in the ccdcoe package:

  • http_apis
  • loggers
  • dumpers
  • deployments
  • cli
  • redis_cache
  • flask_managers
  • flask_middleware
  • flask_plugins
  • auth
  • sso
  • plugins
  • sql_migrations

HTTP apis

Baseclass for http api communication is present under ccdcoe.http_apis.base_class.api_base_class.ApiBaseClass

Loggers

There are three loggers provided:

  • ConsoleLogger (ccdcoe.loggers.app_logger.ConsoleLogger)
  • AppLogger (ccdcoe.loggers.app_logger.AppLogger)
  • GunicornLogger (ccdcoe.loggers.app_logger.GunicornLogger)

The ConsoleLogger is intended as a loggerClass for cli applications.

The AppLogger is intended to be used as a loggerClass to be used for the standard python logging module.

import logging
from ccdcoe.loggers.app_logger import AppLogger

logging.setLoggerClass(AppLogger)

mylogger = logging.getLogger(__name__)

The 'mylogger' instance has all the proper formatting and handlers (according to the desired config) to log messages.

The Gunicorn logger is intended to be used for as a loggerClass for the gunicorn webserver; it enables the FlaskAppManager to set the necessary formatting and handles according to the AppLogger specs and a custom format for the gunicorn access logging.

Flask app manager

The FlaskAppManager is intended to be used to 'run' flask applications in both test, development as in production environments.

from YADA import app
from ccdcoe.flask_managers.flask_app_manager import FlaskAppManager

fam = FlaskAppManager(version="1.0", app=app)
fam.run()

Depending on the configuration the FlaskAppManager uses a werkzeug (DEBUG == True) or a gunicorn webserver. TLS could be set for both webservers iaw the module specific README.md.

SQL Migrations

The sql migrations can be used to facilitate migration between different versions of sql models / versions. It relies on flask migrate to perform the different migrations. It has a CLI as well as an python class based API.

Check the command line help

python3 -m ccdcoe.sql_migrations.flask_sql_migrate -a /path/to/script_with_flask_app.py -i
python3 -m ccdcoe.sql_migrations.flask_sql_migrate -a /path/to/script_with_flask_app.py -m
python3 -m ccdcoe.sql_migrations.flask_sql_migrate -a /path/to/script_with_flask_app.py -u

Or initiate the FlaskSqlMigrate as a class and initiate the migration process from there:

from ccdcoe.sql_migrations.flask_sql_migrate import FlaskSqlMigrate
fsm = FlaskSqlMigrate(app_ref="/path/to/script_with_flask_app.py")

fsm.db_init()
fsm.db_migrate()
fsm.db_update()

Metadata

Release files for ccdcoe 0.0.63

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ccdcoe 0.0.63
File Size Uploaded
ccdcoe-0.0.63.tar.gz 128.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ccdcoe 0.0.63
File Interpreter ABI Platform
ccdcoe-0.0.63-py3-none-any.whl Python 3 none any Details

Total release size: 268.0 kB

Release files / ccdcoe-0.0.63.tar.gz

Download URL ccdcoe-0.0.63.tar.gz
Size 128.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fd5e6bf9e1fee0fe958ba50edd3c0d9214f624702ad05d5aed435df708d03acc
BLAKE2b-256 checksum
How to use checksums
38cdc93ae68bac7fa2f13ec88392cd9492b124373a36fd01c912ee2153567f0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 26, 2026.

Transparency log

Release files / ccdcoe-0.0.63-py3-none-any.whl

Download URL ccdcoe-0.0.63-py3-none-any.whl
Size 139.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9657e8a35ddc2319c97e958e2d7aff208b91b01e42eabdd5dc8df2aa5e82af8
BLAKE2b-256 checksum
How to use checksums
1f928d18d4f2e80b4edcc3d9198007bb3b6082f73307ad87bc6bb0feab9f080f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.63 This release

2 release files

0.0.60

2 release files

0.0.59

2 release files

0.0.58

2 release files

0.0.57

2 release files

0.0.56

2 release files

0.0.55

2 release files

0.0.54

2 release files

0.0.53

2 release files

0.0.51

2 release files

0.0.46

2 release files

0.0.45

2 release files

0.0.44

2 release files

0.0.43

2 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.34

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.30

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page