Skip to content

Commit

Permalink
Rename package
Browse files Browse the repository at this point in the history
  • Loading branch information
benbrandt committed Jun 9, 2023
1 parent bbfc65c commit 1326d48
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 23 deletions.
4 changes: 4 additions & 0 deletions bindings/python/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.1.3

Rename package to `semantic-text-splitter` so it can actually be uploaded to PyPi.

## v0.1.2

Fix bad release
Expand Down
16 changes: 8 additions & 8 deletions bindings/python/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "text-splitter-py"
version = "0.1.2"
name = "semantic-text-splitter"
version = "0.1.3"
authors = ["Ben Brandt <[email protected]>"]
edition = "2021"
description = "Split text into semantic chunks, up to a desired chunk size. Supports calculating length by characters and tokens (when used with large language models)."
Expand All @@ -10,7 +10,7 @@ keywords = ["text", "split", "tokenizer", "nlp", "ai"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "text_splitter"
name = "semantic_text_splitter"
crate-type = ["cdylib"]

[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This crate provides methods for splitting longer pieces of text into smaller chu
### By Number of Characters

```python
from text_splitter import CharacterTextSplitter
from semantic_text_splitter import CharacterTextSplitter

# Maximum number of characters in a chunk
max_characters = 1000
Expand All @@ -30,7 +30,7 @@ Once a chunk has reached a length that falls within the range it will be returne
It is always possible that a chunk may be returned that is less than the `start` value, as adding the next piece of text may have made it larger than the `end` capacity.

```python
from text_splitter import CharacterTextSplitter
from semantic_text_splitter import CharacterTextSplitter

# Optionally can also have the splitter trim whitespace for you
splitter = CharacterTextSplitter()
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"

[project]
name = "text-splitter"
name = "semantic-text-splitter"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Rust",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CharacterTextSplitter:
### By Number of Characters
```python
from text_splitter import CharacterTextSplitter
from semantic_text_splitter import CharacterTextSplitter
# Maximum number of characters in a chunk
max_characters = 1000
Expand All @@ -26,7 +26,7 @@ class CharacterTextSplitter:
It is always possible that a chunk may be returned that is less than the `start` value, as adding the next piece of text may have made it larger than the `end` capacity.
```python
from text_splitter import CharacterTextSplitter
from semantic_text_splitter import CharacterTextSplitter
# Optionally can also have the splitter trim whitespace for you
splitter = CharacterTextSplitter()
Expand Down
12 changes: 6 additions & 6 deletions bindings/python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
// pyo3 uses this
#![allow(elided_lifetimes_in_paths)]

use ::text_splitter::{Characters, ChunkCapacity, TextSplitter};
use pyo3::prelude::*;
use text_splitter::{Characters, ChunkCapacity, TextSplitter};

/// Custom chunk capacity for python to make it easier to work
/// with python arguments
Expand Down Expand Up @@ -48,7 +48,7 @@ Plain-text splitter. Recursively splits chunks into the largest semantic units t
### By Number of Characters
```python
from text_splitter import CharacterTextSplitter
from semantic_text_splitter import CharacterTextSplitter
# Maximum number of characters in a chunk
max_characters = 1000
Expand All @@ -67,7 +67,7 @@ Once a chunk has reached a length that falls within the range it will be returne
It is always possible that a chunk may be returned that is less than the `start` value, as adding the next piece of text may have made it larger than the `end` capacity.
```python
from text_splitter import CharacterTextSplitter
from semantic_text_splitter import CharacterTextSplitter
# Optionally can also have the splitter trim whitespace for you
splitter = CharacterTextSplitter()
Expand Down Expand Up @@ -142,7 +142,7 @@ This crate provides methods for splitting longer pieces of text into smaller chu
### By Number of Characters
```python
from text_splitter import CharacterTextSplitter
from semantic_text_splitter import CharacterTextSplitter
# Maximum number of characters in a chunk
max_characters = 1000
Expand All @@ -161,7 +161,7 @@ Once a chunk has reached a length that falls within the range it will be returne
It is always possible that a chunk may be returned that is less than the `start` value, as adding the next piece of text may have made it larger than the `end` capacity.
```python
from text_splitter import CharacterTextSplitter
from semantic_text_splitter import CharacterTextSplitter
# Optionally can also have the splitter trim whitespace for you
splitter = CharacterTextSplitter()
Expand Down Expand Up @@ -203,7 +203,7 @@ This crate was inspired by [LangChain's TextSplitter](https://python.langchain.c
A big thank you to the unicode-rs team for their [unicode-segmentation](https://crates.io/crates/unicode-segmentation) crate that manages a lot of the complexity of matching the Unicode rules for words and sentences.
**/
#[pymodule]
fn text_splitter(_py: Python, m: &PyModule) -> PyResult<()> {
fn semantic_text_splitter(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_class::<CharacterTextSplitter>()?;
Ok(())
}
2 changes: 1 addition & 1 deletion bindings/python/tests/test_integration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from text_splitter import CharacterTextSplitter
from semantic_text_splitter import CharacterTextSplitter


def test_chunks():
Expand Down

0 comments on commit 1326d48

Please sign in to comment.