Skip to content

Commit

Permalink
refactor: rename package from text-match to stringpod
Browse files Browse the repository at this point in the history
  • Loading branch information
jyyyeung committed Feb 21, 2025
1 parent c973b99 commit 34d1eaa
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ tag = True
search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:text_match/__init__.py]
[bumpversion:file:stringpod/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* Text Match version:
* String Pod version:
* Python version:
* Operating System:

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/text-match
url: https://pypi.org/p/stringpod
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:

environment:
name: test-pypi
url: https://test.pypi.org/p/text-match
url: https://test.pypi.org/p/stringpod

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
environment:
name: test-pypi
url: https://test.pypi.org/p/text-match
url: https://test.pypi.org/p/stringpod

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

environment:
name: pypi
url: https://pypi.org/p/text-match
url: https://pypi.org/p/stringpod

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
Expand Down
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can contribute in many ways:

### Report Bugs

Report bugs at <https://github.com/jyyyeung/text-match/issues>.
Report bugs at <https://github.com/jyyyeung/stringpod/issues>.

If you are reporting a bug, please include:

Expand All @@ -29,13 +29,13 @@ and "help wanted" is open to whoever wants to implement it.

### Write Documentation

Text Match could always use more documentation, whether as part of the
official Text Match docs, in docstrings, or even on the web in blog posts,
String Pod could always use more documentation, whether as part of the
official String Pod docs, in docstrings, or even on the web in blog posts,
articles, and such.

### Submit Feedback

The best way to send feedback is to file an issue at <https://github.com/jyyyeung/text-match/issues>.
The best way to send feedback is to file an issue at <https://github.com/jyyyeung/stringpod/issues>.

If you are proposing a feature:

Expand All @@ -46,13 +46,13 @@ If you are proposing a feature:

## Get Started

Ready to contribute? Here's how to set up `text-match` for local development.
Ready to contribute? Here's how to set up `stringpod` for local development.

1. Fork the `text-match` repo on GitHub.
1. Fork the `stringpod` repo on GitHub.
2. Clone your fork locally

```bash
git clone git@github.com:your_name_here/text-match.git
git clone git@github.com:your_name_here/stringpod.git
```

3. Ensure [poetry](https://python-poetry.org/docs/) is installed.
Expand Down Expand Up @@ -96,13 +96,13 @@ Before you submit a pull request, check that it meets these guidelines:
your new functionality into a function with a docstring, and add the
feature to the list in README.md.
3. The pull request should work for Python 3.6, 3.7, 3.8 and 3.9. Check
<https://github.com/jyyyeung/text-match/actions>
<https://github.com/jyyyeung/stringpod/actions>
and make sure that the tests pass for all supported Python versions.
## Tips
```bash
poetry run pytest tests/test_text_match.py
poetry run pytest tests/test_stringpod.py
```
To run a subset of tests.
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Text Match
# String Pod

[![pypi](https://img.shields.io/pypi/v/text-match.svg)](https://pypi.org/project/text-match/)
[![python](https://img.shields.io/pypi/pyversions/text-match.svg)](https://pypi.org/project/text-match/)
[![Build Status](https://github.com/jyyyeung/text-match/actions/workflows/dev.yml/badge.svg)](https://github.com/jyyyeung/text-match/actions/workflows/dev.yml)
[![codecov](https://codecov.io/gh/jyyyeung/text-match/branch/main/graphs/badge.svg)](https://codecov.io/github/jyyyeung/text-match)
[![pypi](https://img.shields.io/pypi/v/stringpod.svg)](https://pypi.org/project/stringpod/)
[![python](https://img.shields.io/pypi/pyversions/stringpod.svg)](https://pypi.org/project/stringpod/)
[![Build Status](https://github.com/jyyyeung/stringpod/actions/workflows/dev.yml/badge.svg)](https://github.com/jyyyeung/stringpod/actions/workflows/dev.yml)
[![codecov](https://codecov.io/gh/jyyyeung/stringpod/branch/main/graphs/badge.svg)](https://codecov.io/github/jyyyeung/stringpod)

Matching texts across languages

* Documentation: <https://jyyyeung.github.io/text-match>
* GitHub: <https://github.com/jyyyeung/text-match>
* PyPI: <https://pypi.org/project/text-match/>
* Documentation: <https://jyyyeung.github.io/stringpod>
* GitHub: <https://github.com/jyyyeung/stringpod>
* PyPI: <https://pypi.org/project/stringpod/>
* Free software: MIT

## Features
Expand All @@ -22,17 +22,17 @@ Matching texts across languages
### Contains

```bash
text-match contains "Hello, world!" "world"
text-match contains " Hello, world! " "lo, wor" --options "strip_whitespace,ignore_case"
text-match contains "歌曲(純音樂)" "(纯音乐)" --options "ignore_chinese_variant"
stringpod contains "Hello, world!" "world"
stringpod contains " Hello, world! " "lo, wor" --options "strip_whitespace,ignore_case"
stringpod contains "歌曲(純音樂)" "(纯音乐)" --options "ignore_chinese_variant"
```

### Normalize

```bash
text-match normalize "Hello, World!!!"
text-match normalize " Hello, World!!!" --options "all"
text-match normalize "歌曲(純音樂)" --options "ignore_chinese_variant"
stringpod normalize "Hello, World!!!"
stringpod normalize " Hello, World!!!" --options "all"
stringpod normalize "歌曲(純音樂)" --options "ignore_chinese_variant"
```

## Normalizer Options
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
::: text_match
::: stringpod
12 changes: 6 additions & 6 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

## Stable release

To install Text Match, run this command in your
To install String Pod, run this command in your
terminal:

``` console
pip install text-match
pip install stringpod
```

This is the preferred method to install Text Match, as it will always install the most recent stable release.
This is the preferred method to install String Pod, as it will always install the most recent stable release.

If you don't have [pip][] installed, this [Python installation guide][]
can guide you through the process.

## From source

The source for Text Match can be downloaded from
The source for String Pod can be downloaded from
the [Github repo][].

You can either clone the public repository:

``` console
git clone git://github.com/jyyyeung/text-match
git clone git://github.com/jyyyeung/stringpod
```

Or download the [tarball][]:

``` console
curl -OJL https://github.com/jyyyeung/text-match/tarball/master
curl -OJL https://github.com/jyyyeung/stringpod/tarball/master
```

Once you have a copy of the source, you can install it with:
Expand Down
8 changes: 4 additions & 4 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Usage

To use Text Match in a project
To use String Pod in a project

```python
import text_match
import stringpod
```

## Normalizer

```python
>>> from text_match import Normalizer, NormalizerOptions
>>> from stringpod import Normalizer, NormalizerOptions
>>> normalizer = Normalizer()
>>> normalizer.normalize("Hello, world!")
```
Expand Down Expand Up @@ -43,7 +43,7 @@ import text_match
## String Contains Substring

```python
>>> from text_match import contains_substring
>>> from stringpod import contains_substring
>>> contains_substring("Hello, world!", "world")
True
>>> contains_substring("Hello, world!", "WORLD", options="ignore_case")
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sources = text_match
sources = stringpod

.PHONY: test format lint unittest coverage pre-commit clean
test: format lint unittest
Expand Down
12 changes: 6 additions & 6 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
site_name: Text Match
site_url: https://jyyyeung.github.io/text-match
repo_url: https://github.com/jyyyeung/text-match
repo_name: jyyyeung/text-match
site_name: String Pod
site_url: https://jyyyeung.github.io/stringpod
repo_url: https://github.com/jyyyeung/stringpod
repo_name: jyyyeung/stringpod
#strict: true
nav:
- Home: index.md
Expand Down Expand Up @@ -53,7 +53,7 @@ plugins:
default_handler: python
handlers:
python:
paths: [text_match]
paths: [stringpod]
options:
show_source: true
show_root_heading: true
Expand All @@ -69,7 +69,7 @@ extra:
link: https://github.com/waynerv/cookiecutter-pypackage
name: Facebook
- icon: fontawesome/brands/github
link: https://github.com/jyyyeung/text-match
link: https://github.com/jyyyeung/stringpod
name: Github
- icon: material/email
link: "mailto:yeungjyy@gmail.com"
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tool]
[tool.poetry]
name = "text-match"
name = "stringpod"
version = "0.1.0"
homepage = "https://github.com/jyyyeung/text-match"
homepage = "https://github.com/jyyyeung/stringpod"
description = "Matching texts across languages."
authors = ["Jasmine Yeung <yeungjyy@gmail.com>"]
readme = "README.md"
Expand All @@ -15,7 +15,7 @@ classifiers = [
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.12',
]
packages = [{ include = "text_match" }, { include = "tests", format = "sdist" }]
packages = [{ include = "stringpod" }, { include = "tests", format = "sdist" }]

[tool.poetry.dependencies]
python = ">=3.12.3,<4.0"
Expand Down Expand Up @@ -75,7 +75,7 @@ doc = [
]

[tool.poetry.scripts]
text-match = 'text_match.cli:main'
stringpod = 'stringpod.cli:main'

[tool.black]
line-length = 120
Expand Down
10 changes: 5 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ setenv =
PYTHONPATH = {toxinidir}
PYTHONWARNINGS = ignore
commands =
pytest --cov=text_match --cov-branch --cov-report=xml --cov-report=term-missing tests
pytest --cov=stringpod --cov-branch --cov-report=xml --cov-report=term-missing tests

[testenv:format]
allowlist_externals =
Expand All @@ -64,8 +64,8 @@ allowlist_externals =
extras =
test
commands =
isort text_match
black text_match tests
isort stringpod
black stringpod tests

[testenv:lint]
allowlist_externals =
Expand All @@ -74,8 +74,8 @@ allowlist_externals =
extras =
test
commands =
flake8 text_match tests
mypy text_match tests
flake8 stringpod tests
mypy stringpod tests

[testenv:build]
allowlist_externals =
Expand Down
2 changes: 1 addition & 1 deletion text_match/__init__.py → stringpod/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Top-level package for Text Match."""
"""Top-level package for String Pod."""

__author__ = """Jasmine Yeung"""
__email__ = "yeungjyy@gmail.com"
Expand Down
18 changes: 9 additions & 9 deletions text_match/cli.py → stringpod/cli.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
"""Console script for text_match."""
"""Console script for stringpod."""

import click

from text_match.normalizer import Normalizer, NormalizerOptions
from text_match.text_match import contains_substring
from stringpod.normalizer import Normalizer, NormalizerOptions
from stringpod.stringpod import contains_substring


@click.group(invoke_without_command=True)
@click.pass_context
def main(ctx):
"""Main entrypoint."""
if ctx.invoked_subcommand is None:
click.echo("text-match")
click.echo("=" * len("text-match"))
click.echo("stringpod")
click.echo("=" * len("stringpod"))
click.echo("Matching texts across languages")


Expand All @@ -23,7 +23,7 @@ def main(ctx):
def contains(text: str, substring: str, options: str):
"""Check if the text contains the substring.
>>> text-match contains "Hello, world!" "world"
>>> stringpod contains "Hello, world!" "world"
True
"""
click.echo(f"Text: {text}")
Expand All @@ -39,11 +39,11 @@ def contains(text: str, substring: str, options: str):
def normalize(text: str, options: str):
"""Normalize the text.
>>> text-match normalize "Hello, world!"
>>> stringpod normalize "Hello, world!"
"Hello, world!"
>>> text-match normalize "Hello, world!" --options "ignore_case"
>>> stringpod normalize "Hello, world!" --options "ignore_case"
"hello, world!"
>>> text-match normalize "Hello, world!"
>>> stringpod normalize "Hello, world!"
"""
click.echo(f"Text: {text}")
options_obj = NormalizerOptions.from_string(options)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion text_match/text_match.py → stringpod/stringpod.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import hanzidentifier

from text_match.normalizer import Normalizer, NormalizerOptions
from stringpod.normalizer import Normalizer, NormalizerOptions


def contains_chinese(text: str) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Unit test package for text-match."""
"""Unit test package for stringpod."""
2 changes: 1 addition & 1 deletion tests/test_normalizer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Test the normalizer module."""

from text_match.normalizer import Normalizer, NormalizerOptions
from stringpod.normalizer import Normalizer, NormalizerOptions


def test_normalize_default():
Expand Down
Loading

0 comments on commit 34d1eaa

Please # to comment.