trackparse 0.3.2__tar.gz → 0.3.3__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.
- {trackparse-0.3.2 → trackparse-0.3.3}/PKG-INFO +30 -4
- {trackparse-0.3.2 → trackparse-0.3.3}/README.md +28 -2
- {trackparse-0.3.2 → trackparse-0.3.3}/pyproject.toml +2 -2
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/__init__.py +1 -1
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_data.py +1 -1
- {trackparse-0.3.2 → trackparse-0.3.3}/.gitignore +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/LICENSE +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_artists.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_assemble.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_classify.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_context.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_credits.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_digits.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_format.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_mode.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_normalize.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_parser.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_prefix.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_scanner.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_separator.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_tables.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_title.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_tracklist_edits.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_tracklist_kinds.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_tracklist_options.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_tracklist_parse.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_tracklist_positions.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_tracklist_split.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_tracklist_times.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_tracklist_types.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_tracklist_warnings.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/_words.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/options.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/py.typed +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/tracklist.py +0 -0
- {trackparse-0.3.2 → trackparse-0.3.3}/src/trackparse/types.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: trackparse
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Spec-driven parser for music track titles and tracklists: artists, feat, remixes, versions, junk, positions, times.
|
|
5
5
|
Project-URL: Homepage, https://4matic.github.io/trackparse/
|
|
6
|
-
Project-URL: Documentation, https://4matic.github.io/trackparse/
|
|
6
|
+
Project-URL: Documentation, https://4matic.github.io/trackparse/start/getting-started/
|
|
7
7
|
Project-URL: Repository, https://github.com/4matic/trackparse
|
|
8
8
|
Project-URL: Issues, https://github.com/4matic/trackparse/issues
|
|
9
9
|
Project-URL: Changelog, https://github.com/4matic/trackparse/blob/main/python/CHANGELOG.md
|
|
@@ -38,7 +38,7 @@ Description-Content-Type: text/markdown
|
|
|
38
38
|
[](https://github.com/4matic/trackparse/actions/workflows/python.yml)
|
|
39
39
|
[](https://github.com/4matic/trackparse/blob/main/LICENSE)
|
|
40
40
|
|
|
41
|
-
**[Documentation](https://4matic.github.io/trackparse/)** · **[
|
|
41
|
+
**[Documentation](https://4matic.github.io/trackparse/)** · **[Getting started](https://4matic.github.io/trackparse/start/getting-started/)** · **[Playground](https://4matic.github.io/trackparse/playground/)**
|
|
42
42
|
|
|
43
43
|
**Turn messy track names into structured data: who made it, who's featured, who remixed it, and
|
|
44
44
|
what's just noise.**
|
|
@@ -72,6 +72,8 @@ uv add trackparse
|
|
|
72
72
|
|
|
73
73
|
## Quick start
|
|
74
74
|
|
|
75
|
+
**Docs:** [Getting started](https://4matic.github.io/trackparse/start/getting-started/)
|
|
76
|
+
|
|
75
77
|
```python
|
|
76
78
|
from trackparse import format_track, parse
|
|
77
79
|
|
|
@@ -143,6 +145,8 @@ print(json.dumps(track.to_dict(), indent=2))
|
|
|
143
145
|
|
|
144
146
|
## API
|
|
145
147
|
|
|
148
|
+
**Docs:** [Other functions](https://4matic.github.io/trackparse/reference/functions/)
|
|
149
|
+
|
|
146
150
|
```python
|
|
147
151
|
parse(input, *, mode="auto", uploader=None, known_artists=(), split_and="auto", keywords=None) -> ParsedTrack
|
|
148
152
|
parse_artists(input, *, <same options>) -> list[Artist]
|
|
@@ -156,6 +160,8 @@ SPEC_VERSION, __version__
|
|
|
156
160
|
|
|
157
161
|
### `parse(input, **options)`
|
|
158
162
|
|
|
163
|
+
**Docs:** [parse and ParsedTrack](https://4matic.github.io/trackparse/reference/parse/) · [Options](https://4matic.github.io/trackparse/reference/options/)
|
|
164
|
+
|
|
159
165
|
| Option | Default | |
|
|
160
166
|
|---|---|---|
|
|
161
167
|
| `mode` | `"auto"` | `"clean"`, `"youtube"`, `"filename"`, `"tracklist"`, or `"auto"` to detect from the string |
|
|
@@ -196,6 +202,8 @@ the defaults. Passing something that isn't a `str` raises `TypeError`.
|
|
|
196
202
|
|
|
197
203
|
### `ParsedTrack`
|
|
198
204
|
|
|
205
|
+
**Docs:** [ParsedTrack fields](https://4matic.github.io/trackparse/reference/parse/#parsedtrack)
|
|
206
|
+
|
|
199
207
|
| Attribute | Type | |
|
|
200
208
|
|---|---|---|
|
|
201
209
|
| `input` | `str` | The original string, untouched |
|
|
@@ -238,6 +246,8 @@ Version types, junk kinds and warnings are listed in the
|
|
|
238
246
|
|
|
239
247
|
### `to_dict()` and `from_dict()`
|
|
240
248
|
|
|
249
|
+
**Docs:** [JSON and Python objects](https://4matic.github.io/trackparse/reference/parse/#json-and-python-objects)
|
|
250
|
+
|
|
241
251
|
Every result class has `to_dict()`, which returns plain dicts and lists matching
|
|
242
252
|
[`parsed-track.schema.json`](https://github.com/4matic/trackparse/blob/main/spec/schema/parsed-track.schema.json)
|
|
243
253
|
(`fullTitle`, `unknownArtist`, ...). With `json.dumps(track.to_dict(), separators=(",", ":"),
|
|
@@ -250,6 +260,8 @@ ParsedTrack.from_dict(track.to_dict()) == track # True
|
|
|
250
260
|
|
|
251
261
|
### `parse_artists(input, **options)`
|
|
252
262
|
|
|
263
|
+
**Docs:** [parseArtists](https://4matic.github.io/trackparse/reference/functions/#parseartistsinput-options)
|
|
264
|
+
|
|
253
265
|
Splits a bare artist string. Takes the same options as `parse`.
|
|
254
266
|
|
|
255
267
|
```python
|
|
@@ -261,6 +273,8 @@ from trackparse import parse_artists
|
|
|
261
273
|
|
|
262
274
|
### `format_track(track, **options)`
|
|
263
275
|
|
|
276
|
+
**Docs:** [format](https://4matic.github.io/trackparse/reference/functions/#formattrack-options) · [Formatting](https://4matic.github.io/trackparse/guides/formatting/)
|
|
277
|
+
|
|
264
278
|
Renders a track back to a string.
|
|
265
279
|
|
|
266
280
|
| Option | Default | |
|
|
@@ -290,6 +304,8 @@ format_track(track, position=True)
|
|
|
290
304
|
|
|
291
305
|
### `normalize(s)`
|
|
292
306
|
|
|
307
|
+
**Docs:** [normalize](https://4matic.github.io/trackparse/reference/functions/#normalizeinput)
|
|
308
|
+
|
|
293
309
|
The Unicode cleanup every function runs first: NFC, invisible characters, and dash, bracket and
|
|
294
310
|
quote variants.
|
|
295
311
|
|
|
@@ -302,6 +318,8 @@ normalize("Noisia – Stigma (VIP)")
|
|
|
302
318
|
|
|
303
319
|
### `all_artists(track)`
|
|
304
320
|
|
|
321
|
+
**Docs:** [allArtists](https://4matic.github.io/trackparse/reference/functions/#allartiststrack)
|
|
322
|
+
|
|
305
323
|
Credits plus every remixer, deduplicated.
|
|
306
324
|
|
|
307
325
|
```python
|
|
@@ -313,6 +331,8 @@ from trackparse import all_artists
|
|
|
313
331
|
|
|
314
332
|
### `create_parser(**options)`
|
|
315
333
|
|
|
334
|
+
**Docs:** [createParser](https://4matic.github.io/trackparse/reference/functions/#createparseroptions)
|
|
335
|
+
|
|
316
336
|
Compiles the options once, for many calls. Per-call options are merged over the parser's: a value
|
|
317
337
|
passed per call replaces the base one (`known_artists` included), `None` leaves it alone, and
|
|
318
338
|
`keywords` dicts are merged.
|
|
@@ -335,6 +355,8 @@ released together and always share one version number.
|
|
|
335
355
|
|
|
336
356
|
## Modes
|
|
337
357
|
|
|
358
|
+
**Docs:** [Modes](https://4matic.github.io/trackparse/guides/modes/)
|
|
359
|
+
|
|
338
360
|
| Mode | For | Adds |
|
|
339
361
|
|---|---|---|
|
|
340
362
|
| `clean` | Store metadata, tags | Only a spaced dash separates artist and title |
|
|
@@ -358,6 +380,8 @@ parse("Shelter", mode="youtube", uploader="Porter Robinson").artists
|
|
|
358
380
|
|
|
359
381
|
## Tracklists
|
|
360
382
|
|
|
383
|
+
**Docs:** [Tracklists](https://4matic.github.io/trackparse/guides/tracklists/) · [Editing tracklists](https://4matic.github.io/trackparse/guides/editing-tracklists/)
|
|
384
|
+
|
|
361
385
|
`trackparse.tracklist` parses a whole tracklist, one entry per line, and checks it. Each entry
|
|
362
386
|
keeps its line exactly as written plus its own line ending, so `"".join(e.raw + e.eol for e in
|
|
363
387
|
tl.entries)` is always the input, CRLF or not.
|
|
@@ -467,6 +491,8 @@ parse("Electrosoul System - Liquid Metal", mode="tracklist").title
|
|
|
467
491
|
|
|
468
492
|
## Typing
|
|
469
493
|
|
|
494
|
+
**Docs:** [Types](https://4matic.github.io/trackparse/reference/parse/#types)
|
|
495
|
+
|
|
470
496
|
The package ships `py.typed` and passes `mypy --strict`. `ParsedTrack`, `Artist`, `Version`,
|
|
471
497
|
`Junk`, `Flags`, `Position` and `Timestamp` are frozen dataclasses with snake_case attributes, and
|
|
472
498
|
so are the tracklist results in `trackparse.tracklist`.
|
|
@@ -495,7 +521,7 @@ same spec rule IDs. Behaviour changes start in the spec, not here: see
|
|
|
495
521
|
|
|
496
522
|
## Links
|
|
497
523
|
|
|
498
|
-
- [Documentation](https://4matic.github.io/trackparse/), with
|
|
524
|
+
- [Documentation](https://4matic.github.io/trackparse/), with every example in Python and JavaScript, and a
|
|
499
525
|
[playground](https://4matic.github.io/trackparse/playground/) that runs the parser in your browser
|
|
500
526
|
- [Spec](https://github.com/4matic/trackparse/blob/main/spec/SPEC.md)
|
|
501
527
|
- [Project README](https://github.com/4matic/trackparse#readme)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/4matic/trackparse/actions/workflows/python.yml)
|
|
6
6
|
[](https://github.com/4matic/trackparse/blob/main/LICENSE)
|
|
7
7
|
|
|
8
|
-
**[Documentation](https://4matic.github.io/trackparse/)** · **[
|
|
8
|
+
**[Documentation](https://4matic.github.io/trackparse/)** · **[Getting started](https://4matic.github.io/trackparse/start/getting-started/)** · **[Playground](https://4matic.github.io/trackparse/playground/)**
|
|
9
9
|
|
|
10
10
|
**Turn messy track names into structured data: who made it, who's featured, who remixed it, and
|
|
11
11
|
what's just noise.**
|
|
@@ -39,6 +39,8 @@ uv add trackparse
|
|
|
39
39
|
|
|
40
40
|
## Quick start
|
|
41
41
|
|
|
42
|
+
**Docs:** [Getting started](https://4matic.github.io/trackparse/start/getting-started/)
|
|
43
|
+
|
|
42
44
|
```python
|
|
43
45
|
from trackparse import format_track, parse
|
|
44
46
|
|
|
@@ -110,6 +112,8 @@ print(json.dumps(track.to_dict(), indent=2))
|
|
|
110
112
|
|
|
111
113
|
## API
|
|
112
114
|
|
|
115
|
+
**Docs:** [Other functions](https://4matic.github.io/trackparse/reference/functions/)
|
|
116
|
+
|
|
113
117
|
```python
|
|
114
118
|
parse(input, *, mode="auto", uploader=None, known_artists=(), split_and="auto", keywords=None) -> ParsedTrack
|
|
115
119
|
parse_artists(input, *, <same options>) -> list[Artist]
|
|
@@ -123,6 +127,8 @@ SPEC_VERSION, __version__
|
|
|
123
127
|
|
|
124
128
|
### `parse(input, **options)`
|
|
125
129
|
|
|
130
|
+
**Docs:** [parse and ParsedTrack](https://4matic.github.io/trackparse/reference/parse/) · [Options](https://4matic.github.io/trackparse/reference/options/)
|
|
131
|
+
|
|
126
132
|
| Option | Default | |
|
|
127
133
|
|---|---|---|
|
|
128
134
|
| `mode` | `"auto"` | `"clean"`, `"youtube"`, `"filename"`, `"tracklist"`, or `"auto"` to detect from the string |
|
|
@@ -163,6 +169,8 @@ the defaults. Passing something that isn't a `str` raises `TypeError`.
|
|
|
163
169
|
|
|
164
170
|
### `ParsedTrack`
|
|
165
171
|
|
|
172
|
+
**Docs:** [ParsedTrack fields](https://4matic.github.io/trackparse/reference/parse/#parsedtrack)
|
|
173
|
+
|
|
166
174
|
| Attribute | Type | |
|
|
167
175
|
|---|---|---|
|
|
168
176
|
| `input` | `str` | The original string, untouched |
|
|
@@ -205,6 +213,8 @@ Version types, junk kinds and warnings are listed in the
|
|
|
205
213
|
|
|
206
214
|
### `to_dict()` and `from_dict()`
|
|
207
215
|
|
|
216
|
+
**Docs:** [JSON and Python objects](https://4matic.github.io/trackparse/reference/parse/#json-and-python-objects)
|
|
217
|
+
|
|
208
218
|
Every result class has `to_dict()`, which returns plain dicts and lists matching
|
|
209
219
|
[`parsed-track.schema.json`](https://github.com/4matic/trackparse/blob/main/spec/schema/parsed-track.schema.json)
|
|
210
220
|
(`fullTitle`, `unknownArtist`, ...). With `json.dumps(track.to_dict(), separators=(",", ":"),
|
|
@@ -217,6 +227,8 @@ ParsedTrack.from_dict(track.to_dict()) == track # True
|
|
|
217
227
|
|
|
218
228
|
### `parse_artists(input, **options)`
|
|
219
229
|
|
|
230
|
+
**Docs:** [parseArtists](https://4matic.github.io/trackparse/reference/functions/#parseartistsinput-options)
|
|
231
|
+
|
|
220
232
|
Splits a bare artist string. Takes the same options as `parse`.
|
|
221
233
|
|
|
222
234
|
```python
|
|
@@ -228,6 +240,8 @@ from trackparse import parse_artists
|
|
|
228
240
|
|
|
229
241
|
### `format_track(track, **options)`
|
|
230
242
|
|
|
243
|
+
**Docs:** [format](https://4matic.github.io/trackparse/reference/functions/#formattrack-options) · [Formatting](https://4matic.github.io/trackparse/guides/formatting/)
|
|
244
|
+
|
|
231
245
|
Renders a track back to a string.
|
|
232
246
|
|
|
233
247
|
| Option | Default | |
|
|
@@ -257,6 +271,8 @@ format_track(track, position=True)
|
|
|
257
271
|
|
|
258
272
|
### `normalize(s)`
|
|
259
273
|
|
|
274
|
+
**Docs:** [normalize](https://4matic.github.io/trackparse/reference/functions/#normalizeinput)
|
|
275
|
+
|
|
260
276
|
The Unicode cleanup every function runs first: NFC, invisible characters, and dash, bracket and
|
|
261
277
|
quote variants.
|
|
262
278
|
|
|
@@ -269,6 +285,8 @@ normalize("Noisia – Stigma (VIP)")
|
|
|
269
285
|
|
|
270
286
|
### `all_artists(track)`
|
|
271
287
|
|
|
288
|
+
**Docs:** [allArtists](https://4matic.github.io/trackparse/reference/functions/#allartiststrack)
|
|
289
|
+
|
|
272
290
|
Credits plus every remixer, deduplicated.
|
|
273
291
|
|
|
274
292
|
```python
|
|
@@ -280,6 +298,8 @@ from trackparse import all_artists
|
|
|
280
298
|
|
|
281
299
|
### `create_parser(**options)`
|
|
282
300
|
|
|
301
|
+
**Docs:** [createParser](https://4matic.github.io/trackparse/reference/functions/#createparseroptions)
|
|
302
|
+
|
|
283
303
|
Compiles the options once, for many calls. Per-call options are merged over the parser's: a value
|
|
284
304
|
passed per call replaces the base one (`known_artists` included), `None` leaves it alone, and
|
|
285
305
|
`keywords` dicts are merged.
|
|
@@ -302,6 +322,8 @@ released together and always share one version number.
|
|
|
302
322
|
|
|
303
323
|
## Modes
|
|
304
324
|
|
|
325
|
+
**Docs:** [Modes](https://4matic.github.io/trackparse/guides/modes/)
|
|
326
|
+
|
|
305
327
|
| Mode | For | Adds |
|
|
306
328
|
|---|---|---|
|
|
307
329
|
| `clean` | Store metadata, tags | Only a spaced dash separates artist and title |
|
|
@@ -325,6 +347,8 @@ parse("Shelter", mode="youtube", uploader="Porter Robinson").artists
|
|
|
325
347
|
|
|
326
348
|
## Tracklists
|
|
327
349
|
|
|
350
|
+
**Docs:** [Tracklists](https://4matic.github.io/trackparse/guides/tracklists/) · [Editing tracklists](https://4matic.github.io/trackparse/guides/editing-tracklists/)
|
|
351
|
+
|
|
328
352
|
`trackparse.tracklist` parses a whole tracklist, one entry per line, and checks it. Each entry
|
|
329
353
|
keeps its line exactly as written plus its own line ending, so `"".join(e.raw + e.eol for e in
|
|
330
354
|
tl.entries)` is always the input, CRLF or not.
|
|
@@ -434,6 +458,8 @@ parse("Electrosoul System - Liquid Metal", mode="tracklist").title
|
|
|
434
458
|
|
|
435
459
|
## Typing
|
|
436
460
|
|
|
461
|
+
**Docs:** [Types](https://4matic.github.io/trackparse/reference/parse/#types)
|
|
462
|
+
|
|
437
463
|
The package ships `py.typed` and passes `mypy --strict`. `ParsedTrack`, `Artist`, `Version`,
|
|
438
464
|
`Junk`, `Flags`, `Position` and `Timestamp` are frozen dataclasses with snake_case attributes, and
|
|
439
465
|
so are the tracklist results in `trackparse.tracklist`.
|
|
@@ -462,7 +488,7 @@ same spec rule IDs. Behaviour changes start in the spec, not here: see
|
|
|
462
488
|
|
|
463
489
|
## Links
|
|
464
490
|
|
|
465
|
-
- [Documentation](https://4matic.github.io/trackparse/), with
|
|
491
|
+
- [Documentation](https://4matic.github.io/trackparse/), with every example in Python and JavaScript, and a
|
|
466
492
|
[playground](https://4matic.github.io/trackparse/playground/) that runs the parser in your browser
|
|
467
493
|
- [Spec](https://github.com/4matic/trackparse/blob/main/spec/SPEC.md)
|
|
468
494
|
- [Project README](https://github.com/4matic/trackparse#readme)
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "trackparse"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.3"
|
|
8
8
|
description = "Spec-driven parser for music track titles and tracklists: artists, feat, remixes, versions, junk, positions, times."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -45,7 +45,7 @@ dependencies = []
|
|
|
45
45
|
|
|
46
46
|
[project.urls]
|
|
47
47
|
Homepage = "https://4matic.github.io/trackparse/"
|
|
48
|
-
Documentation = "https://4matic.github.io/trackparse/
|
|
48
|
+
Documentation = "https://4matic.github.io/trackparse/start/getting-started/"
|
|
49
49
|
Repository = "https://github.com/4matic/trackparse"
|
|
50
50
|
Issues = "https://github.com/4matic/trackparse/issues"
|
|
51
51
|
Changelog = "https://github.com/4matic/trackparse/blob/main/python/CHANGELOG.md"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|