Skip to main content

What and Why

Purpler is the beginning of a suite of tools that manage content to apply purple numbers, starting with a logging IRC bot that enables transclusion. See a blog posting for more details.

There are further plans. IRC logging is just the first part.

Use

Purpler consists of two services:

  • A WSGI application that presents logs of content: purpler.wsgi.

  • An IRC bot script that listens on configured channels: purpler-bot.

The WSGI application requires a database url to run. Provide this by create a file purpler.db_url in the working directory of the WSGI application containing something like:

mysql+pymysql://localhost/purpler?charset=utf8mb4

The IRC bot takes a complex set of configuration on the command line (run purpler-bot --help). To avoid this complexity it is possible to read configuration from a file. Here’s one way to start it:

nohup purpler-bot @purplerbot.conf --db-url=`cat purpler.db_url` &

purplerbot.conf contains entries like:

--no-log=#someprivatechannel
-c #openstack-nova
-c #openstack-sdks
-c #openstack-telemetry
-c #openstack-dev
-c #someprivatechannel

Install

Install purpler in the usual pip way:

pip install -U purpler

Also install a database driver that will work with sqlalchemy.

Web App

Configure a WSGI server to run the wsgi application. Here’s an example using mod_wsgi (you should modify this for your own requirements with regard to logging, auth, etc.):

<VirtualHost *:80>
ServerName p.anticdent.org
AllowEncodedSlashes On

WSGIDaemonProcess purpler user=cdent processes=2 threads=20 stack-size=524288 display-name=%{GROUP} maximum-requests=500
WSGIProcessGroup purpler

WSGIScriptAlias / /some/path/to/purpler/wsgi.py
</VirtualHost>

The templates used for presenting the logs exist within the purpler package. If you want custom templates set the PURPLER_TEMPLATE_PATH environment variable to a path to find overrides. CSS is inlined from a style.css template.

The Bot

See above for an example of how to start up purpler-bot. That’s just one of many ways. Other options include systemd service, supervisord or an initscript.

Code

On GitHub.

Caveats

This could charitably be described as a weekend hack so there has been limited testing of the code with proper testing.

License

Apache License, Version 2.0

Release files for purpler 0.2.0

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

Source distribution (sdist)

Source distribution for purpler 0.2.0
File Size Uploaded
purpler-0.2.0.tar.gz 14.3 kB Details

Release files / purpler-0.2.0.tar.gz

Download URL purpler-0.2.0.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5b54b8409d76dffbba28ca3f6541950cc924c413456c9b3096bd55b16db9e911
BLAKE2b-256 checksum
How to use checksums
0cf24bff5e497fe4ebe9efdb8bd84069b4331d7107d98c28a09572029221876c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file

0.1.0

1 release file

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