Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nj-vs-vh committed Feb 18, 2024
1 parent aa06577 commit 10a67f9
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,4 @@ pip-selfcheck.json
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
temp*
env.sh
data.json
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,36 @@ generate Python types describing it. Features:

## Installation

TBD
```shell
pip install slow-learner
```

## Usage

TBD
As CLI:

```shell
slow-learner learn 1.json 2.json 3.json

# to learn the type of list item
slow-learner learn --spread list.json
```

In Python:

```python
from slow_learner import TypeLearner

tl = TypeLearner(
max_literal_type_size=5,
learn_typed_dicts=True,
max_typed_dict_size=50,
max_recursive_type_depth=5,
no_literal_patterns=[r"\.password", r".*secret"],
)

for value in my_values:
tl.observe(value)

tl.save_type_definition("result.py", "MyType")
```
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,21 @@ classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
]
dependencies = [
"click~=8.1",
"tqdm>=4.0.0",
]

[project.urls]
Homepage = "https://nj-vs-vh.name/project/slow-learner"
Repository = "https://github.com/nj-vs-vh/slow-learner"
Issues = "https://github.com/nj-vs-vh/slow-learner/issues"

[project.scripts]
slow-learner = "slow_learner.cli:cli"

########################################################################

[tool.black]
line-length = 120

Expand Down
Empty file added src/slow_learner/py.typed
Empty file.

0 comments on commit 10a67f9

Please sign in to comment.