semvec/pypi-packages huggingface dataset:
simple-bigquery-gcf-sync 0.1.0
A BigQuery connector for easy data syncing for your custom import. Checks the last date in the table and only appends new data or creates a new table. Made for Google Cloud Functions.
Requires Python: >=3.6

# simple-bigquery-gcf-sync

Created so you only have to focus on the logic for your custom connector. The package takes care of:

- Creating a table if it does not exist
- Getting the latest date in the table if it exists, setting start date to the following day until yesterday
- Conditionally running locally or using a Cloud Function service account

Note:

- Currently defaults to montly table partitioning
- For running locally your project should contain service account `key.json` in the same folder
- You must provide a `default_start_date` and `source_schema`

# Example usage

```python
# Settings
source_schema = [
    bigquery.SchemaField("date", "DATE"),
    bigquery.SchemaField("order_id", "STRING"),
    bigquery.SchemaField("order_amount", "FLOAT"),
]
default_start_date = "2022-01-01"  # Required

def get_data_from_source(start_date, end_date):
    # Your custom source logic, should use start and end date


def main(request):
    print("⏩ Cloud Function invoked")
    project_id = request.args.get("project_id")
    dataset_id = request.args.get("dataset_id")
    table_id = request.args.get("table_id")

    BigQueryConnector.initialize(project_id, dataset_id, table_id)
    BigQueryConnector.ensure_table_exists(source_schema)
    start_date, end_date = BigQueryConnector.get_date_range(default_start_date)
    data = get_data_from_source(start_date, end_date, pub_key, priv_key)
    BigQueryConnector.load_data(data)

    print("✅ Data processing completed successfully")
    return


### For local testing, do not copy into cloud function
if __name__ == "__main__":

    class MockRequest:
        args = {
            "project_id": "project-name",
            "dataset_id": "dataset-name",
            "table_id": "table-name",
        }

    main(MockRequest())
```
streamlit-js-eval-no-logs 0.1.8
A custom Streamlit component to evaluate arbitrary Javascript expressions.
Requires Python: >=3.8
Keywords: Python, Streamlit, JavaScript

# Streamlit-JS-Eval

[![PyPI version](https://badge.fury.io/py/streamlit_js_eval.svg?service=github)](https://badge.fury.io/py/streamlit_js_eval) [![Downloads](https://static.pepy.tech/badge/streamlit-js-eval?service=github)](https://static.pepy.tech/badge/streamlit-js-eval)
[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)]([https://share.streamlit.io/streamlit/corp/main](https://aghasemi-streamlit-js-eval-example-yleu91.streamlitapp.com/))


SJE is a custom Streamlit component, built to evaluate arbitrary Javascript expressions and return the result. It can become useful in doing certain functionalities which are _simple_ things in JavaScript, but unavailable or difficult to do in Streamlit. Examples include cookie management, writing to clipboard, getting device width (e.g. to check if we are on a mobile device), getting browser language, sharing something through Android's share feature, knowing user agent, etc. See [MDN docs](https://developer.mozilla.org/en-US/docs/Web/API) for more information about Web APIs. 

- _Version 0.1.7 - March 2024_: Proposed a workaround for issue #2.


## Install

```python
pip3 install streamlit_js_eval
```

## Example

```python
st.write(f"Screen width is {streamlit_js_eval(js_expressions='screen.width', key = 'SCR')}")
```
`key` is an arbitrary but unique string, required by Streamlit components API for each call to `streamlit_js_eval`.

### Common JavaScript functionalities

Some more common functionalities are already implemented as Python functions. Examples include:

```python
# Returns user's location after asking for permission when the user clicks the generated link with the given text
location = get_geolocation()
# The URL parts of the page
location_json = get_page_location()
```

See `streamlit_js_eval/__init__.py` for more functions. Check a demo in `example.py` or [see it live](https://aghasemi-streamlit-js-eval-example-yleu91.streamlitapp.com/).

## Known Limitations

- It seems SJE has issues with `st.button` when getting called from inside a branch in Streamlit (e.g. in a loop, `if-else` block, ...). In version 0.1.7, you may use the custom `bootstrapButton` as a workaround in such situations.