semvec/pypi-packages huggingface dataset:
py-extensions-alogging 0.1.1
Async Logging for Python
License: MIT
Requires Python: >=3.9,<4.0
Keywords: logging,async,asyncio,python,py-extensions

# alogging

`alogging` is a Python library that provides asynchronous logging capabilities. It is designed to work with the standard Python `logging` module, but adds asynchronous functionality to improve performance in applications that make heavy use of logging.

## Features

- Asynchronous logging: Log messages are processed in a separate process to avoid blocking the main application.
- Compatibility: Works with the standard Python `logging` module, so you can use all the features and handlers you're familiar with.
- Flexibility: Provides a variety of handlers, including `RotatingFileHandler`, `HTTPHandler`, `SMTPHandler`, `SysLogHandler`, and more.

## Usage

To use `alogging`, you first need to start the backend process. This can be done using the `start_backend` method:

```python
import asyncio
import alogging

asyncio.run(alogging.start_backend())
```

You can then get a logger and use it just like you would with the standard `logging` module:

```python3
log = alogging.getLogger("my_logger")
log.info("This is an info message")
```

You can also configure the logger using the `basicConfig` function:

```python3
alogging.basicConfig(
    filename="test.log",
    level=alogging.DEBUG,
    format="%(name)s - %(levelname)s - %(message)s",
)
```

## Handlers

`alogging` provides a variety of handlers that you can use to control where your log messages go. These include:

- `RotatingFileHandler`: Writes log messages to a file, with support for automatic rotation when the file reaches a certain size.
- `HTTPHandler`: Sends log messages to a web server as HTTP POST requests.
- `SMTPHandler`: Sends log messages to an email address using SMTP.
- `SysLogHandler`: Sends log messages to a Unix syslog daemon.

To use a handler, you need to create an instance of it and add it to your logger:

```python3
handler = alogging.handlers.RotatingFileHandler("test.log", maxBytes=10000, backupCount=5)
log.addHandler(handler)
```

## Installation

You can install `alogging` using pip:

```
pip install py-extensions-alogging
```

Or add it using poetry:

```
poetry add py-extensions-alogging
```

## Contributing

Contributions to `alogging` are welcome. Please submit a pull request or create an issue on GitHub.

## License

`alogging` is licensed under the MIT License. See [LICENSE](LICENSE) for more information.
quantscripts 0.1.5
A package for calculating statistical data in finance
License: MIT

# Financial Analysis Scripts

This repository contains a collection of Python scripts for financial analysis. The scripts cover various aspects such as Cointegration Testing, Duration Calculation, and Statistical Features computation.

## Scripts

### CointegrationTest

The `CointegrationTest` script is designed for conducting cointegration tests on financial time series data. Cointegration is a statistical property that allows two or more time series to move together over time. This script provides functionalities for performing cointegration tests and analyzing the results.

### Duration

The `Duration` script focuses on calculating the duration of financial instruments. Duration is a measure of the sensitivity of the price of a bond or other debt instrument to a change in interest rates. This script allows users to compute the duration of financial instruments based on given parameters.

### StatisticalFeatures

The `StatisticalFeatures` script is dedicated to computing various statistical features of financial datasets. This includes measures such as mean, standard deviation, skewness, and kurtosis. These statistical features provide insights into the distribution and characteristics of the data.

## Usage

To use these scripts, follow these general steps:

git clone https://github.com/tonyyang1223/quantscripts.git
cd quantscripts

## Build
setup.py sdist bdist_wheel
twine upload dist/*
cdpop 1.0.0
Pop open cash drawer with http GET request
License: MIT
Requires Python: >=3.9
Keywords: tornado

# cdpop

Pop open cash drawer using http or https GET request:

	GET /status	Return cash drawer status
	GET /open	Request cash drawer open

If authentication is configured, supply user and/or auth
as query parameters, eg:

	GET /status?auth=Ricim8Knak

Requests to open drawer will return successfully (200) as
soon as possible, but will be processed in turn once access
to the attached device is available. No feedback is provided for
an open request.

Requests for status will block until a valid status can be read
from the attached device. In the case of a hardware error,
status requests will return Internal Server Error (500).

## Usage

	$ cdpop [config.json]

## Requirements

   - python >= 3.9
   - tornado
   - posiflex-hidcd

## Configuration

Copy example config to a new file and edit as required.
Available configuration options:

   - port (int) TCP service port, default: 41514 (optional)
   - host (string) Listen address, default: "localhost" (optional)
   - cert (string) TLS certificate path, default: None (optional)
   - key (string) TLS private key path, default: None (optional)
   - auth (string) Authorisation key, default: None (optional)
   - user (string) Authorisation username, default: None (optional)
   - drawer (int) Cash drawer number, default: None (optional)

Notes:

   - If drawer number is not specified, cdpop will connect to
     the first hid cash drawer found. See related project
     [posiflex-hidcd](https://github.com/ndf-zz/posiflex-hidcd)
     for details.
   - To listen on all addresses, specify the empty string "" for host.


## MacOS Installation

Install xcode developer tools:

	$ xcode-select --install

Install brew according to [brew website](https://brew.sh/).

Install hidapi using brew:

	$ brew install hidapi

Install python3 if not already installed:

	$ brew install python@3.12

Using python, create a venv and install cdpop packages using pip:

	$ python3 -m venv cdpop --system-site-packages
	$ ./cdpop/bin/pip install cdpop

Optionally, create a cdpop config file.

Create launch agent plist file (see example cdpop.plist),
copy to ~/Library/LaunchAgents and enable using launchctl:

	$ cp cdpop.plist /Library/LaunchAgents
	$ launchctl load ~/Library/LaunchAgents/cdpop.plist
	$ launchctl enable xxx/yyy/cdpop
	$ launchctl kickstart -k xxx/yyy/cdpop
aiocent 4.1.2
Async Python library to communicate with Centrifugo v3 HTTP API, fork of pycent package
License: MIT

# AIOCENT
## async fork of pycent

Async Python tools to communicate with Centrifugo HTTP API. Python >= 3.3 supported.

To install run:

```bash
pip install aiocent
```

### High-level library API

First see [available API methods in documentation](https://centrifugal.dev/docs/server/server_api#http-api).

This library contains `Client` class to send messages to Centrifugo from your python-powered backend:

```python
from aiocent import Client
import asyncio

url = "http://localhost:8000/api"
api_key = "XXX"

# initialize client instance.
client = Client(url, api_key=api_key, timeout=1)

# publish data into channel
channel = "public:chat"
data = {"input": "test"}
asyncio.run(client.publish(channel, data))

# other available methods
asyncio.run(client.unsubscribe("user_id", "channel"))
asyncio.run(client.disconnect("user_id"))
history = asyncio.run(client.history("public:chat"))
presence = asyncio.run(client.presence("public:chat"))
channels = asyncio.run(client.channels())
info = asyncio.run(client.info())
asyncio.run(client.history_remove("public:chat"))
```

`publish`, `disconnect`, `unsubscribe`, `history_remove` return `None` in case of success. Each of this commands can raise an instance of `CentException`.

I.e.:

```python
from aiocent import Client, CentException
import asyncio

client = Client("http://localhost:8000/api", api_key="XXX", timeout=1)
try:
    asyncio.run(client.publish("public:chat", {"input": "test"}))
except CentException:
    # handle exception
```

Depending on problem occurred exceptions can be:

* RequestException – HTTP request to Centrifugo failed
* ResponseError - Centrifugo returned some error on request

Both exceptions inherited from `CentException`.

### Low-level library API:

To send lots of commands in one request:

```python
from aiocent import Client, CentException
import asyncio

client = Client("http://localhost:8000/api", api_key="XXX", timeout=1)

params = {
    "channel": "python",
    "data": "hello world"
}

asyncio.run(client.add("publish", params))

try:
    result = asyncio.run(client.send())
except CentException:
    # handle exception
else:
    print(result)
```

You can use `add` method to add several messages which will be sent.

You'll get something like this in response:

```bash
[{}]
```

I.e. list of single response to each command sent. So you need to inspect response on errors (if any) yourself.

### Client initialization arguments

Required:

* address - Centrifugo HTTP API endpoint address

Optional:

* `api_key` - HTTP API key of Centrifugo 
* `timeout` (default: `1`) - timeout for HTTP requests to Centrifugo
* `json_encoder` (default: `None`) - set custom JSON encoder
* `send_func` (default: `None`) - set custom send function
* `verify` (default: `True`) - when set to `False` no certificate check will be done during requests.

## For maintainer

To release:

1. Bump version in `setup.py`
1. Changelog, push and create new tag
1. `pip install twine`
1. `pip install wheel`
1. `python setup.py sdist bdist_wheel`
1. `twine check dist/*`
1. `twine upload dist/*`
posiflex-hidcd 1.0.0
USB HID Cash Drawer Interface
License: MIT
Requires Python: >=3.9
Keywords: posiflex,cr-4xxx,usb,hid

# posiflex-hidcd

Example interface for Posiflex USB HID Cash Drawer

## Usage

	from hidcd import HidCd
	cd = HidCd(7)  # use cash drawer with id=7
	if cd.closed():
	    cd.open()

## Requirements

   - [hidapi-cffi](https://pypi.org/project/hidapi-cffi/)

On linux, read/write access to the hid device
file may be required. See example udev rule
72-posiflex-hid.rules for a possible approach.

## Device Info

Tested with Posiflex CR-4115G2/CR-4000 Series:

	ID 0d3a:020X Posiflex Technologies, Inc. Series 3xxx Cash Drawer

HID Descriptor:

	0x06, 0xA0, 0xFF,  // Usage Page (Vendor Defined 0xFFA0)
	0x09, 0x01,        // Usage (0x01)
	0xA1, 0x01,        // Collection (Application)
	0x09, 0x02,        //   Usage (0x02)
	0x15, 0x00,        //   Logical Minimum (0)
	0x26, 0xFF, 0x00,  //   Logical Maximum (255)
	0x75, 0x08,        //   Report Size (8)
	0x95, 0x78,        //   Report Count (120)
	0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
	0x09, 0x03,        //   Usage (0x03)
	0x15, 0x00,        //   Logical Minimum (0)
	0x26, 0xFF, 0x00,  //   Logical Maximum (255)
	0x75, 0x08,        //   Report Size (8)
	0x95, 0x78,        //   Report Count (120)
	0x91, 0x02,        //   Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
	0xC0,              // End Collection
 
## Protocol

Command (120 bytes, host to device):

	[CDNUM] [COMMAND] 0x00 ... 0x00

   - [CDNUM] is the drawer number (0-7)
   - [COMMAND] is one of:
      - CDNUM: Open drawer
      - CDNUM+1: Drawer status

Status (120 bytes, device to host):

	[STATUS] 0x?? ... 0x??

   - STATUS is (CDNUM<<4)|CLOSED:
      - CLOSED==0: Drawer is open
      - CLOSED==1: Drawer is closed

## Notes

   - Open command is the drawer number
   - Status command is drawer number plus one
   - Command D0 returns garbage bytes from cash drawer
   - Commands C0 and E0 do not appear to function
   - Command F0 will set device into ISP (bootloader) mode

If cash drawer is in ISP (bootloader) mode, it will report a
USB product ID of 0x0c23:

	ID 0d3a:0c23 Posiflex Technologies, Inc. USB  MSR  BL V200

In this case, the Posiflex firmware programming util (available
from manufacturer tech support) can be used to revert the
device to HID mode and restore function. The tool may also be
used to convert the device to "Virtual Com Port" mode which
may be more convenient.
scArches 0.6.1
Transfer learning with Architecture Surgery on Single-cell data
License: MIT

.. raw:: html

 <img src="https://user-images.githubusercontent.com/33202701/187203672-e0415eec-1278-4b2a-a097-5bb8b6ab694f.svg" width="300px" height="200px" align="center">

|PyPI| |PyPIDownloads| |Docs|


Single-cell architecture surgery (scArches) is a package for reference-based analysis of single-cell data.


What is scArches?
-------------------------------
scArches allows your single-cell query data to be analyzed by integrating it into a reference atlas. By mapping your data into an integrated reference you can transfer cell-type annotation from reference to query, identify disease states by mapping to healthy atlas, and advanced applications such as imputing missing data modalities or spatial locations.


Usage and installation
-------------------------------
See `here <https://scarches.readthedocs.io/>`_ for documentation and tutorials.

Support and contribute
-------------------------------
If you have a question or new architecture or a model that could be integrated into our pipeline, you can
post an `issue <https://github.com/theislab/scarches/issues/new>`__ or reach us by `email <mo.lotfollahi@gmail.com>`_.

Reference
-------------------------------
If scArches is helpful in your research, please consider citing the following `paper <https://www.nature.com/articles/s41587-021-01001-7>`_:
::


       @article{lotfollahi2021mapping,
         title={Mapping single-cell data to reference atlases by transfer learning},
         author={Lotfollahi, Mohammad and Naghipourfar, Mohsen and Luecken, Malte D and Khajavi,
         Matin and B{\"u}ttner, Maren and Wagenstetter, Marco and Avsec, {\v{Z}}iga and Gayoso,
         Adam and Yosef, Nir and Interlandi, Marta and others},
         journal={Nature Biotechnology},
         pages={1--10},
         year={2021},
         publisher={Nature Publishing Group}}




.. |PyPI| image:: https://img.shields.io/pypi/v/scarches.svg
   :target: https://pypi.org/project/scarches

.. |PyPIDownloads| image:: https://pepy.tech/badge/scarches
   :target: https://pepy.tech/project/scarches

.. |Docs| image:: https://readthedocs.org/projects/scarches/badge/?version=latest
   :target: https://scarches.readthedocs.io