semvec/pypi-packages huggingface dataset:
pubq 1.2.1
PUBQ Python SDK
License: MIT
Requires Python: >=3.8,<4.0

# PUBQ Python SDK

[PUBQ](https://pubq.io) is a pub/sub channels cloud and this is the official Python client library including both real-time and REST interfaces.

To meet PUBQ and see more info and examples, please read the [documentation](https://pubq.io/docs).

# Getting Started

Follow these steps to just start building with PUBQ in Python or see the [Quickstart guide](https://pubq.io/docs/getting-started/quickstart) which covers more programming languages.

## Install with package manager

The Python SDK is available as PyPI package:

```bash
pip install pubq
```

## Interacting with PUBQ

Get your application id and key from [PUBQ dashboard](https://dashboard.pubq.io) by [creating a new app](https://dashboard.pubq.io/applications/create) or use existing one.

Connect to PUBQ:

```python
import asyncio
from pubq import Pubq

async def main():
    def on_connected(state):
        print("Connected to PUBQ!")

    realtime = Pubq.RealTime({"key": "YOUR_API_KEY"})

    realtime.connection.on("connected", on_connected)

asyncio.run(main())
```

Subscribe a channel and listen for any data publish to receive:

```python
def on_message(msg):
    print("Received new data: " + str(msg.data))

channel = realtime.channels.get("my-channel")
channel.subscribe(on_message)
```

Publish a message:

```python
channel.publish("Hello!")
```

Publish a message with REST interface:

```python
import asyncio
from pubq import Pubq

async def main():
    rest = Pubq.REST({"key": "YOUR_API_KEY"})
    channel = rest.channels.get("my-channel")
    channel.publish("Hello!")
asyncio.run(main())
```

# Development

Please, read the [contribution guide](https://pubq.io/docs/basics/contribution).

## Setup

```bash
git clone git@github.com:pubqio/pubq-python.git
cd ./pubq-python/
poetry install
```

## Build

```bash
poetry build
```

## Tests

To run tests using pytest:

```bash
poetry run pytest
```

## Example

To run pubsub example:

```bash
cd examples/
python pubsub.py
```
fastauth-client 0.1.0
A utility for printing colored messages to the console.
License: MIT
Keywords: Console,Colorful Output,CLI,Text Formatting

# Console Package

Console is a Python package that provides a `Console` class with methods to print messages in different colors. It also serves as a simple example of creating and packaging a Python module.

## Installation

You can install the package using `pip`. Make sure you have a Python virtual environment activated.

```bash
pip install console-py
```

## Documentation

```py
from console import Console

# Create an instance of the Console class
console = Console()

# Use different methods to print messages in various colors
console.info("Information message")
console.warn("Warning message")
console.error("Error message")
console.success("Success message")
console.secondary("Secondary message")
```

## Contributing

If you want to contribute to this project, feel free to fork the repository, make changes, and submit a pull request.