Skip to main content

AnalyticsTool is a Python package designed to interface with PostgreSQL and MongoDB databases.

Project description

AnalyticsTool Package

Overview

AnalyticsTool is a Python package designed to interface with PostgreSQL and MongoDB databases, utilizing AWS Secrets Manager for secure access. It provides a streamlined way to query and manipulate data, ideal for analytics and data management tasks.

Features

  • Access and manage data in PostgreSQL and MongoDB databases.
  • Securely manage database credentials using AWS Secrets Manager.
  • Comprehensive query functionalities to retrieve and manipulate data.

Installation

Install AnalyticsTool via pip:

pip install web3m_analytic_tool

Configuration

Before using AnalyticsTool, configure the following environment variables in your .env file for AWS access:

  • AWS_ACCESS_KEY
  • AWS_SECRET_KEY
  • REGION

Usage

Initializing the Tool

Import and initialize AnalyticsTool with your AWS credentials:

from analytics import AnalyticsTool


aws_access_key = 'your access key'
aws_secret_key = 'your secret key'
region = 'your region'

analytics = AnalyticsTool(aws_access_key, aws_secret_key, region)

Example Usage

Fetch Data from PostgreSQL

Retrieve master user data:

master_users = analytics.get_all_master_users_dict()
print(master_users)

Query Data from MongoDB

Get documents from a specific collection:

documents = analytics.get_from_mongo_all_list_collection('your_collection_name')
print(documents)

API Reference

PostgreSQL Data Access

  • get_all_master_users_dict(): Get master user data.
  • get_all_sub_users_dict(): Get sub-user data.
  • get_all_wallet_activities_dict(): Get wallet activity data.
  • get_all_wallets_dict(): Get wallet data.

MongoDB Data Access

  • get_from_mongo_all_list_collection(collection_name): Get all documents from a specified collection.
  • get_from_mongo_records_by_filter(collection_name, user_id=None, type=None): Get filtered documents from a collection.

License

AnalyticsTool is released under the MIT License.

Contributing

Contributions to the AnalyticsTool project are welcome. Please refer to the CONTRIBUTING.md file for guidelines on how to contribute.

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

web3m_analytics_tool-0.1.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

web3m_analytics_tool-0.1.1-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file web3m_analytics_tool-0.1.1.tar.gz.

File metadata

  • Download URL: web3m_analytics_tool-0.1.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for web3m_analytics_tool-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8ef19c48e3d8de6c927c878290c8de892143f7f0a91e79c022dc322e7fbdf937
MD5 513dff7648798d41eb1ce1e4fb640e73
BLAKE2b-256 74ac951eb126c6855f1b64c075fc6300a8e4bc2e2af341212db26fbb2b1b4548

See more details on using hashes here.

File details

Details for the file web3m_analytics_tool-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for web3m_analytics_tool-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d27067f4e69a29a737aa4fad18a8e6be1dec59758f5cf618cca7b81f96d2059f
MD5 49fabd5efde4813316aba48010162c55
BLAKE2b-256 03d6546352339fb74dda91838364ecf2c404bdfc9d4b4cf9f826239a444dfda4

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