semvec/pypi-packages huggingface dataset:
np-logging 0.5.1
Pre-configured file, web, and email logging for Mindscope neuropixels projects, repackaging code from AIBS mpeconfig.
Requires Python: >=3.7,<4.0

# np_logging

### *For use on internal Allen Institute network*



## Quick start

Follow the conventions for using the `logging` module in the standard library:

 - in a script or main module, `np_logging` adds console & file handlers and exit messages to the root logger:

```python
import np_logging

logger = np_logging.getLogger()
```


 - or, in a package or project with multiple modules, all logged messages are propagated to the root logger:
```python
import np_logging

logger = np_logging.getLogger(__name__)     # logger.level = logging.NOTSET = 0
```


 - then log messages as usual:

```python 
logger.info('test message')
logger.warning('test message')
```


No further setup is required, and importing `logging`
from the standard library isn't necessary.


***


To send a message to the Mindscope log-server, use `np_logging.web()` and supply a project name, which will
appear in the 
`channel` field on the server:

```python
project_name = 'spike_sorting'

np_logging.web(project_name).info('test message')
```
- the web log can be viewed at [http://eng-mindscope:8080](http://eng-mindscope:8080)

***


For customization, use `np_logging.setup()` to supply a logging config dict that specifies
loggers and their handlers & formatters, and np_logging will add extra functionality such as exit messages/emails.

- logging configs should be specified according to the python logging [library dict schema](https://docs.python.org/3/library/logging.config.html#logging-config-dictschema)


- logging configs on the `eng-mindscope` ZooKeeper server can also be used directly to setup
  logging by supplying their path to `np_logging.setup()`:

```python
np_logging.setup(
    '/projects/np_workflows/defaults/logging'
)
```

See [np_config](https://github.com/AllenInstitute/np_config) for further info on using ZooKeeper
for configs.



Other input arguments to `np_logging.setup()`:

- `project_name` (default: current working directory name) 
  
    - sets the `channel` displayed on the log server

- `email_address` (default: `None`)
      
    - if one or more addresses are supplied, an email is sent at program exit reporting the
      elapsed time and cause of termination. If an exception was raised, the
      traceback is included.

- `log_at_exit` (default: `True`)

    - If `True`, a message is logged when the program terminates, reporting total
      elapsed time.

- `email_at_exit` (default: `False`, or `True` if `email_address` is not `None`)

    - If `True`, an email is sent when the program terminates.
      
    - If `logging.ERROR`, the email is only sent if the program terminates via an exception.
sunsynkloggerapi 0.0.22
SynSynk Logger API Python Library
Requires Python: >=3.8, <4
Keywords: inverter,sunsynk,logger,python,library

# SunSynk Logger API
This Python library retrieves data on your Sunsynk Inverter (with SunSynk Logger), photovoltaic panels, and battery if you have one.

See <https://www.sunsynk.org/> for more information on Sunsynk inverters.

This code was developed on a Single SunSynk 5k with Panels and 1x BMS Connected and has not been tested against any other combinations.

This implementation does not interface directly with the SunSynk logger. Instead it connects to the SunSynk API and collects the information from there.

> DISCLAIMER: Use at your own risk!

## SunSynk Python Library

The Python library is available through pip:

```bash
pip install sunsynkloggerapi
```

## Example Usage

```python
import sunsynkloggerapi

sunsynk = sunsynkloggerapi.SunSynkLoggerAPI()
username = ""   # https://www.sunsynk.net Username
password = ""   # https://www.sunsynk.net Pasword

if  not sunsynk._isAuthenticated:
  await sunsynk.Login(username, password)
  await sunsynk.read()
  for i in sunsynk.inverters:
	  print("Inverter : (" + str(i.sn) +") " + i.alias)
```

## Credits

This library has been inspired by the amazing work of the following projects

https://github.com/kellerza/sunsynk
pysatl 1.2.6
Library to transport ISO7816-4 APDUs over anything
Requires Python: >=3.6

Python3 implementation of SATL
==============================

[![Docs Status](https://readthedocs.org/projects/satl/badge/)](https://readthedocs.org/projects/satl/badge/)

SATL stands for 'Simple APDU Transport Layer'. It is a simple way to exchange ISO7816-4 APDUs over interfaces not covered in ISO7816-3.

More info about SATL here: https://github.com/sebastien-riou/SATL

Python3 package documentation: https://satl.readthedocs.io/en/latest/
pg-sa-views 0.3.2
Adds CreateView and DropView constructs to SQLAlchemy

View Manipulation for SQLAlchemy
================================

Adds ``CreateView`` and ``DropView`` constructs to SQLAlchemy.

Status
------

Current version is 0.3.2; releases are infrequent as the code here is small and based on stable pieces of the SQLAlchemy API, so there has been minimal maintenance required so far to keep compatibility with new SQLAlchemy or python versions.

This package is working with latest Python and SQLAlchemy (1.0+ and 2.0) as of early 2023.

Usage
-----

Examples:

    >>> from sqlalchemy import Table, MetaData
    >>> from sqlalchemy.sql import text
    >>> from pg_sa_views import CreateView, DropView

    >>> view = Table('my_view', MetaData())
    >>> definition = text("SELECT * FROM my_table")
    >>> create_view = CreateView(view, definition)
    >>> print(str(create_view.compile()).strip())
    CREATE VIEW my_view AS SELECT * FROM my_table

    >>> create_view = CreateView(view, definition, or_replace=True)
    >>> print(str(create_view.compile()).strip())
    CREATE OR REPLACE VIEW my_view AS SELECT * FROM my_table

    >>> create_view = CreateView(view, definition, options={'check_option': 'local'})
    >>> print(str(create_view.compile()).strip())
    CREATE VIEW my_view WITH (check_option=local) AS SELECT * FROM my_table

    >>> drop_view = DropView(view)
    >>> print(str(drop_view.compile()).strip())
    DROP VIEW my_view

    >>> drop_view = DropView(view, if_exists=True, cascade=True)
    >>> print(str(drop_view.compile()).strip())
    DROP VIEW IF EXISTS my_view CASCADE

Note that the SQLAlchemy ``Table`` object is used to represent
both tables and views. To introspect a view, create a ``Table``
with ``autoload=True``, and then use SQLAlchemy's
``get_view_definition`` method to generate the second
argument to ``CreateView``.


Installation
------------

``sqlalchemy-views`` is available on PyPI and can be installed via ``pip`` ::

    pip install sqlalchemy-views


Limitations
-----------

Various SQL dialects have developed custom
``CREATE VIEW`` and ``DROP VIEW`` syntax.
This project aims to provide the core set of functionality
shared by most database engines.


Acknowledgements
----------------

Some design ideas taken from the
`SQLAlchemy Usage Recipe for views <https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/Views>`_.

Package structure is based on
`python-project-template <https://github.com/seanfisk/python-project-template>`_.

And thank you to the various
`contributors <https://github.com/jklukas/sqlalchemy-views/graphs/contributors>`_!
pygptwrapper 0.4.0
Python Wrapper for the ChatGPT API
Requires Python: >=3.8,<4.0

# pygptwrapper - A Python Wrapper for the ChatGPT API
pygptwrapper is a Python library that provides a simple way to interact with the ChatGPT API, which is a powerful language model trained by OpenAI that can generate human-like text based on input prompts.

This library makes it easy to integrate the ChatGPT API into your Python applications, allowing you to generate text in real-time, create chatbots, or automate text generation tasks. It provides context-based model using newly introduced model ```gpt-3.5-turbo```.

# Installation
To install pygptwrapper, you can use pip:

```python
pip install pygptwrapper
```

# Usage
Here's a basic example of how to use pygptwrapper:

```python
from pygptwrapper import ContextualGPT

# Instantiate the ContextualGPT object with a task and api_key
gpt = ContextualGPT(
    task="You are a chatbot assistant. You will give recommendations for restaurants."
    api_key=api_key
)
```

# Initiate a conversation with instanciated bot
```python
text = gpt.ask(question="What is the meaning of life?")
print(text)
```
This will generate a response from the ChatGPT API based on the input prompt. Notice that contextual conversation is stored in ```gpt.conversation```.