semvec/pypi-packages huggingface dataset:
wayscript 0.4.0
Quickly build services, data pipelines, internal tools, and more.
License: MIT
Keywords: wayscript,productivity,software,scripts,cloud,tools,backend,trigger,integration,dev,http,webhook

# wayscript-python

## Context

```
from wayscript import context

event = context.get_event()
```

### Checking user by application key
```
from wayscript import context, utils

application_key = utils.get_application_key()
user = context.get_user_by_application_key(application_key)
```
## Triggers

### HTTP Triggers

```
from wayscript.triggers import http_trigger

payload = {"hello": "world"}
headers = {"content-type": "application/json"}
status_code = 200

http_trigger.send_response(data=payload, headers=headers, status_code=status_code)
```

## Integrations

### SQL

To connect to a postgres resource, use the following snippet:
```
import psycopg2
from wayscript.integrations import sql

kwargs = sql.get_psycopg2_connection_kwargs(_id)
connection = psycopg2.connect(**kwargs)
```

## Secrets

### Create/Update Secret

To create a new secret, or update an existing one:
```
from wayscript import secret_manager

my_secret_value = "an application key or other private information"
secret_manager.set_secret('my_secret_key', my_secret_value)
    
```

To test an existing secret, and update if the secret is no longer valid (expired authorization token):
```
import os
from wayscript import secret_manager

# Retrieve existing key from secret
auth_key = os.getenv('AUTH_KEY_MAY_EXPIRE')

# Test connection to service using auth_key
if not authorized:
    # Get new auth_key from service
    auth_key = 'New Key From Service Request'
    secret_manager.set_secret('AUTH_KEY_MAY_EXPIRE', auth_key)

# Continue flow as normal
```
quantgov 0.6.4
A Policy Analytics Framework
License: MIT
Keywords: quantgov economics policy government machine learning

QuantGov
========

========== ====================
Branch       Build Status
========== ====================
**Master** |Master Test Status|
**Dev**    |Dev Test Status|
========== ====================

The QuantGov library is a companion to the `QuantGov Platform
<http://www.quantgov.org>`_. It provides an easy way to start a new project
using the ``quantgov start`` set of commands, and also provides a set of
classes and functions often used in the QuantGov framework.

To install the library, use ``pip install quantgov``.

A tutorial of the library is available at https://quantgov.github.io/quantgov-tutorial/pages/intro.html.

.. |Master Test Status| image:: https://travis-ci.org/QuantGov/quantgov.svg?branch=master
    :target: https://travis-ci.org/QuantGov/quantgov

.. |Dev Test Status| image:: https://travis-ci.org/QuantGov/quantgov.svg?branch=dev
    :target: https://travis-ci.org/QuantGov/quantgov


How to Contribute
-----------------

#. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
#. Fork `the repository`_ on GitHub to start making your changes to the **dev** branch (or branch off of it).
#. Write a test which shows that the bug was fixed or that the feature works as expected.
#. Send a pull request and bug the maintainer until it gets merged and published. Make sure to add yourself to AUTHORS_.

.. _`the repository`: http://github.com/quantgov/quantov
.. _AUTHORS: https://github.com/quantgov/quantgov/blob/master/AUTHORS.rst
mpi-print 0.1.0
<Enter a one-sentence description of this project here.>
License: MIT
Requires Python: >=3.7,<4.0

*********
mpi-print
*********

Print statements from MPI programs can be confusing, as you do not now
by which rank the output was produced. The import of

.. code-block:: python

    from mpi_print import print

overloads the the builtin print function to first print the rank and
a timestamp. E.g.

.. code-block:: python

    from mpi_print import print, builtin_print
    builtin_print('hello world.') # prints:
    #   hello world.
    print('hello world.') # prints:
    #   MPI rank: 1 [timestamp: 2023-02-02 20:48:26.544420]
    #   hello world.

* Documentation: https://mpi_print.readthedocs.io