semvec/pypi-packages huggingface dataset:
cas-tg 1.0.1
Checking if user banned by CAS (Combot Anti-Spam System)
Requires Python: >=3.6


check(id: str|int) -> bool
Check if a user banned by CAS (Combot Anti-Spam System).

- Args:
    - id (str | int): The user ID to be checked.

- Returns:
    - bool: Returns True if the user is banned or False if the user is not banned.

---

get_messages(id) -> dict[str, list, str]
Check information about user.
- Args:
    - id (str | int): The user ID to be checked.
- Returns:
    - dict[str, list, str]: Returns the number of spam messages, messages, and the time of the ban. If there is no user in ban, returns None.
pyedhrec 0.0.2
A simple package to interact with the excellent EDHRec site for Magic the Gathering
Requires Python: >=3.10
Keywords: magic,mtg,edhrec,magic the gathering,edh

# PyEDHRec

## Overview
This is a python wrapper around the excellent [EDHREC](https://edhrec.com/) website. Currently, EDHREC does not provide an API 
so the intent of this library is to enable people to build automated tooling around the useful information EDHREC provides.

## Installation
This package is available on PyPI and can be installed with pip
```bash
pip install pyedhrec
```

## Usage
Create an instance of the edhrec client
```python
from pyedhrec import EDHRec


edhrec = EDHRec()

# Reference cards by the exact card name, the library will format as needed
miirym = "Miirym, Sentinel Wyrm"

# Get basic card details
details = edhrec.get_card_details(miirym)

# Get details for a list of cards
card_list = edhrec.get_card_list(["Pongify", "Farseek"])

# Get an edhrec.com link for a given card
miirym_link = edhrec.get_card_link(miirym)

# Get combos for a card
miirym_combos = edhrec.get_card_combos(miirym)

# Get commander data 
miirym_commander_data = edhrec.get_commander_data(miirym)

# Get cards commonly associated with a commander
miirym_cards = edhrec.get_commander_cards(miirym)

# Get the average decklist for a commander
miirym_avg_deck = edhrec.get_commanders_average_deck(miirym)

# Get known deck lists for a commander
miirym_decks = edhrec.get_commander_decks(miirym)

# This library provides several methods to get specific types of recommended cards
new_cards = edhrec.get_new_cards(miirym)
high_synergy_cards = edhrec.get_high_synergy_cards(miirym)

# Get all top cards
top_cards = edhrec.get_top_cards(miirym)

# Get specific top cards by type
top_creatures = edhrec.get_top_creatures(miirym)
top_instants = edhrec.get_top_instants(miirym)
top_sorceries = edhrec.get_top_sorceries(miirym)
top_enchantments = edhrec.get_top_enchantments(miirym)
top_artifacts = edhrec.get_top_artifacts(miirym)
top_mana_artifacts = edhrec.get_top_mana_artifacts(miirym)
top_battles = edhrec.get_top_battles(miirym)
top_planeswalkers = edhrec.get_top_planeswalkers(miirym)
top_utility_lands = edhrec.get_top_utility_lands(miirym)
top_lands = edhrec.get_top_lands(miirym)

```

## Caching
To avoid excessive requests to edhrec.com this library uses in-memory caching for card retrieval methods. Each time you run 
a script using this library we'll cache the results for any given card. If you request the card again during the same execution we 
will use the cached value until the cache expires (defaults to 24 hours). If you use a long running script know that card data will only 
be updated once a day. Due to the nature of the game not changing often this should normally not cause issues and will help alleviate 
excessive traffic to EDHREC servers.
simple-observable 0.1.0
A simple observer pattern implementation
Requires Python: <4,>=3.7
Keywords: observer,observable

# simple-observable

A simple observer pattern implementation.

### Usage example

```python
from simple_observable import Observable


observable = Observable()


def my_callback(event):
    print(f"Called with {event}")


observable.add_listener("mytopic", my_callback)

observable.notify("mytopic", {"event_details": "hello"})

```

### Topic lifecycle events

The special topic `Observable.LIFECYCLE_EVENTS` can be used to perform an actions when new topics are added and existing ones are removed. 

```python
from simple_observable import Observable


observable = Observable()


def on_lifecycle_event(event):
    if event["event_type"] == observable.TOPIC_ADDED_EVENT:
        topic = event["topic"]
        print(f"topic lifecycle: added '{topic}'")
    if event["event_type"] == observable.TOPIC_REMOVED_EVENT:
        topic = event["topic"]
        print(f"topic lifecycle: removed '{topic}'")


observable.add_listener(observable.LIFECYCLE_EVENTS, on_lifecycle_event)


def my_callback(event):
    print(f"Called with {event}")


# the next line triggers a lifecycle event {"event_type": observable.TOPIC_ADDED_EVENT, "topic": "mytopic"}
listener_id = observable.add_listener("mytopic", my_callback)

observable.notify("mytopic", {"key": "value"})

# and the last line triggers a lifecycle event {"event_type": observable.TOPIC_REMOVED_EVENT, "topic": "mytopic"}
observable.remove_listener(listener_id)


```