Metadata-Version: 2.1
Name: seqpat
Version: 0.1.0
Summary: Parser for string sequence, inspired by reguar expressions
Author-email: Toshihiro Kamiya <kamiya@mbj.nifty.com>
License: MIT License
        
        Copyright (c) 2024 Toshihiro Kamiya
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: homepage, https://github.com/tos-kamiya/seqpat
Project-URL: repository, https://github.com/tos-kamiya/seqpat
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt

# seqpat

`seqpat` is a Python library designed for flexible and efficient sequence pattern matching, primarily aimed at converting microformats from various command-line tools into JSON format.

The motivation behind this project was the idea: *"Wouldn't it be great if we could perform operations on a sequence of strings (i.e., lines of text like in a text file) in the same way we use regular expressions on individual strings (i.e., a sequence of characters)?"*

## Features

- **Pattern Matching**: Match sequences of strings using customizable patterns.
- **Sequence Handling**: Process and parse structured text data efficiently.
- **Flexible Parsing**: Handle continuation lines, key-value pairs, and more.
- **Customizable Replacements**: Use pattern-based substitutions to transform the input as needed.

## Installation

You can install `seqpat` using `pip`:

```bash
pip install seqpat
```

## Patterns/Utility Functions

The core of `seqpat` is its ability to define and use flexible patterns for text matching. It provides:

- **R**: A pattern that matches regular expressions.
- **gsub**: A function for global substitution based on patterns.
- **split_by**: A function to split a sequence of strings by a delimiter pattern.

For detailed usage, please refer to the Docstrings, and for examples, see the `examples` directory.

## Contributing

Contributions are welcome! Please feel free to submit issues or pull requests on the [GitHub repository](https://github.com/tos-kamiya/seqpat).

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE.txt) file for details.
