Skip to content

Some utilities for interacting with The Palace Project.

License

Notifications You must be signed in to change notification settings

ThePalaceProject/palace-tools

Repository files navigation

Palace Tools 🛠️

Code style: black Imports: isort pre-commit

What's included

CLI Tools

  • audiobook-manifest-summary (summarize_rwpm_audio_manifest.py)
  • fetch-lcp
    • audiobook-manifest
      • Given an LCP audiobook fulfillment URL, retrieve it and store/print its manifest.
    • files
      • Given an LCP audiobook fulfillment URL, retrieve and store the lcp and lcpl files.
  • patron-bookshelf
    • Print a patron's bookshelf as either a summary or in full as JSON.
  • validate-audiobook-manifests
    • Validate a directory of RWPM audiobook manifests printing any errors found.
  • palace-terminal
    • A toy terminal based media player that can be used to play audiobooks from a local directory containing audiobook manifests and their associated media files.
    • Note: This application uses python-vlc which requires VLC to be installed on the system. The VLC installation can be found here.
  • download-feed - Download various feeds for local inspection.
    • opds2
      • Download an OPDS2 / OPDS2 + ODL feed.
    • overdrive
      • Download Overdrive feeds.
    • axis
      • Download B&T Axis 360 availability feed.

Library Support

Working as a developer on this project

pyenv

pyenv lets you easily switch between multiple versions of Python. It can be installed using the command curl https://pyenv.run | bash. You can then install the version of Python you want to work with.

It is recommended that pyenv-virtualenv be used to allow pyenv to manage virtual environments in a manner that can be used by the poetry tool. The pyenv-virtualenv plugin can be installed by cloning the relevant repository into the plugins subdirectory of your $PYENV_ROOT:

mkdir -p $PYENV_ROOT/plugins
cd $PYENV_ROOT/plugins
git clone https://github.com/pyenv/pyenv-virtualenv

After cloning the repository, pyenv now has a new virtualenv command:

$ pyenv virtualenv
pyenv-virtualenv: no virtualenv name given.

Poetry

This project uses poetry for dependency management. If you plan to work on this project, you will need poetry.

Poetry can be installed using the command curl -sSL https://install.python-poetry.org | python3 -.

More information about installation options can be found in the poetry documentation.

Installation

This package is not currently available oon PyPI, but it can be installed and run locally in a couple of different ways, depending on your needs.

Installing the CLI Tools globally with pipx

Installing with pipx will be most conducive to running the CLI Tools from any directory.

If you don't already have pipx installed, you can get installation instructions here.

pipx install git+https://github.com/ThePalaceProject/palace-tools.git

or, if you wish to install a particular branch or commit, you can do something like this (more details about installing from VCS here):

pipx install git+https://github.com/ThePalaceProject/palace-tools.git@branch-or-commit

If installation is successful, pipx will list the apps that are installed with the package.

Running CLI Tools from a cloned project

  • Clone the repository.
  • Change into the cloned directory.
  • Run pyenv virtualenv <python-version> <virtualenv-name> to create a Python virtual environment.
  • Run pyenv local <virtualenv-name> to use that virtual environment whenever in the cloned directory.
  • Run poetry install to install the project dependencies and the CLI tools into the virtual environment.

At this point, you should be able to run the CLI tools using poetry run <cli-command-and-args>.

About

Some utilities for interacting with The Palace Project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages