Skip to main content

platform for interacting with omnicloud

Project description

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 "::":

  1. name of class that represented needs gate;

  2. the place for saving to;

  3. 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')

Project details


Download files

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

Source Distribution

omnicloud_airport-0.0.2.dev1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omnicloud_airport-0.0.2.dev1-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file omnicloud_airport-0.0.2.dev1.tar.gz.

File metadata

  • Download URL: omnicloud_airport-0.0.2.dev1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.11 Linux/5.15.0-1035-azure

File hashes

Hashes for omnicloud_airport-0.0.2.dev1.tar.gz
Algorithm Hash digest
SHA256 4ce845fd27b9ee9299a481c48127038a24b2785f80689299eb23915ba5e056c0
MD5 ab9189861c87b8e460130ef7e222112d
BLAKE2b-256 ca00fad6f41dcb1ccdb687642b7d98879114c71e1ab0ed327ffd5dc2ff299895

See more details on using hashes here.

File details

Details for the file omnicloud_airport-0.0.2.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for omnicloud_airport-0.0.2.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9507fe711c28cbb41ebee2a55973b57a2333bdc880bce811b3ba6eaa5c888f6
MD5 0ebea60a1d49da1db828fc5c2511bf1b
BLAKE2b-256 b5da5f3df008beb602c34fe536cc8d494f727f8611f32e43087e02debd8c0834

See more details on using hashes here.

Supported by

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