semvec/pypi-packages huggingface dataset:
ustrid 0.0.3
Uniquely generated string identifiers
License: MIT
Requires Python: >=3.5
Keywords: application,pyrustic

This package generates unique string identifiers.

```python
from ustrid import ustrid

unique_string_id = ustrid()
```

Under the hood:

```python
import uuid
import threading


def ustrid():
    """Generate a unique string identifier (thread-safe)"""
    return Ustrid.run()


class Ustrid:

    """Private class to generate unique string identifiers (thread-safe)"""
    _lock = threading.Lock()
    _count = 0

    @classmethod
    def run(cls):
        """Generate a unique string identifier (thread-safe)"""
        with cls._lock:
            cls._count += 1
            return "{}-{}".format(cls._count, uuid.uuid4())
```


**Installation:**
```bash
pip install ustrid
```
written 0.0.4
Try to atomically write data to a file
License: MIT
Requires Python: >=3.5
Keywords: application,pyrustic

This package attempts to atomically write data to a file.

**Example 1:**

```python
import written

data = "my text"
path = "/path/to/file.txt"

written.write(data, path)
```



**Example 2:**

```python
import written

data = b'my bin data'
path = "/path/to/file.bin"

written.write(data, path)
```

**Installation:**
```bash
pip install written
```