Skip to main content

Add file-based data transfer to server for offline-use

Project description

pypi travis coverage

django-collect-offline-files

Transfer django_collect_offline transactions as files using SFTP over an SSH connection.

Data flows from client to server where a server is either a node server or the central server.

see also django_collect_offline.

Usage

On the client:

python manage.py export_transactions

On the server or receiving host:

python manage.py incoming_observer

python manage.py deserialize_observer

FileQueueObservers

Two FileQueueObservers do the work using use watchdog observers; IncomingTransactionsFileQueueObserver and DeserializeTransactionsFileQueueObserver. They are called using management commands:

python manage.py incoming_observer

and

python manage.py deserialize_observer

IncomingTransactionsFileQueueObserver

The client exports data to JSON and sends to the server. Using TransactionExporter, data is exported into a JSON file from django_collect_offline.models.OutgoingTransaction on the client and sent to the server using TransactionFileSender.

Once a file is sent to the server, the IncomingTransactionsFileQueueObserver detects it and adds the filename to the queue (IncomingTransactionsFileQueue).

DeserializeTransactionsFileQueue

Processed files in the queue IncomingTransactionsFileQueue are moved to the pending folder watched by DeserializeTransactionsFileQueueObserver.and added to the its queue, DeserializeTransactionsFileQueue.

Processing queue items / filenames

Each queue has a processor, (see process_queue). The processor calls the next_task method for each item in the queue in FIFO order infinitely or until it gets a None item.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

File details

Details for the file django_collect_offline_files-0.1.27-py3-none-any.whl.

File metadata

  • Download URL: django_collect_offline_files-0.1.27-py3-none-any.whl
  • Upload date:
  • Size: 64.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

File hashes

Hashes for django_collect_offline_files-0.1.27-py3-none-any.whl
Algorithm Hash digest
SHA256 d227ab61020f09ec75e0cc96d707af07b1558f3afb2ebb2b9f19c6c3321a8b89
MD5 33ec1f90b9851eeb9e4d8c33f2d6bc3b
BLAKE2b-256 a843d8a1e0d7016de54a0473cc2a06f2dc1b046df968899bdcf41ec8503f33e6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page