semvec/pypi-packages huggingface dataset:
obc 2.1.0
The Open Badges Client
License: MIT
Requires Python: >=3.10
Keywords: Openbadge,API

# OBC, the Open Badges Client

`obc` is a python library that provides a standard API to interact with Open
Badge platforms.

## Quick start guide

### Install OBC

`obc` is distributed as a python package. It can be installed using `pip` (or
any other package manager) from PyPI:

```
$ pip install obc
```

### Use providers in your application

Let say you want to issue an existing Open Badge Factory badge for a list of
recipients, an example implementation would look like:

```python
from obc.providers.obf import BadgeIssue, BadgeQuery, OBF

# Configure Open Badge Factory provider using your client identifier and secret
# key
obf = OBF(client_id="my_obf_client_id", client_secret="super_secret")

# Get the badge with the "badge_id" identifier
badge = await anext(obf.badges.read(query=BadgeQuery(id="badge_id")))

# We want to issue a badge for the following recipients
issue = BadgeIssue(
    recipient=[
      "jane@example.org",
      "tarzan@example.org"
    ]
)

issue = await obf.badges.issue(badge, issue)
```

More details will follow in the upcoming documentation.

### Hack on the project

If you want to start contributing on the project, use the `bootstrap` Makefile
target to build the Docker development image:

```
$ make bootstrap
```

To run tests, type:

```
$ make test
```

And to lint sources, there is also a command for that:

```
$ make lint
```

If you had new dependencies to the project, you will have to rebuild the Docker
image (and the development environment):

```
$ make build && make dev
```

You can explore all other target using:

```
$ make help
```

## Contributing

This project is intended to be community-driven, so please, do not hesitate to
get in touch if you have any question related to our implementation or design
decisions.

We try to raise our code quality standards and expect contributors to follow
the recommandations from our
[handbook](https://openfun.gitbooks.io/handbook/content).

## License

This work is released under the MIT License (see [LICENSE](./LICENSE)).
coar 1.22
Clustering of association rules based on user defined thresholds.
License: MIT
Requires Python: >=3.11
Keywords: coar,clustering of association rules,association rule clustering,association rules,association rule processingclustering,cluster analysis,database knowledge mining,data mining,data analysis

# coar

**coar** is implementation of clustering of association rules based on user defined thresholds.

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install **coar**.

```bash
pip install coar
```

## Usage

Usage is displayed on association rules mined using [Cleverminer](https://www.cleverminer.org/) using modified version of [CleverMiner quickstart example](https://www.cleverminer.org/docs-page.html#section-3). You need to install **cleverminer** first.

```bash
pip install cleverminer
```

Mining association rules using **cleverminer**:

```python
# imports
import json
import pandas as pd
from cleverminer import cleverminer

# getting the source file
df = pd.read_csv(
    'https://www.cleverminer.org/hotel.zip', 
    encoding='cp1250', 
    sep='\t'
)

# selecting the columns
df = df[['VTypeOfVisit', 'GState', 'GCity']]


# mining association rules
clm = cleverminer(
    df=df, proc='4ftMiner',
    quantifiers={'conf': 0.6, 'Base': 50},
    ante={
        'attributes': [
            {'name': 'GState', 'type': 'subset', 'minlen': 1, 'maxlen': 1},
            {'name': 'GCity', 'type': 'subset', 'minlen': 1, 'maxlen': 1},
        ], 'minlen': 1, 'maxlen': 2, 'type': 'con'},
    succ={
        'attributes': [
            {'name': 'VTypeOfVisit', 'type': 'subset', 'minlen': 1, 'maxlen': 1}
        ], 'minlen': 1, 'maxlen': 1, 'type': 'con'},
)

# saving rules to file
with open('rules.json', 'w') as save_file:
    save_file.write(json.dumps(clm.rulelist))


```

Clustering rules using **coar**:

```python
# imports
import json
import pandas as pd

from coar.cluster import agglomerative_clustering, cluster_representative


# loading rules
rule_file = open('rules.json')
rule_list = json.loads(rule_file.read())

# creating dataframe
df = pd.DataFrame.from_records([{
    'antecedent': set(attr for attr in rule['cedents_str']['ante'].split(' & ')),
    'succedent': set(attr for attr in rule['cedents_str']['succ'].split(' & ')),
    'support': rule['params']['rel_base'],
    'confidence': rule['params']['conf']
} for rule in rule_list])

# clustering
clustering = agglomerative_clustering(
    df,
    abs_ante_attr_diff_threshold=1,
    abs_succ_attr_diff_threshold=0,
    abs_supp_diff_threshold=1,
    abs_conf_diff_threshold=1,
)

# getting cluster representatives
clusters_repr = cluster_representative(clustering)

```

## Contributing

If you find a bug 🐛, please open a [bug report](https://github.com/jmichalovcik/coar/issues/new?assignees=jmichalovcik&labels=bug).
If you have an idea for an improvement, new feature or enhancement 🚀, please open a [feature request](https://github.com/jmichalovcik/coar/issues/new?assignees=jmichalovcik&labels=enhancement).

## License
[MIT](https://github.com/jmichalovcik/coar/blob/master/LICENSE)