Skip to main content

No project description provided

Project description

Wrench Code Library


PyPI version Python Version Maintainer

GitHub Stars GitHub Forks GitHub Issues GitHub Pull Requests

Description

This is a code library designed to improve code reusability and standardize access to APIs, RDS, and logging functionalities.

Pypi Link: https://pypi.org/project/WrenchCL/

Installation

To install the package, simply run:

pip install WrenchCL

Extending the ApiSuperClass

To use ApiSuperClass for your specific API, create a subclass that implements the following methods:

Methods

  • get_count(): Returns the total number of records meeting specific conditions.
  • fetch_data(): Fetches data from the API in a specific format.

Example

from WrenchCL.ApiSuperClass import ApiSuperClass


class YourApiSubClass(ApiSuperClass):
    def __init__(self, your_params):
        super().__init__('your_base_url')
        # Initialization code here

    def get_count(self):
        # Implementation here
        pass

    def fetch_data(self, batch_size=100, last_record_sort_value=None, last_record_unique_id=None, page=None):
        # Implementation here
        pass

Extending the _RdsSuperClass

To use _RdsSuperClass for specific database operations, you don't need to create a subclass unless methods need to be overridden.

Example

from WrenchCL import rdsInstance

# Regular Implementation
rdsInstance.connect()


# Overriding Methods
class YourDatabaseSubClass(_RdsSuperClass):
    def __init__(self, your_params):
        super().__init__('your_secrets_path')
        # Initialization code here

    # Override or extend existing methods as needed

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

WrenchCL-1.3.2.tar.gz (10.7 kB view hashes)

Uploaded Source

Built Distribution

WrenchCL-1.3.2-py3-none-any.whl (20.9 kB view hashes)

Uploaded Python 3

Supported by

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