Skip to main content

Generic functions

Project description

Alchimie Data Solutions : Generic functions

The purpose of this Python package is to group together all the generic functions used in Onyx development.

adsGenericFunctions

class PostgresInput:

def init(self, database: str, user: str, password:str, port:str, host: str, batch_size=1000)

This class is used to communicate with a postgres database. Initialising the class starts the connection, so it needs the database name, user, password, port and host. It also sets the default read buffer to 1000.

def del(self)

This method just closes the connection to the database.

def read(self, query: str)

This method belongs to the PostgresInput class. It reads the parameter query and yield the results in batches of size batch_size.

def write(self, query: str, params=None)

This method belong to the PostgresInput class. It executes the parameter query, this query can be an insert, an update or a delete operation. We can add parameters to the execution by the parameter params set to None by default.

def send_mail(sgApiClient: str, destinataire: List[str], msg: str, from_email: str, subject: str) -> Response

This function sends an email to the destinataire from from_email with the subject subject and a message msg. It also needs the api key sgApiClient. It returns the send response.

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

adsgenericfunctions-0.1.8.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

adsgenericfunctions-0.1.8-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file adsgenericfunctions-0.1.8.tar.gz.

File metadata

  • Download URL: adsgenericfunctions-0.1.8.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Windows/10

File hashes

Hashes for adsgenericfunctions-0.1.8.tar.gz
Algorithm Hash digest
SHA256 d155b827a7003f5eba13c5b3684bc8949ead6ce2ea9e2014b3749ae1c24b399f
MD5 34ba076ffc92ac09cd9ae15408733e48
BLAKE2b-256 115de063dcbf0c3ea25a6e6164a8f10933248c7bca1624317446c75adae256f5

See more details on using hashes here.

File details

Details for the file adsgenericfunctions-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for adsgenericfunctions-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f33209c2bab707cd86ae0b9a46923920984b6d90ae0551e9421ca033e8143a31
MD5 bdf7b6f2a6f2f5fe1ed6c93314822a67
BLAKE2b-256 6087e5be6e7d6d1c4a45ec38dae562397e9b3ef042d4932d66b9bc84475f0228

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