Metadata-Version: 2.1
Name: lstr
Version: 0.0.0a1
Summary: Partially lockable strings
Home-page: https://github.com/cariad/lstr
Author: Cariad Eccleston
Author-email: cariad@hey.com
License: MIT License
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: colorama (>=0.4)

# lstr: Lockable Python Strings

`lstr` is a Python package for partially lockable strings.

Without locks, an `lstr` can be updated:

```python
from lstr import lstr

greeting = lstr("Hello, world!")
print(greeting)  # "Hello, world!"

greeting.replace("Hey", index=0, length=5)  # True
print(greeting)  # "Hey, world!"
```

To prevent a part of the string being updated, add a lock:

```python
from lstr import lstr

greeting = lstr("Hello, world!")
greeting.lock(index=0, length=5)

greeting.replace("Hey", index=0, length=5)  # False
print(greeting)  # "Hello, world!"

greeting.replace(" there", index=5, length=7)  # True
print(greeting)  # "Hello there!"
```

## Thank you! 🎉

My name is **Cariad**, and I'm an [independent freelance DevOps engineer](https://cariad.io).

I'd love to spend more time working on projects like this, but--as a freelancer--my income is sporadic and I need to chase gigs that pay the rent.

If this project has value to you, please consider [☕️ sponsoring](https://github.com/sponsors/cariad) me. Sponsorships grant me time to work on _your_ wants rather than _someone else's_.

Thank you! ❤️


