Skip to main content

A utility package for AWS S3 and MongoDB operations

Project description

ripikutils

ripikutils is a Python package designed to provide utility functions for MongoDB operations and AWS S3 interactions, specifically tailored for internal use at Ripik Tech.

PyPI version License: MIT

Table of Contents

Creation of Secret Manager

Every secret manager added should follow these guidelines:

  • Format: ripikutils/{clientName}/{useCase}
  • Data added inside the secret should at least include the following values:
    • mongoURI
    • dbName
    • useCase
    • s3Bucket

Installation

You can install ripikutils using pip:

pip install ripikutils

Features

  • MongoDB data filtering, insertion, updating, and deletion
  • AWS S3 operations (upload, download, delete, list)
  • Temporary directory management for image processing

Usage

MongoDB Operations

Initialize Mongo Client

Initialize MongoDB client using client name and its usecase

from ripikutils import initialize_mongo

mongo_client = initialize_mongo(client_name, usecase)

Apply Filter

Apply basic filter to your MongoDB query

filtered_data = mongo_client.apply_filter(collection, filter_params)

Insert Document

Insert documents to your MongoDB collection

mongo_client.insert(collection, document)

Update Document

Update a document in your MongoDB collection

mongo_client.update(collection, filter_params, update_params)

Delete Document

Delete a document from your MongoDB collection

mongo_client.delete(collection, filter_params)

AWS S3 Operations

Initialize AWS s3 Client

Initialize S3 Client using client name and usecase

from ripikutils import initialize_s3

s3_client = initialize_s3(client_name, usecase)

Upload Object/File

Upload a file to S3 using previously created s3_client

s3_client.upload_s3_object(file_path, object_name)

Download Object/File

Download a file from S3 using previously created s3_client

s3_client.download_s3_object(object_name, local_file_path)

Delete Object/File

Delete a file from S3 using previously created s3_client

s3_client.delete_s3_object(bucket_name, object_name)

Get Presigned URL

Get a presigned URL for a file in S3 using previously created s3_client

presigned_url = s3_client.get_presigned_url(object_name)

List Objects in S3 Bucket

List objects in a S3 bucket using previously created s3_client

objects = s3_client.list_s3_objects()

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For any queries or support, please contact the Ripik Tech team at vaibhav@ripik.ai.

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

ripikutils-0.9.2.3.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

ripikutils-0.9.2.3-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file ripikutils-0.9.2.3.tar.gz.

File metadata

  • Download URL: ripikutils-0.9.2.3.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for ripikutils-0.9.2.3.tar.gz
Algorithm Hash digest
SHA256 4822d7b7210bc7cfa5d001b16ad23f4b763c80966ab29253f01a15a58d6dd88f
MD5 2d038b968268b072cd7536906ab008b9
BLAKE2b-256 6ea3a6a16874a02c3268a104722e565f2cc68406edb0737287c92ee982c8b20d

See more details on using hashes here.

File details

Details for the file ripikutils-0.9.2.3-py3-none-any.whl.

File metadata

  • Download URL: ripikutils-0.9.2.3-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.16

File hashes

Hashes for ripikutils-0.9.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7638215dfa133aa2edfdb75bd31ed29e547ff4a61918db17e5c8b670a1bacb43
MD5 c4d4364c184533f878a2685836733dce
BLAKE2b-256 47047faa5fdb19e249a529f5974cd205cae3e1caae4ffe349d3eec96a157c8be

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