Add file-based data transfer to server for offline-use
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-collect-offline-files-0.1.21.macosx-10.13-x86_64.tar.gz
.
File metadata
- Download URL: django-collect-offline-files-0.1.21.macosx-10.13-x86_64.tar.gz
- Upload date:
- Size: 77.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc4e601fb098e55104e24136345d71edb4a349cc21fb7c8c4dca76ff678a360b |
|
MD5 | c404899179d50bcebf453dac3c268d22 |
|
BLAKE2b-256 | 5084d78549cc806bb5eeda135b74bae67ecb1fba94979bc87131dab1ec2e7fa0 |
File details
Details for the file django_collect_offline_files-0.1.21-py3-none-any.whl
.
File metadata
- Download URL: django_collect_offline_files-0.1.21-py3-none-any.whl
- Upload date:
- Size: 53.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f71efd8fb39e9fe85eb311b354d0dc2c47b288331fdbfe43ff8ab70c8d43598f |
|
MD5 | 397751ce255d975fb0f5a5fd0da8f5e0 |
|
BLAKE2b-256 | 784577ba23643b6f286342c08e7b5823728bc4db42e2fd550b18d492ed2314fe |