semvec/pypi-packages huggingface dataset:
pyecwid-DanPalmz 0.0.1
An interface to the Ecwid shopping platform API
Requires Python: >=3.6

# pyecwid
Python wrapper for Ecwid REST API

## Requirements
1. See requirements.txt
2. API token and Store ID from [Ecwid CP](https://my.ecwid.com/) Apps -> My Apps

## Implemented Features - Product CRUD ##
* Product
    * product(id) - get product details
    * product_add(product) - add product (dict)
    * product_delete(id) - remove product
    * product_update(id, {values}) - update product with values (dict)
    * product_variations(product_id) - get all variations/combinations for a product
    * product_varation_update(product_id, variation_id, {values}) - update one item varation with values (dict)

* Products
    * products() - return all products
    * products_by_keyword('keyword') - search products for keyword
    * products_by_params({params}) - pass dict of paramaters to products API
 
* Product types (classes)
    * product_classes() - return all configured product types in the store

### Sample:  Search products for items matching keyword 'sunglasses'
```python
from pprint import pprint
from pyecwid import EcwidAPI

ecwid = EcwidAPI('public_ASDF','1234567')

items = ecwid.products_by_keyword('sunglasses')

pprint(items)
```
### Sample:  Return all products and create a list of items with 'USB' in the name.
```python
from pyecwid import EcwidAPI

API_TOKEN = 'secret_ASDF'
API_STORE = '1234567'

ecwid = EcwidAPI(API_TOKEN,API_STORE)

items = ecwid.products()
usb_list = list(filter(lambda items: 'USB' in items.get('name'), items))

pprint(usb_list)
```
### Sample:  Provide a paramater dict as search terms
```python
from pyecwid import EcwidAPI

API_TOKEN = 'secret_ASDF'
API_STORE = '1234567'

ecwid = EcwidAPI(API_TOKEN,API_STORE)

params = { 'createdFrom': '2016-04-25', 'createdTo': '2020-12-25' }

items = ecwid.products_by_params(params)

pprint(items)
```
sfb 0.1.4
SQL tester and cost estimator for Google BigQuery
Requires Python: >=3.6, <4
Keywords: bigquery,sql,testing,development

# sfb

sfb helps SQL testing and estimating the cost of services that depend on scan volume.

## Description

- Check SQL syntax
- Estimate query costs for free
    - per Run
    - per Month
- Replace query parameters automatically
- Be useful on continuous integration
- Use dryrun include [Google BigQuery API Client Libraries](https://cloud.google.com/bigquery/docs/reference/libraries)

## Install

```sh
$ pip install sfb
```

## Requirements

- Python >= 3.6
    - Jupyter Notebook
    - Google Colaboratory
- google-cloud-bigquery >= 2.6.1
- pyyaml >= 5.4.1

## Usage

### Estimate Query Costs

```sh
# If runs with no arguments, execute files in './sql/*.sql'.
$ sfb
{
  "Succeeded": [
    {
      "SQL File": "/home/admin/project/sfb_test/sql/covid19_open_data.covid19_open_data.sql",
      "Total Bytes Processed": "1.9 GiB",
      "Estimated Cost($)": {
        "per Run": 0.009414,
        "per Month": 0.28242
      },
      "Frequency": "Daily"
    },
    {
      ...
    }
  ],
  "Failed": [
    {
      "SQL File": "/home/admin/project/sfb_test/sql/test_failure_badrequest_01.sql",
      "Errors": [
        {
          "message": "Unrecognized name: names; Did you mean name? at [9:5]",
          "domain": "global",
          "reason": "invalidQuery",
          "location": "q",
          "locationType": "parameter"
        }
      ]
    },
    {
      ...
    }
  ]
}
```

```sh
# Others
$ sfb -f ./sql/*.sql
$ sfb -q "select * from test;"
$ echo "select * from test;" | sfb | jq
$ find ./sql -type f | sfb
```

### Arguments

```sh
$ sfb -h
usage: sfb [-h] [-f [FILE [FILE ...]] | -q QUERY] [-c CONFIG] [-s {BigQuery}]
           [-p PROJECT] [-v] [-d]

optional arguments:
  -h, --help            show this help message and exit
  -f [FILE [FILE ...]], --file [FILE [FILE ...]]
                        sql filepath
  -q QUERY, --query QUERY
                        query string
  -c CONFIG, --config CONFIG
                        config filepath
  -s {BigQuery}, --source {BigQuery}
                        source type
  -p PROJECT, --project PROJECT
                        GCP project
  -v, --verbose         verbose results
  -d, --debug           run as debug mode
```

### Directory (Optional)

```sh
$ tree .
.
├── config
│   └── sfb.yaml
├── log
│   └── sfb.log (if runs as debug mode)
└── sql
    └── [SQL files here]
```

### Configuration

```sh
$ cat ./config/sfb.yaml

# Default settings
Globals:
  Service: BigQuery
  Location: US
  Frequency: Daily

QueryFiles:
  [your_sql_file_name]:
    Frequency: Weekly
    Parameters:
    - name: ds_start_date
      type: DATE
      value: '2020-01-01'
    - name: ds_end_date
      type: DATE
      value: '2020-01-31'
  ...
```

#### Type

Name of query parameter type. Select one of types below.

- STRING
- INT64
- FLOAT64
- NUMERIC
- BOOL
- TIMESTAMP
- DATETIME
- DATE

#### Frequency

For calculating monthly cost estimation.

- Hourly
    - (cost_per_run) * 30(days) * 24(h)
- Daily
    - (cost_per_run) * 30(days)
- Weekly
    - (cost_per_run) * 4(weeks)
- Monthly
    - cost_per_run