semvec/pypi-packages huggingface dataset:
pysnippets 1.1.4
Python Snippets

==========
pysnippets
==========

Python Snippets

Installation
============

::

    pip install pysnippets


Usage
=====

dict::

    In [1]: from pysnippets import dictsnippets as dsn

    In [2]: dsn.filter({'a': 1, 'b': 2, 'c': 3}, ['c', 'd:4'])
    Out[2]: {'c': 3, 'd': 4}

    In [3]: dsn.filter({'a': 1, 'b': 2, 'c': 3}, ['c', 'd:4'], exec_eval=False)
    Out[3]: {'c': 3, 'd': '4'}

    In [4]: dsn.gets({'a': 1, 'b': 2, 'c': 3}, ['c', 'd:4'])
    Out[4]: [3, 4]

    In [5]: dsn.gets({'a': 1, 'b': 2, 'c': 3}, ['c', 'd:4'], exec_eval=False)
    Out[5]: [3, '4']


list::

    In [1]: from pysnippets import listsnippets as lsn

    In [2]: lsn.all([1, 2, 3], [1, 2])
    Out[2]: True

    In [3]: lsn.any([1, 2, 3], [1, 5])
    Out[3]: True


str::

    In [1]: from pysnippets import strsnippets as ssn

    In [2]: ssn.strip(None)

    In [3]: ssn.strip(' xyz ')
    Out[3]: 'xyz'
fdbk-dynamodb-plugin 3.0.2
DynamoDB plugin for fdbk
Requires Python: >=3.6

# fdbk_dynamodb_plugin

[![Build Status](https://travis-ci.org/kangasta/fdbk_dynamodb_plugin.svg?branch=master)](https://travis-ci.org/kangasta/fdbk_dynamodb_plugin)

AWS Dynamo DB wrapper for fdbk.

## Installation

Run:

```bash
pip install fdbk_dynamodb_plugin
```

to install from [PyPI](https://pypi.org/project/fdbk_dynamodb_plugin/) or download this repository and run

```bash
python setup.py install
```

to install from sources.

## Testing

Check and automatically fix formatting with:

```bash
pycodestyle fdbk_dynamodb_plugin
autopep8 -aaar --in-place fdbk_dynamodb_plugin
```

Run static analysis with:

```bash
pylint -E --enable=invalid-name,unused-import,useless-object-inheritance fdbk_dynamodb_plugin
```

Run unit tests with command:

```bash
python3 -m unittest discover -s tst/
```

Get test coverage with commands:

```bash
coverage run --branch --source fdbk_dynamodb_plugin/ -m unittest discover -s tst/
coverage report -m
```

## Cloud deployment

In addition to the plugin, this repository includes CloudFormation template for setting up the DynamoDB tables as well as the related IAM resources and a Chalice app that implements a simple serverless backend to view overview of the data.

The CloudFormation template is available in [fdbk_tables.template.yaml](./fdbk_tables.template.yaml). It setups both of the tables, topics and data, with pay-per-request billing mode.

The chalice implementation for serverless backend is located in [serverless-backend/](./serverless-backend/). The application configuration in [serverless-backend\.chalice\config.json](./serverless-backend\.chalice\config.json) must be updated with your environment specific resources. After updating the configuration, the app can be deplyed with

```bash
chalice deploy
```
JT-Gmail 0.0.24
My Gmail API Wrapper
Requires Python: >=3

# JT_Gmail
This is a simple interface for programmatically sending emails using the Gmail API.

```
pip install JT_Gmail
``` 

To get started you must <a href="https://console.developers.google.com/apis/library/gmail.googleapis.com">create a project 
and enable the Gmail API</a>, create OAuth2 credentials and download them in a json file.

Before you can use this module for the first time, you must run:
```python
import JT_Gmail as gmail

gmail.GetToken(scopes=['scope1', 'scope2'], email_address='user@gmail.com', cred_path="path_to_your_credentials.json")
```

Supply the scopes you plan on using as *args. A list of all the scopes can be found 
<a href="https://developers.google.com/gmail/api/auth/scopes">here<a>. Each function also includes the required scopes
in its docstring.

This will prompt for authentication and generate the proper token to use the scopes you supplied. The token and 
credentials are saved for later use, so you might only have to run that line once. As you perform actions, if they need 
new permissions, they will be requested. Authentication will be required for each gmail user you wish to use.

To send emails, it's as easy as:
```python
import JT_Gmail as gmail

with open("email.html") as file:
    gmail.SendHTMLEmail(
        sender='sender@gmail.com', 
        to="recipient@some.website", 
        subject="Example Email", 
        message_html=file.read()
)
```

This was base heavily on <a href="https://developers.google.com/gmail/api/quickstart/python">code snippets supplied by 
Google<a>.