From 60d998a9c8fea4de8856d9b6a729714bd3d3a98a Mon Sep 17 00:00:00 2001 From: Vignesh Rao Date: Wed, 5 Jun 2024 08:24:20 -0500 Subject: [PATCH] Remove unwanted config objects Remove object level phone number declaration Release `v1.0.2` --- .pre-commit-config.yaml | 13 +++++++--- docs/genindex.html | 13 +--------- docs/index.html | 28 +++++++-------------- docs/objects.inv | Bin 1121 -> 1108 bytes docs/searchindex.js | 2 +- gmailconnector/__init__.py | 2 +- gmailconnector/models/config.py | 2 -- gmailconnector/send_email.py | 8 ++++-- gmailconnector/send_sms.py | 11 +++----- gmailconnector/validator/validate_email.py | 8 ++++-- release_notes.rst | 5 ++++ 11 files changed, 42 insertions(+), 50 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fce71e0..eb18250 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,10 +30,11 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace - - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + - repo: https://github.com/psf/black + rev: 22.3.0 hooks: - - id: isort + - id: black + exclude: doc_generator/ - repo: https://github.com/PyCQA/flake8 rev: 7.0.0 @@ -41,6 +42,12 @@ repos: - id: flake8 args: [-j8, '--ignore=F401,W503,E203,E501,F821,E306,E722,N812'] + - repo: https://github.com/PyCQA/isort + rev: 5.12.0 + hooks: + - id: isort + args: [--profile, black] + - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt rev: 0.2.3 hooks: diff --git a/docs/genindex.html b/docs/genindex.html index ecc5a80..06c161f 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -53,7 +53,6 @@

Index

| M | N | O - | P | R | S | T @@ -413,24 +412,14 @@

O

-

P

- - -
-

R

    -
  • recipient (gmailconnector.models.config.EgressConfig attribute) +
  • ReadEmail (class in gmailconnector.read_email)
  • Response (class in gmailconnector.models.responder)
  • diff --git a/docs/index.html b/docs/index.html index fd9af22..6c1c7d0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -61,7 +61,7 @@

    Welcome to Gmail Connector’s documentation!

    Send SMS

    -class gmailconnector.send_sms.SendSMS
    +class gmailconnector.send_sms.SendSMS(**kwargs: Unpack)

    Initiates Messenger object to send an SMS to a phone number using SMS gateway provided by the mobile carrier.

    >>> SendSMS
     
    @@ -201,7 +201,7 @@

    Welcome to Gmail Connector’s documentation!

    Send Email

    -class gmailconnector.send_email.SendEmail
    +class gmailconnector.send_email.SendEmail(**kwargs: Unpack)

    Initiates Emailer object to send an email.

    >>> SendEmail
     
    @@ -282,7 +282,7 @@

    Welcome to Gmail Connector’s documentation!
    -send_email(subject: str, recipient: Union[str, list], sender: str = 'GmailConnector', body: Optional[str] = None, html_body: Optional[str] = None, attachment: Optional[Union[str, list]] = None, filename: Optional[Union[str, list]] = None, custom_attachment: Optional[Dict[Union[str, PathLike], str]] = None, cc: Optional[Union[str, list]] = None, bcc: Optional[Union[str, list]] = None, fail_if_attach_fails: bool = True) Response
    +send_email(subject: str, recipient: Union[str, list], sender: str = 'GmailConnector', body: str = None, html_body: str = None, attachment: Union[str, list] = None, filename: Union[str, list] = None, custom_attachment: Dict[Union[str, PathLike], str] = None, cc: Union[str, list] = None, bcc: Union[str, list] = None, fail_if_attach_fails: bool = True) Response

    Initiates a TLS connection and sends the email.

    Parameters:
    @@ -322,7 +322,7 @@

    Welcome to Gmail Connector’s documentation!

    Read Email

    -class gmailconnector.read_email.ReadEmail
    +class gmailconnector.read_email.ReadEmail(**kwargs: Unpack)

    Initiates Emailer object to authenticate and yield the emails according the conditions/filters.

    >>> ReadEmail
     
    @@ -430,7 +430,7 @@

    Welcome to Gmail Connector’s documentation!

    Validator

    -gmailconnector.validator.validate_email.validate_email(email_address: str, timeout: ~typing.Union[int, float] = 5, sender: ~typing.Optional[str] = None, debug: bool = False, smtp_check: bool = True, logger: ~logging.Logger = <Logger validator (DEBUG)>) Response
    +gmailconnector.validator.validate_email.validate_email(email_address: str, timeout: ~typing.Union[int, float] = 5, sender: str = None, debug: bool = False, smtp_check: bool = True, logger: ~logging.Logger = <Logger validator (DEBUG)>) Response

    Validates email address deliver-ability using SMTP.

    Parameters:
    @@ -556,7 +556,7 @@

    Welcome to Gmail Connector’s documentation!

    Models - Config

    -class gmailconnector.models.config.EgressConfig(_case_sensitive: bool | None = None, _env_prefix: str | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | Path | None = None, *, gmail_user: EmailStr, gmail_pass: str, recipient: Optional[EmailStr] = None, phone: Optional[str] = None, gmail_host: str = 'smtp.gmail.com', encryption: Encryption = Encryption.TLS, timeout: int = 10, **values: Any)
    +class gmailconnector.models.config.EgressConfig(_case_sensitive: bool | None = None, _env_prefix: str | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | Path | None = None, *, gmail_user: EmailStr, gmail_pass: str, gmail_host: str = 'smtp.gmail.com', encryption: Encryption = Encryption.TLS, timeout: int = 10, **values: Any)

    Configure arguments for SendEmail/SendSMS and validate using pydantic to share across modules.

    >>> EgressConfig
     
    @@ -615,22 +615,12 @@

    Welcome to Gmail Connector’s documentation!
    -model_fields: ClassVar[dict[str, FieldInfo]] = {'encryption': FieldInfo(annotation=Encryption, required=False, default=<Encryption.TLS: 'TLS'>), 'gmail_host': FieldInfo(annotation=str, required=False, default='smtp.gmail.com'), 'gmail_pass': FieldInfo(annotation=str, required=True), 'gmail_user': FieldInfo(annotation=EmailStr, required=True), 'phone': FieldInfo(annotation=Union[str, NoneType], required=False, metadata=[PydanticGeneralMetadata(pattern='\\d{10}$')]), 'recipient': FieldInfo(annotation=Union[EmailStr, NoneType], required=False), 'timeout': FieldInfo(annotation=int, required=False, default=10)}
    +model_fields: ClassVar[dict[str, FieldInfo]] = {'encryption': FieldInfo(annotation=Encryption, required=False, default=<Encryption.TLS: 'TLS'>), 'gmail_host': FieldInfo(annotation=str, required=False, default='smtp.gmail.com'), 'gmail_pass': FieldInfo(annotation=str, required=True), 'gmail_user': FieldInfo(annotation=EmailStr, required=True), 'timeout': FieldInfo(annotation=int, required=False, default=10)}

    Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

    This replaces Model.__fields__ from Pydantic V1.

    -
    -
    -phone: Optional[str]
    -
    - -
    -
    -recipient: Optional[EmailStr]
    -
    -
    timeout: int
    @@ -640,7 +630,7 @@

    Welcome to Gmail Connector’s documentation!
    -class gmailconnector.models.config.Encryption(value)
    +class gmailconnector.models.config.Encryption(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

    Enum wrapper for TLS and SSL encryption.

    >>> Encryption
     
    @@ -856,7 +846,7 @@

    Welcome to Gmail Connector’s documentation!
    -class gmailconnector.models.options.Folder(value)
    +class gmailconnector.models.options.Folder(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

    Wrapper for folders to choose emails from.

    diff --git a/docs/objects.inv b/docs/objects.inv index 08f2939a83cca0b54bbe58cc0e783a47ff7de9d0..767faa3f577cb51397e311a491d7f4d81807c662 100644 GIT binary patch delta 995 zcmV<9104L}2-FCWe}B!6+cpr#?|upu&2@?9np?2z1PjDL5Vh!0pv95QgdYM)xpq%| zjlN!=q?9O2mRH$WjN#RAy^M+PH_FKjk zgA+M8DSi#Mhd0^7rhdhpY-=cCFnLS zKeNJ#I*ucO8iDiPL-`WwbFv69o;z(N3@oh zsj9WaOqH!U6Msv$mZ<5%HK!sdSH8k_ldH3i)?KPLbQS!OzIH~|2wiJ)BS_cM)&T6KY8>EsNXS( z0&9GYL4ROuq>bp<&2`Xx}dviz3332oiM%LFg| zvotb}D_ZHT4hn1gF1MS>SEXzbT7xUNs&p!cE89slA0kab^~N!W_kp|`M<;&rCAq&` znfN8|_{1;LhQvoD{WV~8CA|i9!XiRtD;#gAaesyMuidnURNzgatR@|);H-;tWK^vR zq25KY(neOO_w3{FuV*W(^U5=^GOtM}MYI4+E1+xOY{TzlN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