semvec/pypi-packages huggingface dataset:
ros2-geek 0.2.0
ROS2 Geek
License: MIT
Requires Python: >=3.8

Create a Node and spin it without blocking.

Usually:
```python
import rclpy
from rclpy.node import Node
from threading import Thread

node = Node("robot", namespace="MK14QWZ024480005")
Thread(target=rclpy.spin, args=(node,), daemon=True).start()
```

Now:
```python
```

Create a publisher which publishes a message every 100ms.

Usually:
```python
msg = String()
publisher = node.create_publisher(String, "topic", 10)
timer = node.create_timer(0.1, lambda: publisher.publish(msg))
# update the message
msg.data = "Hello, world!"
```

Now:
```python
```

Wait for a message to be subscribed.

Usually:
```python
message = String()
def callback(msg):
    message.data = msg.data
subscriber = node.create_subscription(String, "topic", callback, 10)
while not message.data:
    rclpy.spin_once(node)
```

Now:
```python
```

The above comparison is just a simple example. For more complex examples, please read the following tutorial.
syntactic-cache 1.1.0
Syntactic cached property generator for classes.
License: MIT
Requires Python: >=3

# Syntactic Cache

![Tests](https://github.com/LeoTurnell-Ritson/syntactic-cache/actions/workflows/tests.yml/badge.svg)
[![codecov](https://codecov.io/gh/LeoTurnell-Ritson/syntactic-cache/branch/master/graph/badge.svg)](https://codecov.io/gh/leoturnell-ritson/syntactic-cache/)
[![PyPI version](https://img.shields.io/pypi/v/syntactic-cache.svg)](https://pypi.org/project/syntactic-cache)

Syntactic Cache is a Python library that allows you to automatically create cached properties for methods in your classes, using the syntax of the methods to determine which methods should be cached. 

I.e, methods with a given prefix will have a cached property created for them using the method name without the prefix, this allows for easy refactoring of existing code adding cached properties of functions 'for free'. The cache is a simple memory cache linked to each instance of the class. 

## Installation

You can install Syntactic Cache using pip.

```bash
pip install syntactic-cache
```

## Usage

Here's a simple example of how to use the `@make_cached_properties` decorator.

```python
from syntactic_cache import do_not_make_cached_property, make_cached_properties

@make_cached_properties('get', 'is')
class MyClass:
    def __init__(self, value):
        self.value = value

    def get_power(self, exponent):
        return self.value ** exponent

    def get_square(self):
        return self.get_power(2)

    @do_not_make_cached_property
    def get_cube(self):
        return self.get_power(3)

    def is_even(self):
        return self.value % 2 == 0

instance = MyClass(3)

print(instance.get_square())  # 9, does not use the cache,
print(instance.get_cube())    # 27, does not use the cache.

print(instance.square)  # 9, sets and uses the cache.
print(instance.cube)    # Raises AttributeError, as making cached properties is disabled.
print(instance.power)  # Raises AttributeError, as will not make cached properties for methods with arguments.

print(instance.is_even())  # False, does not use the cache.
print(instance.even)  # False, sets and uses the cache.
```