Skip to main content

Integrate your Pyramid app with Customer.io

License: MIT Built by these great folks! Talk to us in #pyramid on Libera.Chat IRC

Opinionated Customer.io integration

The reason this package exists is to provide sane defaults when integrating with Customer.io. Instead of chasing down event name typos and debugging why tracking does not work, you can focus on building meaningful customer relationships.

  • You never have typo-duplicated events in Customer.io, because every event name comes from a dataclass, never from a string that can be miss-typed by mistake.
  • Same for properties. Like events, properties are hardcoded as dataclasses.
  • All "special" and "reserved" events and properties are already provided, no need to chase them down in various Customer.io docs.
  • Your app never stops working if Customer.io is down, but you still get errors in your logs so you know what is going on.
  • You never forget to call flush() on the events buffer, since pyramid_customerio hooks into the request life-cycle and calls flush() at the end of the request processing.
  • You defer sending events until the entire request is processed successfully, i.e. never send events like "User added a thing" if adding the thing to DB failed at a later stage in the request life-cycle.

Getting started

Install the package:

pip install pyramid_customerio

Or if you're using Poetry:

poetry add pyramid_customerio

Include the package in your Pyramid app configuration:

config.include('pyramid_customerio')

Configure your Customer.io credentials:

customerio.tracking.site_id = <your-site-id>
customerio.tracking.api_key = <your-api-key>
customerio.tracking.region = us  # or 'eu'

Start tracking events and identifying users:

def my_view(request):
    # Track an event
    request.customerio.track(
        request.customerio.events.user_signed_up,
        {request.customerio.event_properties.path: request.path}
    )

    # Identify a user
    request.customerio.identify({
        request.customerio.profile_properties.email: 'user@example.com',
        request.customerio.profile_properties.name: 'John Doe'
    })

Development

This project uses Nix for development environment management and Poetry for Python dependency management.

Setup

# Enter the Nix development shell
nix-shell

# Install dependencies
make install

Running tests

# Run all tests with coverage
make test

# Run only unit tests
make unit

# Run specific tests
make unit filter="test_name"

Code quality

# Run linting
make lint

# Run type checking
make types

# Format code
make format

License

MIT

Metadata

Release files for pyramid_customerio 1.0.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 pyramid_customerio 1.0.0
File Size Uploaded Provenance
pyramid_customerio-1.0.0.tar.gz 14.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 31.3 kB

Release files / pyramid_customerio-1.0.0.tar.gz

Download URL pyramid_customerio-1.0.0.tar.gz
Size 14.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0883b4e2c3df9a7f9468ce2b7d9809569e1571a30c2480fee5d0f72f77b3fae6
BLAKE2b-256 checksum
How to use checksums
979c2683abbd858dc86703ea7ebed03e38bd9c67e28080320d0a7b2919c888f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.10 Darwin/24.5.0

Release files / pyramid_customerio-1.0.0-py3-none-any.whl

Download URL pyramid_customerio-1.0.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee84f702ec1c2d9f9bb1b0f78fcfb51c75bc34ed6b95cb26a787fe725ad2ab2d
BLAKE2b-256 checksum
How to use checksums
90acf3e273669978b2bb0883bee0e9e15a52eb9ce377349271349dc2a4490e11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.10 Darwin/24.5.0

Security for pyramid_customerio 1.0.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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