semvec/pypi-packages huggingface dataset:
ycolor 1.1.1
A convenient color text printing tool

# Ycolor<br>
made by Yourouchour<br>
My English is not good,so the following content comes from my translation software.<br>
### Description<br>
Ycolor is a conventional color text printing tool.<br>
### How to use<br>
Ycolor 1.0.x uses four functions to print color text.<br>
```python
from ycolor import *
printcolor('Hello, world',fore=Fore.RED,back=Back.WHITE)
printcolor_text('Hello, world',color='RED+WHITE')
printcolor_int('Hello, world',color='0xfe')
```
### Historical version<br>
v1.0.1 Two functions are created to print color text.<br>
v1.0.2 Some modules are hidden to make the display more concise.<br>
v1.0.3 Added function printcolor_int.<br>
frappyflaskdataset 1.3.3
Flask Endpoints for Data Set Management and Retrieval

# Flask Data Sets

Flask Endpoints for Data Set Management and Retrieval

1. [Example Usage](#example-usage)
2. [Options](#options)

## Example Usage

```python
from frappyflaskdataset import register_endpoints
from frappyflaskauth import check_login_state
from flask import Flask

app = Flask(__name__)
# create store instances for data sets
data_store = ...
# register the endpoints
register_endpoints(app, data_store, options={
    "manage_permission": "manage",
    "login_check_function": check_login_state,
})
```

## Options

Options for the `register_endpoints` function are:

- `api_prefix` - default `/api/data-sets` - is the prefix under which the endpoints will be registered. This should
 match the prefix used in the front-end.
- `manage_permission` - default `None` - the permission required to manage data sets (upload, update, delete), if `None`
 is provided the user just needs to be logged in.
- `get_permission` - default `None` - the permission required to fetch data sets via the API. This can be different from
 the `manage_permission`.
- `data_folder` - default `_data` - the local directory where to store data files (images primarily). This is relative
 to your applications root directory (from where you execute the start command)
- `login_check_function` - default `None` - provide a function that performs authentication and uses Flask's `abort` in
 case the login / permission check fails. The function has 1 parameter for the required permission. You can use
 `check_login_state` from the `frappyflaskauth` package.
- `allow_public_binary_access` - default `False` - a boolean flag that, when set to `True` will allow even
 unauthenticated users to download the files from **all** `BINARY` data sets and `IMAGE` data sets. This allows to
 directly include `<img src="/api/data-sets/<id>/image">` without running into authentication issues (requires using
 `ImageView`)
frappyflaskcontent 1.1.1
Flask Endpoints for Content Management and Retrieval

# Flask Content

Flask Endpoints for Content Management and Retrieval

1. [Example Usage](#example-usage)
2. [Options](#options)

## Example Usage

```python
from frappyflaskcontent import register_endpoints
from frappyflaskauth import check_login_state
from flask import Flask

app = Flask(__name__)
# create store instances for content
content_store = ...
# register the endpoints
register_endpoints(app, content_store, options={
    "manage_permission": "manage",
    "login_check_function": check_login_state,
})
```

## Options

Options for the `register_endpoints` function are:

- `api_prefix` - default `/api/content` - is the prefix under which the endpoints will be registered. This should
 match the prefix used in the front-end.
- `manage_permission` - default `None` - the permission required to manage content (create, update, delete), if `None`
 is provided the user just needs to be logged in.
- `get_permission` - default `None` - the permission required to fetch content via the API. This can be different from
 the `manage_permission`.
- `login_check_function` - default `None` - provide a function that performs authentication and uses Flask's `abort` in
 case the login / permission check fails. The function has 1 parameter for the required permission. You can use
 `check_login_state` from the `frappyflaskauth` package.
- `allow_get_without_auth` - default `True` - whether an anonymous user can retrieve content via the GET endpoints.
frappymongodataset 1.3.3
Store Implementation for Data Sets in MongoDB

# MongoDB User Stores for Python

Python Store Implementation for Data Sets in MongoDB

1. [Usage](#usage)
2. [Methods](#methods)

## Usage

```python
from frappymongodataset import DataStore

MONGO_URL = "mongodb://localhost:27017"
data_set_store = DataStore(mongo_url=MONGO_URL, mongo_db="myDatabase", collection_name="dataSets")

all_data_sets = data_set_store.get_all()
specific_data_sets = data_set_store.get_by_assignment("primaryKey")
```

The return objects from `get` methods are objects of type `Data`. `Data` provides an attribute `payload`, which returns
the type of payload represented by the data set. These types are:

- `DataImagePayload` for images providing attributes `image_path`, `width` and `height`
- `DataJsonPayload` providing the JSON payload with the attribute `data`
- `DataTimeSeriesPayload` providing attributes `columns`, `data` (the rows), `date_format`, `index_column` and
 `column_mapping`

**Examples**

```python
from frappymongodataset import DataTypes

images = data_set_store.get_by_type(DataTypes.IMAGE)
print(images[0].payload.path, images[0].payload.dimensions["width"], images[0].payload.dimensions["height"])
# prints out something like: "_data/5e846d104e61db060094ed14.jpg 1200 600"
nd_array = images[0].to_np_array()  # will only work for IMAGE

time_series = data_set_store.get_by_type(DataTypes.TIME_SERIES)
print(time_series[0].payload.columns)
df = time_series[0].to_pd_data_frame()  # will only work for TIME_SERIES
```

## Methods

Base methods provided by [`pbu`](https://pypi.org/project/pbu/)

- `get_all()` - contrary to other stores, this will not return the payload of the individual data sets, but just the
 meta information
- `update_meta(data_id, meta_update)` - updating meta information, needs to contain "label" and "assignments" update
- `get_by_type(data_type)` - filters by the data sets `type` attribute
- `get_by_assignment_and_type(assignment_id, data_type)` - filters by the data sets `type` attribute and has to have an
 assignment for the group `assignment_id`
- `get_by_assignment(assignment_id)` - just checks for an `assignments` to the group provided
- `get_by_assignment_type(assignment_id, assignment_type)` - not to be confused with `get_by_assignment_and_type` - this
 method will check for the `assignment_id` in the `assignments`, and within that (a list of identifier) assignment for
 the type `assignment_type`
frappymongocontent 1.0.1
Store Implementation for Content in MongoDB

# Python MongoDB Content Store

Python Store Implementation for Content in MongoDB

## Usage

```python
from frappymongocontent import ContentStore

MONGO_URL = "mongodb://localhost:27017"
content_store = ContentStore(mongo_url=MONGO_URL, mongo_db="myDatabase", collection_name="content")
content_list = content_store.find_by_reference("my-demo")
for item in content_list:
    print(item.content, "is a dictionary with all the content")
```

## Methods

Base methods provided by [`pbu`](https://pypi.org/project/pbu/)

- `find_by_reference(references)` - retrieves content associated with the provided reference ID (e.g. `demo1`). This
 maps to the references declared by the embedding of the frontend module
 [`@frappy/react-content`](https://github.com/ilfrich/frappy-react-content)
- `find_by_reference_and_content_type(references, content_type)` - similar to `find_by_reference`, this additionally
 filters by content type as well. Content types are also declared by the embedding of the frontend module.
- `update_content(content_id, label, references, content)` - this is a complete update of the data (except for the
 content type, which shouldn't change with regular updates). This will completely replace a content objects label,
 reference assignment and the entire content (provided as `list` or `dict`, depending on the type of content (declared
 in the embedding of the frontend module)