semvec/pypi-packages huggingface dataset:
pwt.jinja2js 0.8.1
pwt.jinja2js is an extension to the Jinja2 template engine that compiles
valid Jinja2 templates containing macros to JavaScript. The JavaScript output
can be included via script tags or can be added to the applications JavaScript.
License: BSD

About
=====

pwt.jinja2js is an extension to the Jinja2 template engine that compiles
valid Jinja2 templates containing macros to JavaScript. The JavaScript output
can be included via script tags or can be added to the applications JavaScript.

Nutshell
--------

Here a small example of a Jinja template::

     {% namespace ns1 %}

     {% macro printusers(users) %}
     <ul>
     {% for user in users %}
         <li><a href="{{ user.url }}">{{ user.username }}</a></li>
     {% endfor %}
     </ul>
     {% endmacro %}


Which after running through the pwt.jinja2js compiler we need up the
following JavaScript::

     if (typeof ns1 == 'undefined') { var ns1 = {}; }

     ns1.printusers = function(opt_data, opt_sb, opt_caller) {
        var output = '';
        output += '\n<ul>\n';
        var userList = opt_data.users;
        var userListLen = userList.length;
        for (var userIndex = 0; userIndex < userListLen; userIndex++) {
            var userData = userList[userIndex];
            output += '\n   <li><a href="' + userData.url + '">' + userData.username + '</a></li>\n';
        }
        output += '\n</ul>\n';
        return output;
     }

By slipping a switch we can produce Java Script that takes advantage of
`Closure Library`_::

     goog.provide('ns1');

     goog.require('soy');

     ns1.printusers = function(opt_data, opt_sb) {
        var output = opt_sb || new soy.StringBuilder();
        output.append('\n<ul>\n');
        var userList = opt_data.users;
        var userListLen = userList.length;
        for (var userIndex = 0; userIndex < userListLen; userIndex++) {
            var userData = userList[userIndex];
            output.append('\n   <li><a href="', userData.url, '">', userData.username, '</a></li>\n');
        }
        output.append('\n</ul>\n');
        if (!opt_sb) return output.toString();
     }

More user documentation is available on the `pwt.jinja2js PyPI package page`_.
The `Jinja2`_ site is also available to learn more about the Jinja2 syntax.

.. _Closure Library: http://code.google.com/closure/library/
.. _pwt.jinja2js PyPI package page: http://packages.python.org/pwt.jinja2js/
.. _Jinja2: http://jinja.pocoo.org/docs/

Devloper information
====================

In order to get started with this project and to see what it can do:

 * git clone git://github.com/mkerrin/pwt.jinja2js.git
 * cd pwt.jinja2js
 * python bootstrap
 * ./bin/buildout

Testing
=======

To run the tests run

 * ./bin/test -v

To run a basic server in order to run the JavaScript tests.

 * ./bin/serve --reload

To run the JavaScript tests open a browser and load the url::

  http://localhost:8000/

There is links to two test suites from there.
pwt.closure 0.2
pwt.closure is a tool to compile and manage JavaScript dependencies of your
web application.
License: BSD

pwt.closure is Python package that provides the tools to compile and manage
JavaScript files. It is optimized to be used with the Closure Library to find
your web application JavaScript dependencies. It then uses the Closure
Compiler to concatenate and compile all your JavaScript to JavaScript that
is optimized for production.

pwt.closure contains a command line tool, a WSGI application and integration
with zc.buildout. All are configured through the same .ini file. The WSGI
application is suited for developing JavaScript heavy applications and is
used manly for development. Once development is finished you can use the
command line tool to optimize the application by compiling all your JavaScript
into one optimized file. Or you can integrate the process with zc.buildout.
django-funkymetrics 0.1.9
Super simple Django application for easily tracking events and submitting them asynchronously to KISSmetrics.
License: BSD

# django-funkymetrics

django-funkymetrics is a super simple Django application for easily tracking events and submit them asynchronously to KISSmetrics using celery tasks.

## Features

* Track app events easily
* Submits analytics events asynchronously to KISSmetrics

## Installation

Add the KISSmetrics JS snippet to your project template(s).

Install `django-funkymetrics`:

    pip install django-funkymetrics

Alternatively, download the source code and manually add it to your `PYTHONPATH`.

Set your KISSmetrics API key:

    KISS_API_KEY = '<your_api_key>'

Track events and profit.

## Prerequisites

The library assumes that Celery is installed and configured for the Django project. Tasks are automatically created for each `record_event`.

## Usage

Simply import `record_event` in your code where you want to track events, and call it as needed:

    from funkymetrics.events import record_event
    
    # Without properties
    record_event(request, 'downgraded')
    
    # With properties
    record_event(request, 'upgraded plan', {'to_plan': 'Standard'})

The request object is used to identify the user the event is associated with.

When the request isn't available, a user instance can be passed instead. Note that we can't extract the anonymous KISSmetrics identifier from the user object, so it doesn't really make sense to pass anonymous users.

## Identifying users

Anonymous users are identified by their KISSmetrics anonymous ID (ie. the value of the `km_ai` cookie).

Authenticated users are identified by their username.

## Future stuff

* Overriding user identifiers
* Queue events locally and submit in batches