From b633b7fde975ffb3c7534992ed7c7536e192ac88 Mon Sep 17 00:00:00 2001 From: Sheldon Woodward Date: Thu, 12 Mar 2020 22:08:09 -0700 Subject: [PATCH] Feature/docs (#48) * Converted README.rst to markdown. * Changed wildcard imports to explicit imports in pymkv/__init__.py. * Added pdoc GitHub action and updated README.md docs link. --- .github/workflows/pdoc.yml | 52 ++++++++++++++++++++++++++++++++++++++ README.md | 23 +++++++++++++++++ README.rst | 46 --------------------------------- pymkv/__init__.py | 11 ++++---- 4 files changed, 81 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/pdoc.yml create mode 100644 README.md delete mode 100644 README.rst diff --git a/.github/workflows/pdoc.yml b/.github/workflows/pdoc.yml new file mode 100644 index 0000000..cb3061f --- /dev/null +++ b/.github/workflows/pdoc.yml @@ -0,0 +1,52 @@ +name: Build and publish pdoc documentation +on: + push: + branches: + - master +jobs: + build-n-publish: + name: Build and publish pdoc documentation + runs-on: ubuntu-18.04 + steps: + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Install and upgrade build tool packages + run: | + pip install --upgrade setuptools twine wheel + - name: Install pdoc + run: | + pip install --upgrade pdoc + - name: Checkout master + uses: actions/checkout@v2 + with: + path: pymkv + - name: Install pymkv + run: | + pip install pymkv + - name: Build docs + run: | + pdoc --html pymkv --html-dir ../docs --overwrite + working-directory: ./pymkv + - name: Checkout gh-pages + run: | + git fetch + git checkout gh-pages + working-directory: ./pymkv + - name: Copy doc files + run: | + cp docs/pymkv/* pymkv + - name: Commit doc files + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add -A + git commit -m "Docs update." + working-directory: ./pymkv + - name: Push doc changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages + directory: pymkv diff --git a/README.md b/README.md new file mode 100644 index 0000000..ea1b340 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# pymkv +[![PyPI Version](https://img.shields.io/pypi/v/pymkv.svg)](https://pypi.python.org/pypi/pymkv) +[![License](https://img.shields.io/github/license/sheldonkwoodward/pymkv.svg)](https://github.com/sheldonkwoodward/pymkv/LICENSE.txt) +[![Code Quality](https://api.codacy.com/project/badge/Grade/e1fe077d95f74a5886c557024777c26c)](https://api.codacy.com/project/badge/Grade/e1fe077d95f74a5886c557024777c26c) + +pymkv is a Python wrapper for mkvmerge. It provides support for muxing, splitting, linking, chapters, tags, and attachments through the use of mkvmerge. + +## About pymkv +pymkv is a Python 3 library for manipulating MKV files with mkvmerge. Previously, I was constructing mkvmerge commands manually. They were becoming overly complex and unmanageable. To remedy this, I decided to write this library to make mkvmerge more scriptable and easier to use. Please open new issues for any bugs you find, support is greatly appreciated! + +## Installation +mkvmerge must be installed on your computer. It is recommended to add it to your \$PATH variable but a different path can be manually specified. mkvmerge can be found and downloaded from [here] or in most package managers. + +To install pymkv from PyPI, use the following command: + + $ pip install pymkv + +You can also clone the repo and run the following command in the project root to edit the source code: + + $ pip install -e . + +## Documentation +The documentation for pymkv can be found in the [here](https://pymkv.shel.dev/). diff --git a/README.rst b/README.rst deleted file mode 100644 index 7fe34c9..0000000 --- a/README.rst +++ /dev/null @@ -1,46 +0,0 @@ -pymkv -===== -|PyPI Version| -|License| -|Codacy Badge| - -pymkv is a Python wrapper for mkvmerge. It provides support for muxing, splitting, linking, chapters, tags, and -attachments through the use of mkvmerge. - -About pymkv ------------ -pymkv is a Python 3 library for manipulating MKV files with mkvmerge. Previously, I was constructing mkvmerge -commands manually. They were becoming overly complex and unmanageable. To remedy this, I decided to write this -library to make mkvmerge more scriptable and easier to use. Please open new issues for any bugs you find, support -is greatly appreciated! - -Installation ------------- -mkvmerge must be installed on your computer. It is recommended to add it to your $PATH variable but a -different path can be manually specified. mkvmerge can be found and downloaded from -`here `__ or in most package managers. - -To install pymkv from PyPI, use the following command: - -:: - - $ pip install pymkv - -You can also clone the repo and run the following command in the project root to edit the source code: - -:: - - $ pip install -e . - -Documentation -------------- -The documentation for pymkv can be found in the `GitHub repo wiki `__. - -.. |PyPI Version| image:: https://img.shields.io/pypi/v/pymkv.svg - :target: https://pypi.python.org/pypi/pymkv - -.. |License| image:: https://img.shields.io/github/license/sheldonkwoodward/pymkv.svg - :target: https://github.com/sheldonkwoodward/pymkv/LICENSE.txt - -.. |Codacy Badge| image:: https://api.codacy.com/project/badge/Grade/e1fe077d95f74a5886c557024777c26c - :target: https://www.codacy.com/app/sheldonkwoodward/pymkv?utm_source=github.com&utm_medium=referral&utm_content=sheldonkwoodward/pymkv&utm_campaign=Badge_Grade diff --git a/pymkv/__init__.py b/pymkv/__init__.py index 6af42b0..0404947 100644 --- a/pymkv/__init__.py +++ b/pymkv/__init__.py @@ -3,11 +3,12 @@ from pkg_resources import get_distribution, DistributionNotFound -from .MKVAttachment import * -from .MKVTrack import * -from .MKVFile import * -from .Timestamp import * -from .Verifications import * +# package imports +from .MKVAttachment import MKVAttachment +from .MKVTrack import MKVTrack +from .MKVFile import MKVFile +from .Timestamp import Timestamp +from .Verifications import verify_matroska, verify_mkvmerge, verify_recognized, verify_supported # set the version number within the package using setuptools-scm