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.2.27.tar.gz (1.8 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.2.27-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: adsgenericfunctions-0.2.27.tar.gz
  • Upload date:
  • Size: 1.8 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.2.27.tar.gz
Algorithm Hash digest
SHA256 25aee7ac2cb4649ec2b9473229d115b5040e301fbdbb16da16dda184935a0db1
MD5 80a521786ff54250d4a8daf15c3697c3
BLAKE2b-256 846239ff64e3ce9f0a0a7cc5cfe5b0d7136fa88221e60cee49f89d29e2ba6562

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adsgenericfunctions-0.2.27-py3-none-any.whl
Algorithm Hash digest
SHA256 c6dfc6fea8bbf96f80219a8f822aa6a85ef9def5bb36e0c92a8bf6ac2c7dc70f
MD5 ab0832fc101a36bf431afdf296f0e6e3
BLAKE2b-256 fee7d5a002821c42f4927e5acf86b61a5b95ca97ef0b50fefa510e10ae36e631

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