Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

Data Ingress

This is a simple ingress app which stores all incoming messages in a queue categorized into collections.

Data is always posted in the form of messages to a specific collection, and can be processed from the queue by consumers.

Usage:

1. Add the app

Enable in installed apps:

INSTALLED_APPS = [
    ...,
    'ingress'
]

2. Create and configure a consumer

Implement a consumer to handle the data. Note: the ingress can be deployed without a consumer when you (probably temporarily) want to ingest data, but not consume it.

class MyConsumer(IngressConsumer):
    collection_name = 'foobar'

    def consume_message(self):
        ...

    # by default consume_batch() loops and calls consume_message(), but it can be 
    # overridden to have more control, for instance to bulk insert into the db.
    def consume_batch(self):
        ...

Configure the consumer in settings.py. Each consumer must implement the BaseConsumer and implement the proper methods (see above). On consumption consumers are passed all messages in the collection that corresponds to Consumer.collection_name.

# A list of classpaths to implementations of ingress.consumer.IngressConsumer
# to handle the data in the queue.
INGRESS_CONSUMER_CLASSES = ['app.module.MyConsumer']

3. Authentication and Authorization

Configure at least the authentication classes or permission classes or disable authentication completely:

# A list of authentication classes used in the ingress view.
# See https://www.django-rest-framework.org/api-guide/authentication/
INGRESS_AUTHENTICATION_CLASSES = []

# A list of permission classes used in the ingress view.
# See https://www.django-rest-framework.org/api-guide/permissions/
INGRESS_PERMISSION_CLASSES = []

# If the queue is used without the endpoint, authentication checks can be 
# disabled by setting this flag to True. Defaults to False.
INGRESS_DISABLE_ALL_AUTH_PERMISSION_CHECKS = True

4. Accept data posted to non-existing collections?

By default data posted to non-existing collections is not stored, and an error is returned for such requests.

If data posted to non-existing collections should be stored, modify the setting:

# Whether or not to accept data posted to a non-existing collection.
INGRESS_ACCEPT_NEW_COLLECTIONS = False

5. Set encoding when other than UTF-8

By default the ingress decodes all incoming data using UTF-8. If the data needs to be decoded differently before being stored in the database, configure the setting:

# Encoding that the data will be in when posted to the ingress
INGRESS_ENCODING = "utf-16"

Release files for datapunt-data-ingress 2.3.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 datapunt-data-ingress 2.3.0
File Size Uploaded
datapunt-data-ingress-2.3.0.tar.gz 17.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for datapunt-data-ingress 2.3.0
File Interpreter ABI Platform
datapunt_data_ingress-2.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 46.4 kB

Release files / datapunt-data-ingress-2.3.0.tar.gz

Download URL datapunt-data-ingress-2.3.0.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3c1977b301f5c38c5a7b9a0620c889cd069d3add9ccec1229d381b8d90007f79
BLAKE2b-256 checksum
How to use checksums
1e85791d6c49e74bcc60523c2228faaa6ebc350618e7de9dd8a7c251bbc263c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.10

Release files / datapunt_data_ingress-2.3.0-py3-none-any.whl

Download URL datapunt_data_ingress-2.3.0-py3-none-any.whl
Size 28.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b3566da8b78bff04a67e47d73e755ca6129cdbeeec8de6626aece754788c7e1
BLAKE2b-256 checksum
How to use checksums
c454b914b27e6d389a8fd711ef92dc8456dcc222fefbb53c901c46f98ae5844e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.10
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