Skip to content

Commit

Permalink
Organize for packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrookman committed Oct 9, 2020
1 parent 0fe8b1e commit 87c995c
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# trackrip
_(tracker-rip)_

Extracts samples from music tracker module files.
Extracts samples from various music tracker module formats.

- Currently supports the following formats:
- __MOD__
- __S3M__
- __IT__ (partially)
- __IT__

## Usage

`python3 trackrip <module_file>`
`trackrip <module_file>`

## Useful Links
### ProTracker MOD Format
Expand Down
37 changes: 37 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import pathlib
from setuptools import setup
from trackrip import __version__

here = pathlib.Path(__file__).parent.resolve()
README = (here / 'README.md').read_text(encoding='utf-8')

setup(
name = "trackrip",
version = __version__,
description = "Extracts samples from various music tracker module formats",
long_description = README,
long_description_content_type = "text/markdown",
url = "https://github.com/dbrookman/trackrip",
author = "Daniel Brookman",
author_email = "dannntrax@gmail.com",
license = "MIT",
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia :: Sound/Audio :: Conversion"
],
keywords = "tracker music samples mod s3m it",
packages = ["trackrip"],
python_requires = ">=3.7",
entry_points={
'console_scripts': [
'trackrip=trackrip.__main__:main',
],
},
)
1 change: 1 addition & 0 deletions trackrip/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.0.0"
6 changes: 3 additions & 3 deletions trackrip/__main__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Rips all samples contained by a specified MOD music file to WAV."""
"""Rips all samples contained in a specified tracker music file to WAV."""

import argparse
from pathlib import Path
import string
import wave
import tracker
from . import tracker

def main():
"""Parses, opens and extracts samples from a tracker module file."""
Expand Down Expand Up @@ -40,7 +40,7 @@ def main():
print("[Exporting Sample] " + sample_file_name)
sample_file_name += ".wav"

output = Path(output_path, sample_file_name)
output = output_path / sample_file_name
out = wave.open(str(output), "wb")
out.setnchannels(1)
out.setsampwidth(sample["width"])
Expand Down
2 changes: 1 addition & 1 deletion trackrip/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
samples inside them.
"""
from io import SEEK_CUR
import pcm
from . import pcm

def identify_module(file) -> str:
"""
Expand Down

0 comments on commit 87c995c

Please sign in to comment.