=================
Aggregate, String and Conditional SQL functions to use into Annotate and Aggregate methods. Any kind of contribitions and ideas are welcome.
Installation
=================
pip install django-aggregates
Usage
=================
>> from aggregates import StringAgg
>> People.objects.aggregate(names=StringAgg('name', delimiter(', ')))
>> {'names': 'Walter, The Dude, Donny, Jesus'}
>> from aggregates import As
>> People.objects.values('address__title').annotate(prettyname=As('address__title')).values('prettyname')
>> [{'prettyname': 'someadress1'}, {'prettyname': 'someaddress2'}]
>> from aggregates.strings import CharLength
>> People.objects.annotate(char_len=CharLength('name')).filter(char_len__gt=6)
>> [<People: Walter>, <People: The Dude>]
>> from aggregates.conditionals import Coalesce, NullIf
>> person=People.objects.annotate(null_if=NullIf('name', othercol='surname'))[0]
>> person.null_if
>> 'Walter'
>> person=People.objects.annotate(coalesce=Coalesce('age', default=18))[0]
>> person.coalesce
>> 18
>> person.age
>>
Available Functions
=================
Aggregates:
from aggregates import ...
- As
- BitAnd
- BitOr
- BoolAnd **# Only PostgreSQL**
- BoolOr **# Only PostgreSQL**
- Every **# Only PostgreSQL**
- StringAgg **# Only PostgreSQL**
- XMLAgg **# Only PostgreSQL**
- Corr **# Only PostgreSQL**
- CovarPop **# Only PostgreSQL**
- CovarSamp **# Only PostgreSQL**
- RegrAvgX **# Only PostgreSQL**
- RegrAvgY **# Only PostgreSQL**
- RegrCount **# Only PostgreSQL**
- RegrIntercept **# Only PostgreSQL**
- RegrR2 **# Only PostgreSQL**
- RegrSlope **# Only PostgreSQL**
- RegrSXX **# Only PostgreSQL**
- RegrSXY **# Only PostgreSQL**
- RegrSYY **# Only PostgreSQL**
- Mode **# Only PostgreSQL 9.4+**
- PercentileCont **# Only PostgreSQL 9.4+**
- PercentileDisc **# Only PostgreSQL 9.4+**
Strings:
from aggregates.string import ...
- BitLength
- CharLength
- CharacterLength
- OctetLength
- Lower
- Upper
- Ascii
- Length
- MD5 **# Only PostgreSQL**
Conditionals:
from aggregates.conditionals import ...
- NullIf
- Coalesce **# Only PostgreSQL**
Requirements
==================================
- Django 1.2+
TODO
=================
- UnitTests.
- More detailed informations about functions.
- JSON functions and operations
Metadata
Release files for django-aggregates 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-aggregates-0.1.3.tar.gz | 4.2 kB | Without provenance | Details for django-aggregates-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_aggregates-0.1.3-py2-none-any.whl | Python 2 | none | any | Details for django_aggregates-0.1.3-py2-none-any.whl |
Total release size: 12.6 kB
Release files / django-aggregates-0.1.3.tar.gz
| Download URL | django-aggregates-0.1.3.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9daf619caca866ef5c84b0216f59f929341efbb18b7dbe748f376efb0cad53a7
|
|
BLAKE2b-256 checksum How to use checksums |
2a40dcf66841f61bbc00fb74e3bec831653fef03819ffee37ad9e05358fd3684
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_aggregates-0.1.3-py2-none-any.whl
| Download URL | django_aggregates-0.1.3-py2-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
8b89324c7b5bf0c3133cda209be4d77fe299f1f254ef71f8ef9ee641c4f4403e
|
|
BLAKE2b-256 checksum How to use checksums |
d3b0a14e92677083515db41ec388231bdb87f4fc4bdfa665c7d69745d02b1743
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-aggregates 0.1.3
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.