timefence 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- timefence-0.9.0/.github/workflows/ci.yml +29 -0
- timefence-0.9.0/.github/workflows/release.yml +63 -0
- timefence-0.9.0/.gitignore +19 -0
- timefence-0.9.0/CHANGELOG.md +47 -0
- timefence-0.9.0/LICENSE +21 -0
- timefence-0.9.0/PKG-INFO +653 -0
- timefence-0.9.0/README.md +614 -0
- timefence-0.9.0/pyproject.toml +85 -0
- timefence-0.9.0/src/timefence/__init__.py +55 -0
- timefence-0.9.0/src/timefence/_constants.py +25 -0
- timefence-0.9.0/src/timefence/_duration.py +91 -0
- timefence-0.9.0/src/timefence/_version.py +1 -0
- timefence-0.9.0/src/timefence/cli.py +1147 -0
- timefence-0.9.0/src/timefence/core.py +332 -0
- timefence-0.9.0/src/timefence/engine.py +2004 -0
- timefence-0.9.0/src/timefence/errors.py +132 -0
- timefence-0.9.0/src/timefence/quickstart.py +322 -0
- timefence-0.9.0/src/timefence/store.py +159 -0
- timefence-0.9.0/tests/__init__.py +0 -0
- timefence-0.9.0/tests/conftest.py +118 -0
- timefence-0.9.0/tests/test_cli.py +308 -0
- timefence-0.9.0/tests/test_core.py +244 -0
- timefence-0.9.0/tests/test_duration.py +86 -0
- timefence-0.9.0/tests/test_engine.py +1114 -0
- timefence-0.9.0/tests/test_errors.py +89 -0
- timefence-0.9.0/tests/test_integration.py +208 -0
- timefence-0.9.0/tests/test_property.py +223 -0
- timefence-0.9.0/tests/test_store.py +142 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ${{ matrix.os }}
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ubuntu-latest, macos-latest]
|
|
15
|
+
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v4
|
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
+
run: uv python install ${{ matrix.python-version }}
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: uv sync --extra dev
|
|
24
|
+
- name: Lint with ruff
|
|
25
|
+
run: uv run ruff check src/ tests/
|
|
26
|
+
- name: Format check with ruff
|
|
27
|
+
run: uv run ruff format --check src/ tests/
|
|
28
|
+
- name: Run tests
|
|
29
|
+
run: uv run pytest tests/ -v --tb=short
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Release to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
run: uv python install 3.12
|
|
22
|
+
|
|
23
|
+
- name: Build package
|
|
24
|
+
run: uv build
|
|
25
|
+
|
|
26
|
+
- name: Upload build artifacts
|
|
27
|
+
uses: actions/upload-artifact@v4
|
|
28
|
+
with:
|
|
29
|
+
name: dist
|
|
30
|
+
path: dist/
|
|
31
|
+
|
|
32
|
+
test:
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v4
|
|
36
|
+
|
|
37
|
+
- name: Install uv
|
|
38
|
+
uses: astral-sh/setup-uv@v4
|
|
39
|
+
|
|
40
|
+
- name: Set up Python
|
|
41
|
+
run: uv python install 3.12
|
|
42
|
+
|
|
43
|
+
- name: Install dependencies
|
|
44
|
+
run: uv sync --extra dev
|
|
45
|
+
|
|
46
|
+
- name: Run tests
|
|
47
|
+
run: uv run pytest tests/ -v --tb=short
|
|
48
|
+
|
|
49
|
+
publish:
|
|
50
|
+
needs: [build, test]
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
environment: pypi
|
|
53
|
+
permissions:
|
|
54
|
+
id-token: write
|
|
55
|
+
steps:
|
|
56
|
+
- name: Download build artifacts
|
|
57
|
+
uses: actions/download-artifact@v4
|
|
58
|
+
with:
|
|
59
|
+
name: dist
|
|
60
|
+
path: dist/
|
|
61
|
+
|
|
62
|
+
- name: Publish to PyPI
|
|
63
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.9.0 — 2026-02-06
|
|
4
|
+
|
|
5
|
+
Initial public release.
|
|
6
|
+
|
|
7
|
+
### Core
|
|
8
|
+
|
|
9
|
+
- **Point-in-time correct joins** with strict `feature_time < label_time - embargo` invariant
|
|
10
|
+
- **ASOF JOIN fast path** (embargo=0) and ROW_NUMBER fallback (embargo>0) strategy selection
|
|
11
|
+
- Data model: `Source`, `CSVSource`, `SQLSource`, `Feature`, `FeatureSet`, `Labels`
|
|
12
|
+
- Three feature modes: column selection, SQL, and Python transform
|
|
13
|
+
- Configurable `max_lookback`, `max_staleness`, `embargo`, `on_missing`, and `join` mode
|
|
14
|
+
- Time-based train/valid/test splits
|
|
15
|
+
- Key mapping for cross-source key name mismatches
|
|
16
|
+
- Duplicate row handling (`on_duplicate`: `error` or `keep_any`)
|
|
17
|
+
|
|
18
|
+
### Commands
|
|
19
|
+
|
|
20
|
+
- `timefence build` — Build point-in-time correct training sets
|
|
21
|
+
- `timefence audit` — Detect temporal leakage in any dataset (rebuild-and-compare or lightweight temporal check)
|
|
22
|
+
- `timefence explain` — Preview join logic and SQL without executing
|
|
23
|
+
- `timefence diff` — Compare two training datasets with configurable numeric tolerances
|
|
24
|
+
- `timefence inspect` — Suggest keys and timestamps for a data file
|
|
25
|
+
- `timefence catalog` — List all features defined in a project
|
|
26
|
+
- `timefence quickstart` — Generate a self-contained example project with planted leakage
|
|
27
|
+
- `timefence doctor` — Diagnose project setup and common issues
|
|
28
|
+
- `timefence init` — Scaffold a `timefence.yaml` config file
|
|
29
|
+
|
|
30
|
+
### Store
|
|
31
|
+
|
|
32
|
+
- Build tracking with content-hashed manifests
|
|
33
|
+
- Feature-level and build-level caching
|
|
34
|
+
- Reproducible builds via `Store` and `.timefence/` directory
|
|
35
|
+
|
|
36
|
+
### Configuration
|
|
37
|
+
|
|
38
|
+
- `timefence.yaml` for project-level defaults
|
|
39
|
+
- Precedence: CLI flags > Python API > `timefence.yaml` > built-in defaults
|
|
40
|
+
|
|
41
|
+
### Developer Experience
|
|
42
|
+
|
|
43
|
+
- Rich terminal output for all commands
|
|
44
|
+
- JSON export for audit reports (`--json`) and HTML reports (`--html`)
|
|
45
|
+
- `--strict` flag for CI integration (exit code 1 on leakage)
|
|
46
|
+
- Structured error messages with fix suggestions
|
|
47
|
+
- `--dry-run` for build previews
|
timefence-0.9.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gauthier Piarrette
|
|
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.
|