All Projects → groveco → django-segments

groveco / django-segments

Licence: other
A segmentation engine for Django user models

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to django-segments

mmetrics
Easy computation of Marketing Metrics in R
Stars: ✭ 26 (+8.33%)
Mutual labels:  marketing-tools, marketing-analytics
ecommercetools
EcommerceTools is a Python data science toolkit for ecommerce, marketing science, and technical SEO analysis and modelling and was created by Matt Clarke.
Stars: ✭ 41 (+70.83%)
Mutual labels:  marketing-tools, marketing-analytics
Brain-Segmentation
Brain Segmentation on MRBrains18
Stars: ✭ 37 (+54.17%)
Mutual labels:  segmentation
Active-Contour-Model-Matlab
Some matlab code of Active Contour Model for image segmentation
Stars: ✭ 44 (+83.33%)
Mutual labels:  segmentation
deepseg
Chinese word segmentation in tensorflow 2.x
Stars: ✭ 23 (-4.17%)
Mutual labels:  segmentation
Sequential-patch-based-segmentation
Sequential patch-based segmentation for medical image
Stars: ✭ 20 (-16.67%)
Mutual labels:  segmentation
Brainy
Brainy is a virtual MRI analyzer. Just upload the MRI scan file and get 3 different classes of tumors detected and segmented. In Beta.
Stars: ✭ 29 (+20.83%)
Mutual labels:  segmentation
ImcSegmentationPipeline
A pixel classification based multiplexed image segmentation pipeline
Stars: ✭ 62 (+158.33%)
Mutual labels:  segmentation
PragmaticSegmenterNet
Port of PragmaticSegmenter for sentence boundary detection
Stars: ✭ 25 (+4.17%)
Mutual labels:  segmentation
crowd density segmentation
The code for preparing the training data for crowd counting / segmentation algorithm.
Stars: ✭ 21 (-12.5%)
Mutual labels:  segmentation
raygun4android
Android crash reporting provider for Raygun
Stars: ✭ 19 (-20.83%)
Mutual labels:  analytics-tracking
cellpose-napari
napari plugin for cellpose (see www.cellpose.org) - an anatomical segmentation tool
Stars: ✭ 30 (+25%)
Mutual labels:  segmentation
maskSLIC
Simple linear iterative clustering (SLIC) in a region of interest (ROI)
Stars: ✭ 28 (+16.67%)
Mutual labels:  segmentation
navis
Python 3 library for analysis of neuroanatomical data
Stars: ✭ 68 (+183.33%)
Mutual labels:  segmentation
root painter
RootPainter: Deep Learning Segmentation of Biological Images with Corrective Annotation
Stars: ✭ 28 (+16.67%)
Mutual labels:  segmentation
keras-semantic-segmentation-example
Example of semantic segmentation in Keras
Stars: ✭ 53 (+120.83%)
Mutual labels:  segmentation
UNI-EM
A unified environment for DNN-based automated segmentation of neuronal EM images
Stars: ✭ 33 (+37.5%)
Mutual labels:  segmentation
Skin Lesion Detection Deep Learning
Skin lesion detection from dermoscopic images using Convolutional Neural Networks
Stars: ✭ 48 (+100%)
Mutual labels:  segmentation
segmentation-enhanced-resunet
Urban building extraction in Daejeon region using Modified Residual U-Net (Modified ResUnet) and applying post-processing.
Stars: ✭ 34 (+41.67%)
Mutual labels:  segmentation
CAP augmentation
Cut and paste augmentation for object detection and instance segmentation
Stars: ✭ 93 (+287.5%)
Mutual labels:  segmentation

Description

The django-segments module allows you to slice and dice your Django user models into segments with Redis backed SQL queries.

Assume your Django user model has an integer primary key called 'id'.

Create a segment, and use the mixin with your user class:

from django.contrib.auth.models import AbstractUser
from segments.models import SegmentMixin

class SegmentableUser(AbstractUser, SegmentMixin):
    pass

...

u = SegmentableUser()
s = Segment(definition = "select id from %s" % SegmentableUser._meta.db_table)
s.refresh() # Run the query and save the results to Redis
print u.is_member(s)  # "True"

You can use it for targeting marketing offers at certain users, building mailing lists, identifying "good" vs. "bad" customers, and quickly adding all sorts of properties on user records into the django admin without having to write or deploy code.

For instance:

class Offer(models.Model)
    priority = models.IntegerField()
    discount = models.DecimalField()
    segment = models.ForeignKey(Segment)

    class Meta:
        ordering = ('priority', )

    @classmethod
    def get_offer_for_user(cls, user)
        for offer in cls.objects.all():
            if offer.segment.has_member(user):
                return offer

The code is thoroughly documented and tested.

Installation

To use, first install (pypi package coming soon):

pip install -e git+https://github.com/groveco/django-segments#egg=segments

Then add the following to your settings.py:

INSTALLED_APPS = (
    ...
    'segments',
)

# This is the name of the connection Segments will use to evaluate segment SQL
# Recommended to set this to a readonly DB role. Defaults to 'default'.
SEGMENTS_EXEC_CONNECTION = 'readonly'

You're ready to go!

Tests

>>> python manage.py test --settings=segments.tests.settings

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].