Skip to main content

semi server side rendered html and javascript

Project description

Latest Version Python Support

CCCP - Semi Server Side Rendered ☭

CCCP uses dominate for generation of HTML in Python but extends it with JavaScript snippets


  • Custom elements that can be rendered:
    • Function declarations for simple DOM manipulation
    • Indludes of external scripts (like jquery etc.)
  • Render function that can take a single or lists of dominate HTML elements

HTML tag manipulation using external sourcecode from GET's

CCCP currently includes the following functions:

(They all work by fetching html from a remote endpoint and manipulating a HTML tag with a given id)

  • ReplaceHtml(url, id): Lets you replace the contents of an HTML tag
  • AppendHtml(url, id): Lets you append to the end of a HTML tag
  • PrependHtml(url, id): Lets you prepend to the beginning of a HTML tag


Install from PYPI (also installs dominate):

$ pip install cccp

Import modules:

from dominate import tags as t
import cccp

Include needed definitions in HTML Head:


Use functions inside HTML to manipulate select DOM elements:

    "go to blog",
        "", "pageContent"

☝️This will replace the contents of the div "pageContent" with the HTML it GET's from ""

see examples/ for a full demo!


  • Simple functions for replacing/appending/prepending of DOM elements
  • Elements for popular js dependencies:
    • axios used for HTTP requests (performs GET requests)
    • jquery used for HTTP requests (does the DOM manipulation)
  • Error handling in bundled javascript functions
  • Simple html forms using json-schema for form validation etc
  • Implement tests
  • chartjs:
    • Element for including library
    • Functions for creating different kinds of interactive charts
  • More DOM manipulation javascript functions:
    • Function for creating a Comet call and replacing/prepending/appending incomming html to the DOM
    • Functions for deleting DOM elements
    • Functions for pulling regularily (timer interupt GET's)


  • implement simple javascript functions for DOM manipulations
  • create example using flask


  • fix bugs
  • introduce more js snippets


  • fix css snippet


  • add xkcd line chart snippet


  • drop xkcd chart and use chartjs


  • line chart take options

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

cccp-0.0.11.tar.gz (4.6 kB view hashes)

Uploaded source

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