Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,39 @@ jobs:
path: ./wheelhouse/*.whl
if-no-files-found: error

build-sdist:
name: Build sdist
needs: [lint]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.8.22"

- name: Install dependencies
run: uv sync --no-install-project

- name: Build sdist package
run: uv run poetry build -f sdist && ls -al dist

- name: Upload sdist package
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: ./dist/*.tar.gz
if-no-files-found: error

upload:
name: Upload to PyPI
if: startsWith(github.ref, 'refs/tags/')
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

```zig
▞▀▖ ▐ ▞▀▖
▚▄ ▞▀▖▞▀▖▙▀▖▞▀▖▜▀ ▚▄ ▌ ▌▞▀▖▞▀▖▛▀▖▞▀▖▙▀▖
Expand Down Expand Up @@ -37,19 +36,19 @@ To mask secrets from the `bytes` literal:

```shell
» python
>>> import secretsweeper
>>> print(secretsweeper.mask(b"Hello, Secret Sweeper!", (b'Secret', b'Sweeper')))
>>> b'Hello, ****** *******!'
import secretsweeper
print(secretsweeper.mask(b"Hello, Secret Sweeper!", (b'Secret', b'Sweeper')))
b'Hello, ****** *******!'
```
Secrets may be completely removed by providing a third argument, `limit=0`, which specifies the maximum number of masking characters:

```shell
» python
>>> import secretsweeper
>>> print(secretsweeper.mask(b"Moby Dick!", [b" Dick"], limit=0))
>>> b'Moby!'
import secretsweeper
print(secretsweeper.mask(b"Moby Dick!", [b" Dick"], limit=0))
b'Moby!'
```
To effectively mask a large text:
To effectively mask all secrets in a large text:

```python
import urllib.request
Expand All @@ -65,7 +64,7 @@ with urllib.request.urlopen(url) as src, open("sanitized.txt", "wb") as dest:
dest.write(line)
```

More examples in [tests](tests/test_secretsweeper.py).
More examples are in [tests](tests/test_secretsweeper.py).

## Getting involved

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[project]
name = "secretsweeper"
version = "0.0.1a2"
version = "0.0.1a1"
requires-python = ">=3.11"
license = "GPL-3.0-only"
license = "MIT"
license-files = ["LICENSE"]

[build-system]
requires = ["poetry-core==2.2.1", "ziggy-pydust==0.26.0"]
Expand Down