You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`--config`|`str` (path) | Path to configuration file (`twyn.toml` or `pyproject.toml` by default). |
70
+
|`--dependency-file`|`str` (path) | Dependency file to analyze. Supported: `requirements.txt`, `poetry.lock`, `uv.lock`, etc. |
71
+
|`--dependency`|`str` (multiple allowed) | Dependency to analyze directly. Can be specified multiple times. |
72
+
|`--selector-method`|`all`, `first-letter`, `nearby-letter`| Method for selecting possible typosquats. |
73
+
|`--package-ecosystem`|`pypi`, `npm`| Package ecosystem for analysis. |
74
+
|`-v`| flag | Enable info-level logging. |
75
+
|`-vv`| flag | Enable debug-level logging. |
76
+
|`--no-cache`| flag | Disable use of trusted packages cache. Always fetch from the source. |
77
+
|`--no-track`| flag | Do not show the progress bar while processing packages. |
78
+
|`--json`| flag | Display results in JSON format. Implies `--no-track`. |
79
+
|`-r`, `--recursive`| flag | Scan directories recursively for dependency files. |
64
80
#### Run
65
81
66
-
To run twyn simply type:
82
+
**Usage Example:**
67
83
68
84
```sh
69
85
twyn run <OPTIONS>
70
86
```
71
-
72
-
For a list of all the available options as well as their expected arguments run:
87
+
or get help with
73
88
74
89
```sh
75
90
twyn run --help
@@ -90,41 +105,9 @@ If `Twyn` was run by manually giving it dependencies (with `--dependency`), the
90
105
91
106
In any other case (when dependencies are parsed from a file), the source will be the path to the dependencies file. One entry will be created for every source.
92
107
93
-
### Using Twyn as a library
94
-
95
-
96
-
#### Installation
97
-
`Twyn` also supports being used as 3rd party library for you project. To install it, run:
98
-
99
-
100
-
```sh
101
-
pip install twyn
102
-
```
103
-
104
-
Example usage in your code:
105
-
106
-
```python
107
-
from twyn import check_dependencies
108
-
109
-
typos = check_dependencies()
110
-
111
-
for typo in typos.errors:
112
-
print(f"Dependency:{typo.dependency}")
113
-
print(f"Did you mean any of [{','.join(typo.similars)}]")
114
-
115
-
```
116
-
117
-
#### Logging level
118
-
By default, logging is disabled when running as a 3rd party library. To override this behaviour, you can:
119
-
120
-
```python
121
-
logging.basicConfig(level=logging.INFO)
122
-
logging.getLogger("twyn").setLevel(logging.INFO)
123
-
```
124
108
125
109
### Using Twyn as a library
126
110
127
-
128
111
#### Installation
129
112
`Twyn` also supports being used as 3rd party library for you project. To install it, run:
0 commit comments