audiotrace 1.0.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.
Files changed (53) hide show
  1. audiotrace-1.0.0/.claude/settings.json +15 -0
  2. audiotrace-1.0.0/.dockerignore +16 -0
  3. audiotrace-1.0.0/.github/workflows/ci.yml +24 -0
  4. audiotrace-1.0.0/.gitignore +222 -0
  5. audiotrace-1.0.0/CLAUDE.md +58 -0
  6. audiotrace-1.0.0/CONTRIBUTING.md +50 -0
  7. audiotrace-1.0.0/LICENSE +21 -0
  8. audiotrace-1.0.0/PKG-INFO +334 -0
  9. audiotrace-1.0.0/README.md +276 -0
  10. audiotrace-1.0.0/docker/Dockerfile +32 -0
  11. audiotrace-1.0.0/docker/Dockerfile.test +25 -0
  12. audiotrace-1.0.0/docs/imgs/auditrace.png +0 -0
  13. audiotrace-1.0.0/docs/imgs/dashboard.png +0 -0
  14. audiotrace-1.0.0/docs/prd/0001-mediainfo.md +130 -0
  15. audiotrace-1.0.0/docs/prd/0002-transcript.md +127 -0
  16. audiotrace-1.0.0/docs/prd/0003-quality.md +121 -0
  17. audiotrace-1.0.0/docs/prd/0004-sentiment.md +105 -0
  18. audiotrace-1.0.0/docs/prd/0005-events.md +132 -0
  19. audiotrace-1.0.0/docs/prd/0006-latency.md +154 -0
  20. audiotrace-1.0.0/docs/prd/README.md +22 -0
  21. audiotrace-1.0.0/docs/roadmap.md +30 -0
  22. audiotrace-1.0.0/docs/vision/executive-summary.md +60 -0
  23. audiotrace-1.0.0/docs/vision/idea.md +141 -0
  24. audiotrace-1.0.0/docs/vision/vision.md +635 -0
  25. audiotrace-1.0.0/pyproject.toml +80 -0
  26. audiotrace-1.0.0/run.sh +35 -0
  27. audiotrace-1.0.0/scripts/publish.sh +89 -0
  28. audiotrace-1.0.0/scripts/test_local.sh +56 -0
  29. audiotrace-1.0.0/src/audiotrace/__init__.py +44 -0
  30. audiotrace-1.0.0/src/audiotrace/boot.py +157 -0
  31. audiotrace-1.0.0/src/audiotrace/core.py +92 -0
  32. audiotrace-1.0.0/src/audiotrace/cost.py +101 -0
  33. audiotrace-1.0.0/src/audiotrace/events.py +135 -0
  34. audiotrace-1.0.0/src/audiotrace/extractors.py +64 -0
  35. audiotrace-1.0.0/src/audiotrace/latency.py +41 -0
  36. audiotrace-1.0.0/src/audiotrace/models.py +106 -0
  37. audiotrace-1.0.0/src/audiotrace/quality.py +173 -0
  38. audiotrace-1.0.0/src/audiotrace/sentiment.py +89 -0
  39. audiotrace-1.0.0/src/audiotrace/transcripts.py +270 -0
  40. audiotrace-1.0.0/tests/conftest.py +16 -0
  41. audiotrace-1.0.0/tests/fixtures/README.md +26 -0
  42. audiotrace-1.0.0/tests/fixtures/paradise_hotel_booking_60s.mp3 +0 -0
  43. audiotrace-1.0.0/tests/fixtures/paradise_hotel_booking_60s.opus +0 -0
  44. audiotrace-1.0.0/tests/test_analyze.py +100 -0
  45. audiotrace-1.0.0/tests/test_cost.py +203 -0
  46. audiotrace-1.0.0/tests/test_events.py +204 -0
  47. audiotrace-1.0.0/tests/test_extractors.py +12 -0
  48. audiotrace-1.0.0/tests/test_fixtures.py +4 -0
  49. audiotrace-1.0.0/tests/test_latency.py +97 -0
  50. audiotrace-1.0.0/tests/test_models.py +37 -0
  51. audiotrace-1.0.0/tests/test_quality.py +206 -0
  52. audiotrace-1.0.0/tests/test_sentiment.py +185 -0
  53. audiotrace-1.0.0/tests/test_transcripts.py +297 -0
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
+ "permissions": {
4
+ "allow": [
5
+ "Bash(pytest:*)",
6
+ "Bash(python -m pytest:*)",
7
+ "Bash(ruff check:*)",
8
+ "Bash(ruff format:*)",
9
+ "Bash(mypy:*)",
10
+ "Bash(pip install -e .:*)",
11
+ "Bash(docker build:*)",
12
+ "Bash(docker run:*)"
13
+ ]
14
+ }
15
+ }
@@ -0,0 +1,16 @@
1
+ .git
2
+ .github
3
+ docs
4
+ *.md
5
+ !README.md
6
+ .claude
7
+ .venv
8
+ venv
9
+ __pycache__
10
+ *.py[cod]
11
+ *.egg-info
12
+ .pytest_cache
13
+ .ruff_cache
14
+ .mypy_cache
15
+ build
16
+ dist
@@ -0,0 +1,24 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Build test image
15
+ run: docker build -f docker/Dockerfile.test -t audiotrace-test .
16
+
17
+ - name: Lint (ruff)
18
+ run: docker run --rm audiotrace-test ruff check .
19
+
20
+ - name: Type-check (mypy)
21
+ run: docker run --rm audiotrace-test mypy src/audiotrace
22
+
23
+ - name: Tests (pytest)
24
+ run: docker run --rm audiotrace-test pytest
@@ -0,0 +1,222 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
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
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+ # Temporary file for partial code execution
204
+ tempCodeRunnerFile.py
205
+
206
+ # Ruff stuff:
207
+ .ruff_cache/
208
+
209
+ # PyPI configuration file
210
+ .pypirc
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
216
+
217
+ # Streamlit
218
+ .streamlit/secrets.toml
219
+
220
+ # Claude Code
221
+ # Personal, per-machine settings — should NOT be committed.
222
+ .claude/settings.local.json
@@ -0,0 +1,58 @@
1
+ # AudioTrace — Claude Code guide
2
+
3
+ AudioTrace is an open-source Python library that turns a raw voice-agent call
4
+ recording into a structured, queryable `CallReport` (transcript, quality,
5
+ sentiment, latency, cost, events). It is the shared signal-extraction layer
6
+ that voice-AI teams otherwise rebuild from scratch.
7
+
8
+ Status: early. The public data contract exists; the extraction pipeline is a
9
+ stub. Most work right now is building that pipeline and provider adapters.
10
+
11
+ ## Repository layout
12
+
13
+ ```
14
+ src/audiotrace/ # the library (src layout)
15
+ __init__.py # public API: analyze(), models, __version__
16
+ core.py # analyze() entry point
17
+ extractors.py # FFmpeg/ffprobe extraction logic
18
+ models.py # Pydantic CallReport and sub-models — the stable contract
19
+ tests/ # pytest suite
20
+ docs/
21
+ vision/ # why this exists (product vision, problem statement)
22
+ prd/ # what we build — one spec per feature, see docs/prd/README.md
23
+ roadmap.md # when — phases and ordering
24
+ docker/ # Dockerfiles for testing and production
25
+ scripts/ # Automation scripts
26
+ run.sh # Local CLI runner
27
+ .github/workflows/ # CI
28
+ ```
29
+
30
+ ## Commands
31
+
32
+ ```bash
33
+ # Setup
34
+ pip install -e ".[dev]" # install library + dev tooling
35
+
36
+ # Validation (Definition of Done)
37
+ ./scripts/test_local.sh test # format, lint, type-check, and test (100% coverage)
38
+
39
+ # Running locally
40
+ ./run.sh [file_path] # analyze a file interactively
41
+
42
+ # Reproduce CI locally (mirrors GitHub Actions exactly):
43
+ docker build -f docker/Dockerfile.test -t audiotrace-test .
44
+ docker run --rm audiotrace-test # Runs ./scripts/test_local.sh no-venv
45
+ ```
46
+
47
+ ## Working agreements
48
+
49
+ - **Read the PRD before building a feature.** Specs live in `docs/prd/`;
50
+ priorities and ordering in `docs/roadmap.md`. If a feature has no PRD, write
51
+ one (or ask) before implementing.
52
+ - **`models.py` is a public contract.** Changing field names/shapes is a
53
+ breaking change — call it out and update the README's CallReport tree to match.
54
+ - **The library targets Python 3.9+** (ruff/mypy are pinned to `py39`), even
55
+ though CI runs on a single 3.12 image. Avoid 3.10+-only syntax.
56
+ - **FFmpeg is a system dependency.** It's installed in the test image; assume it
57
+ exists at runtime, don't reimplement audio decoding.
58
+ - **Definition of Done: Keep CI green.** Before finishing any change, you **must** run `./scripts/test_local.sh test`. This script handles formatting, linting, type-checking, and testing. Direct use of `pytest` is discouraged for final validation. Test coverage must stay ≥ 95% (enforced by the script and `pyproject.toml`) — new code needs tests.
@@ -0,0 +1,50 @@
1
+ # Contributing to AudioTrace
2
+
3
+ Contributions are welcome — especially new provider adapters, persona
4
+ definitions for simulation, and compliance rule sets.
5
+
6
+ ## Development setup
7
+
8
+ ```bash
9
+ git clone https://github.com/audiotrace/audiotrace
10
+ cd audiotrace
11
+
12
+ # FFmpeg is required on your system:
13
+ # macOS: brew install ffmpeg
14
+ # Debian: sudo apt-get install ffmpeg
15
+
16
+ pip install -e ".[dev]"
17
+ pytest
18
+ ```
19
+
20
+ ## Before opening a PR
21
+
22
+ Run the same checks CI runs:
23
+
24
+ ```bash
25
+ ruff check .
26
+ ruff format .
27
+ mypy src/audiotrace
28
+ pytest
29
+ ```
30
+
31
+ Or reproduce CI exactly in Docker:
32
+
33
+ ```bash
34
+ docker build -f docker/Dockerfile.test -t audiotrace-test .
35
+ docker run --rm audiotrace-test pytest
36
+ ```
37
+
38
+ ## Working on a feature
39
+
40
+ - Features are specified in [`docs/prd/`](docs/prd/README.md). Read the relevant
41
+ PRD before starting; if there isn't one, open an issue or draft a PRD first.
42
+ - `src/audiotrace/models.py` is the public data contract — treat changes to it
43
+ as breaking, and keep the README's `CallReport` tree in sync.
44
+ - See [`docs/roadmap.md`](docs/roadmap.md) for priorities and ordering.
45
+
46
+ ## Guidelines
47
+
48
+ - Keep public API changes documented in the README.
49
+ - Add tests for new behavior; keep the suite green.
50
+ - Match the style of surrounding code (ruff enforces formatting and linting).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dima Statz
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.