No project description provided
Project description
Wrench Code Library
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
Release history Release notifications | RSS feed
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.5.tar.gz
(10.6 kB
view hashes)
Built Distribution
WrenchCL-1.3.5-py3-none-any.whl
(20.3 kB
view hashes)