Skip to content

Commit b323d0d

Browse files
committed
Initial commit: Stylometry CLI v1.0.0 - Quantitative author fingerprinting tool
0 parents  commit b323d0d

File tree

81 files changed

+6625
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+6625
-0
lines changed

.github/workflows/publish.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch: # Allow manual trigger
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
name: Build distribution 📦
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
24+
- name: Install build dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build
28+
29+
- name: Build package
30+
run: python -m build
31+
32+
- name: Store the distribution packages
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: python-package-distributions
36+
path: dist/
37+
38+
publish-to-pypi:
39+
name: Publish to PyPI 🐍
40+
needs: [build]
41+
runs-on: ubuntu-latest
42+
environment:
43+
name: pypi
44+
url: https://pypi.org/p/stylometry-cli
45+
permissions:
46+
id-token: write # OIDC publishing
47+
48+
steps:
49+
- name: Download all the dists
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: python-package-distributions
53+
path: dist/
54+
55+
- name: Publish to PyPI
56+
uses: pypa/gh-action-pypi-publish@release/v1
57+
58+
publish-to-testpypi:
59+
name: Publish to TestPyPI 🧪
60+
needs: [build]
61+
runs-on: ubuntu-latest
62+
environment:
63+
name: testpypi
64+
url: https://test.pypi.org/p/stylometry-cli
65+
permissions:
66+
id-token: write
67+
68+
steps:
69+
- name: Download all the dists
70+
uses: actions/download-artifact@v4
71+
with:
72+
name: python-package-distributions
73+
path: dist/
74+
75+
- name: Publish to TestPyPI
76+
uses: pypa/gh-action-pypi-publish@release/v1
77+
with:
78+
repository-url: https://test.pypi.org/legacy/

.github/workflows/tests.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, windows-latest, macos-latest]
16+
python-version: ["3.10", "3.11", "3.12"]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -e ".[dev]"
30+
31+
- name: Run tests
32+
run: |
33+
pytest --cov=stylometry --cov-report=xml
34+
35+
- name: Upload coverage
36+
uses: codecov/codecov-action@v4
37+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
38+
with:
39+
files: ./coverage.xml
40+
fail_ci_if_error: false
41+
42+
lint:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: "3.12"
51+
52+
- name: Install dependencies
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install black isort mypy
56+
57+
- name: Check formatting with Black
58+
run: black --check --diff stylometry/
59+
60+
- name: Check imports with isort
61+
run: isort --check-only --diff stylometry/
62+
63+
- name: Type check with mypy
64+
run: mypy stylometry/ --ignore-missing-imports

.gitignore

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.nox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
*.py,cover
48+
.hypothesis/
49+
.pytest_cache/
50+
51+
# Translations
52+
*.mo
53+
*.pot
54+
55+
# Jupyter Notebook
56+
.ipynb_checkpoints
57+
58+
# IPython
59+
profile_default/
60+
ipython_config.py
61+
62+
# pyenv
63+
.python-version
64+
65+
# Environments
66+
.env
67+
.venv
68+
env/
69+
venv/
70+
ENV/
71+
env.bak/
72+
venv.bak/
73+
74+
# IDE settings
75+
.vscode/
76+
.idea/
77+
*.swp
78+
*.swo
79+
*~
80+
81+
# macOS
82+
.DS_Store
83+
84+
# Windows
85+
Thumbs.db
86+
ehthumbs.db
87+
Desktop.ini
88+
89+
# Project-specific output directories
90+
stylometry_out_*/
91+
*_analysis/
92+
*_run/
93+
test_*/
94+
*.zip
95+
96+
# Spacy models (large)
97+
en_core_web_*/

.pre-commit-config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.5.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
args: ["--maxkb=1000"]
12+
- id: check-merge-conflict
13+
14+
- repo: https://github.com/psf/black
15+
rev: 24.1.0
16+
hooks:
17+
- id: black
18+
language_version: python3.12
19+
20+
- repo: https://github.com/pycqa/isort
21+
rev: 5.13.2
22+
hooks:
23+
- id: isort
24+
args: ["--profile", "black"]
25+
26+
- repo: https://github.com/pre-commit/mirrors-mypy
27+
rev: v1.8.0
28+
hooks:
29+
- id: mypy
30+
additional_dependencies: []
31+
args: ["--ignore-missing-imports"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 SpectreDeath
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)