Skip to main content

Delpha Database Management System

Project description

DelphaDBManagement

Management API for Delpha to work around Data inside the Cassandra Cluster

This repository is python based yet, to be open to other languages (Java, JavaScript, ...) Module to handle DB Managmenet on our Cassandra Cluster.

title

Security Objectives

Need a really secure way to handle data :

Private Keys will be generated by Delpha only and will be stored inside an authentication table inside Cassandra. Users will need to match a given private key to access the DBMS. This key will be bound to the dedicated organisation, and only one Private Key will be tagged as Admin and unlock all the DBMS access.

title

title

Installation

Requirements

Python : >3.8 cassandra-driver simple-salesforce requests boto3

Install Dependencies

Common

pip install -r requirements.txt

Salesforce Manager

Salesforce Data Manager using Salesforce API.

  • Parameter : instance_name: Salesforce Instance name
  • Parameter : client_id: Consumer ID for authorized app
  • Parameter : client_secret: Consumer Secret for authorized app
  • Parameter : username: usernam to login to Instance of Salesforce
  • Parameter : param password: password to login to Instance of Salesforce
  • Parameter : param security_token: User's security token
sf_manager = SalesforceManager(instance_name, consumer_key, consumer_secret, salesforce_username, salesforce_pwd, personnal_token)
sf_manager.help()
res, size = sf_manager.query("SELECT Name from Contact")

Cassandra Manager

Cassandra Database manager : CassandraManager.

  • Parameter : pem_file_path: String path of the .pem file to use for 2FA connection
  • Parameter : config_file_path: String path of the .yalk file to use to get credentials
  • Parameter : key_space: String session keyspace to set for the Cluster
cass_cluster = CassandraManager(key_file_path, pem_file_path, "delpha_actions")
cass_cluster.execute("SELECT * FROM actions_conv_by_user").all()

Dictionnary part of Cassandra Database manager : DictionaryManager.

manager = DictionaryManager(cass_cluster)
manager.list_tables
['keyspace1', 'keyspace2', ...]

AppFlow Manager

Delpha AWS data Handler (AppFlows) : AppFlowManager.

  • Parameter : key: String AWS key
  • Parameter : secret: String AWS secret
  • Parameter : flow_type: String Flow type to handle ['contact', 'account']
  • Parameter : bucket_name: String to use specific bucket
  • Parameter : region: String AWS region
handler = AppFlowManager(aws_key_id, aws_secret, bucket_name,'contact') #Setup contact Flow (contact dataset)
df = handler.get_flow_parquet_data()
flow_status, flow_last_execution_record = handler.start_flow(flow_name) #Start flow on AWS side

handler.ensure_spark_format(flow_name) #Check if data is in right format (.parquet)

handler.get_last_flow_id(flow_name) #Get last folder Name in bucket for specific flow.

S3 Manager

Delpha AWS data Handler (AppFlows) : S3Manager.

  • Parameter : key: String AWS key
  • Parameter : secret: String AWS secret
  • Parameter : region: String AWS region
S3 = S3Manager(aws_key_id, aws_secret, region) #Setup contact Flow (contact dataset)
df = S3.buckets
flow_status, flow_last_execution_record = handler.start_flow(flow_name) #Start flow on AWS side

handler.ensure_spark_format(flow_name) #Check if data is in right format (.parquet)

handler.get_last_flow_id(flow_name) #Get last folder Name in bucket for specific flow.

How to - Pip publish package

python setup.py sdist bdist_wheel
twine upload dist/*

License

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

delpha-db-manager-1.2.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

delpha_db_manager-1.2.1-py3-none-any.whl (44.5 kB view details)

Uploaded Python 3

File details

Details for the file delpha-db-manager-1.2.1.tar.gz.

File metadata

  • Download URL: delpha-db-manager-1.2.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2

File hashes

Hashes for delpha-db-manager-1.2.1.tar.gz
Algorithm Hash digest
SHA256 791c84a41d55ec472b9c079d4e1ce49ec4c20e890798e0b16bf1ac16f28f9a9a
MD5 2dae4c13106aa51e63c6f1c9f07d023b
BLAKE2b-256 0aeecfc556242273aeb7042276bf8ac6cebe632ea73e6844e900e8bc51658c5e

See more details on using hashes here.

File details

Details for the file delpha_db_manager-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: delpha_db_manager-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 44.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2

File hashes

Hashes for delpha_db_manager-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 71bbe22a8bf133e3e6cd21ab5c2e1fce50dcf671f8cbbdf3c737853d22bb55d0
MD5 dc5ffa014ec59c5ae3b5ed39106ca02a
BLAKE2b-256 742ca03f0a4b57f10a32aea0a66989a19d48e2923068a849ee49abddd59843bf

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