semvec/pypi-packages huggingface dataset:
declara 1.0.4
Declara, a library for generating Boreas declaration forms
Requires Python: >=3.10

# declara

Programmatically fill out your Boreas declaration forms with Python.

See `example.py` for example use.

## Environment variables
This package requires the following environment variables to be set:

- `SMTP_HOST`
- `SMTP_USERNAME`
- `SMTP_PASSWORD`
- `SMTP_DEFAULT_RECIPIENT`

And these are optional:

- `SMTP_PORT` (default = `587`)
- `DECLARA_EMAIL_BODY_B64` (default = equal to base64-encoded `default_email_body.txt`)
- `DECLARA_EMAIL_SUBJECT` (default = `Declaratie`)
censys-client 0.1.2
A censys client that allow to you to use multiple api key
Requires Python: >=3.0

# Advanced Censys Client

[![PyPI](https://img.shields.io/pypi/v/censys?color=orange&logo=pypi&logoColor=orange)](https://test.pypi.org/project/censys-client/)
[![Python Version](https://img.shields.io/badge/python-3.7%2B-blue?logo=python)](https://www.python.org/downloads/)
[![License](https://img.shields.io/github/license/censys/censys-python?logo=apache)](https://github.com/Inplex-sys/advanced-censys-client/blob/main/LICENSE)

### Additional Informations
 - This client is more fast than the official
 - You don't limit of api keys **(10 keys -> 100k ips)**

## Getting Started
The library can be installed using `pip3`.

```sh
pip3 install -i https://test.pypi.org/simple/ censys-client
```

To upgraded using `pip`.

```sh
pip3 install -i https://test.pypi.org/simple/ --upgrade censys-client
```

To configure your search credentials run `censys-client --config`.
```sh
$ censys-client --config
Censys API ID (********************************98d1): CENSYS_API_ID
Censys API Secret (****************************aucc): CENSYS_API_SECRET
Your API ID and API Secret have been successfully saved to ./config.txt

Would you like to add another API ID and API Secret ? (y/n): 
```
pypale 0.1.5
Python Passwordless Tokens.
Requires Python: >=3.9.10

# pypale

(Py)thon (Pa)ssword(le)ss Tokens.

```sh
pip install pypale
```

## Usage

```py
from pypale import Pypale

token_ttl_minutes = 14 * 24 * 60        # 2 weeks
token_issue_ttl_seconds = 2 * 60 * 60   # 2 hours
base_url = "mydomain.com"
secret_key = "loadthisfromyoursecretsmanager"

pypale = Pypale(
    base_url=base_url,
    secret_key=secret_key,
    token_ttl_minutes=token_ttl_minutes,
    token_issue_ttl_seconds=token_issue_ttl_seconds)

email = "jane.doe@example.com"
token = pypale.generate_token(email)
assert pypale.valid_token(token, email)
```

## An example with SendGrid

```py
# send an email with a magic login link to "jane.doe@example.com"
import sendgrid
from sendgrid.helpers.mail import Content, Email, Mail, To

email = "jane.doe@example.com"
token = pypale.generate_token(email)
link = f"https://mydomain.com/link_login/?code={token}"
sg = sendgrid.SendGridAPIClient(api_key=your_sendgrid_api_key)
from_email = Email("bob@mydomain.co")
to_email = To(email)
subject = "Hello!"
content = Content(
            "text/html", f"Click this <a href={link}>link</a> to log in.")
mail = Mail(from_email, to_email, subject, content)
response = self.sg.client.mail.send.post(request_body=mail.get())
print (response)

# in your link_login route, mentioned in the link var above,
# make sure to call pypale.validate_token with the token and
# properly handle valid and invalid tokens.
# for example ...

def link_login(code: str):
    if not pypale.valid_token(code):
        raise Exception("Invalid login.")
    access_token = base64.b64decode(code).decode("utf8")
    return {
        "access_token": base64.b64decode(code).decode("utf8"),
        "token_type": "bearer"
    }
```

### Contributions & Suggestions

[Pull requests](https://github.com/anthcor/pypale/compare) and [issues](https://github.com/anthcor/pypale/issues/new) are very welcome!