semvec/pypi-packages huggingface dataset:
rsc2507-test-module 0.0.1
first package for testing purpose
License: MIT
Keywords: calculator

{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0

\f0\fs24 \cf0 Package name - Func_groww_rsc\
\
Description - Contains function used by python scripts for Groww by Rohit Singh Chauhan\
}

{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0

\f0\fs24 \cf0 Change Log \
==========\
\
0.0.1 ( 24/04/2021)\
\'97\'97\'97\'97\'97\'97\'97\'97\'97\'97\'97\'97\'97\'97\
\
- First Release}
tgdsmells 1.0.0b0
Helper classes for the Team Group Data Sharing Medium & Electronic Local Link System.
License: MIT
Keywords: RLBot,protocol

# tgdsmells

## Helper classes for the Team Group Data Sharing Medium & Electronic Local Link System

Learn more about [TGDSMELLS](https://github.com/RLBot/RLBot/wiki/Team-Match-Communication-Protocol).

## Upgrading from TMCP

Upgrading from TMCP to TGDSMELLS is simple. All you need to do is replace `tmcp` with `tgdsmells` in your requirements.txt, and update the terminology in your imports.

---

## How to use

Start by creating an instance of the TGDSMELLSHandler.
You should pass in your agent.

```py
from tgdsmells import TGDSMELLSHandler

class MyBot(BaseAgent):
    def initialize_agent(self):
        self.tgdsmells_handler = TGDSMELLSHandler(self)
```

Usage is also very straightforward:

```py
from tgdsmells import TGDSMELLSMessage, ActionType

...
    def get_output(self, packet: GameTickPacket) -> SimpleControllerState:
        # Receive and parse all new matchcomms messages into TGDSMELLSMessage objects.
        new_messages: List[TGDSMELLSMessage] = self.tgdsmells_handler.recv()
        # Handle TGDSMELLSMessages.
        for message in new_messages:
            if message.action_type == ActionType.BALL:
                print(message.time)
        
        ...

        # You can send messages like this.
        self.tgdsmells_handler.send_boost_action(pad_index)

        # Or you can create them and send them more directly:
        my_message = TGDSMELLSMessage.ball_action(self.team, self.index, estimated_time_of_arrival)
        self.tgdsmells_handler.send(my_message)
```

The handler will throttle your messages if you send them too quickly.
If you want to make sure all of your messages are sent, you can create a backlog like this:

```py
# During initialization, create a backlog list.
self.backlog = []

...
# Sending returns false if a message was not sent.
if not self.tgdsmells_handler.send(message):
    self.backlog.append(message)

...
# In your main loop, check whether you have any messages in the backlog.
if self.backlog:
    backlog_message = self.backlog.pop(0)
    # Try sending the message again. If it doesn't work, return it to the backlog.
    if not self.tgdsmells_handler.send(backlog_message):
        self.backlog.insert(0, backlog_message)
```

## Avoiding major breaking changes

This package is regularly updated according to the latest TGDSMELLS specification.
To avoid your bot breaking during tournaments due to major version updates, you can use a virtual_environment and pin a specific version of this package.

In your requirements.txt:

```txt
tgdsmells==1.*
```

In your bot.cfg:

```toml
[Locations]
use_virtual_environment = true
requirements_file = ./requirements.txt
```

If you don't want to do this, you can also disable the handler if a different version of the package is used.
This will not send or receive any messages, but will pretend as if it was sending all and receiving none.

```py
from tgdsmells import TGDSMELLS_VERSION

if TGDSMELLS_VERSION[0] != 1:
    my_handler.disable()
```