Omnicloud.Airport
Omnicloud.Airport is a Python package for handling data transfer to and from cloud storage providers. It provides a set of classes that implement a common interface for working with cloud storage, making it easy to switch between providers and abstract classes for extending self.
Conception
Terminal
It is an object that provides cloud related features to existing objects. For example:
- omnicloud.airport.terminals.Dict contains methods for processing dictionary;
- omnicloud.airport.terminals.Pickle - for handling a pickle object.
Every terminal is inherited fom his based object: Dict from dict, Pickle from pickle, so you can use it in your code directly.
Each terminals contains one or more Gates.
Gate
Gate is a object that interacts with single cloud.
- omnicloud.airport.terminals.Dict.GStorageJSON - with JSON files at the Google Cloud Storage bucket;
- omnicloud.airport.terminals.Dict.LocalJSON - with local file.
Addons
The omnicloud.airport is a platform additional terminals or gates can be installed into that.
For more information please read the developer docs.
Filling with objects
The base package omnicloud.airport contains terminals for object from a pretty python only and gates for local files to theme.
If you need more please install additional packages. For example omnicloud-airport-dict-gcs to get a gate to Google Cloud Storage for dictionary or omnicloud-airport-pydantic to get a terminal for pydantic.
Installation & usage
pip3 install --upgrade omnicloud-airport
from omnicloud.airport.terminals import Dict
test_dict = {}
Dict(test_dict).departure('LocalJSON::/tmp::ensure_ascii=False', 'file_name.json')
The first argument of the method departure is a "waybill". The second is a filename.
The waybill is a specification for processing data in string format that contains three elements separated by "::":
-
name of class that represented needs gate;
-
the place for saving to;
-
additional options in format "key=value||key=value||key=b64:..."; it is optional argument.
As a waybill well as filename can contains a part of path:
Dict(test_dict).departure('LocalJSON::/tmp/a::ensure_ascii=False', 'file.json')
Dict(test_dict).departure('LocalJSON::/tmp::ensure_ascii=False', 'a/file.json')
Both command in the tutorial above save a data to file "/tmp/a/file.json"
For interaction with different storage (cloud provider) you have to change waybill in your config or environment variable:
pip3 install omnicloud-airport-gcp
then
Dict(test_dict).departure('GStorageJSON::gs://bucket::ensure_ascii=False||key_file=...', 'a/file.json')
Release files for omnicloud-airport 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| omnicloud_airport-0.0.2.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| omnicloud_airport-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.3 kB
Release files / omnicloud_airport-0.0.2.tar.gz
| Download URL | omnicloud_airport-0.0.2.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b57c247f50c6d955d6390022a300074c7a8e18b5a0e304c29cbba8583e183ce
|
|
BLAKE2b-256 checksum How to use checksums |
5652244ef0156de1e080edcd8b94556113c8d00e00a0e9ef0d398819d3cc9a0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1035-azure
|
Release files / omnicloud_airport-0.0.2-py3-none-any.whl
| Download URL | omnicloud_airport-0.0.2-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d8b65ebac594bf5e9166eee4e87682493b1e4bc9daf4129bf63b36d555ce41c3
|
|
BLAKE2b-256 checksum How to use checksums |
1feb342c6939c6b3c5520b32903cccc5dc5601be54b5dea4a889daeb059205bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1035-azure
|