Giter Site home page Giter Site logo

polytaxis-monitor's Introduction

Installation

Requires Python 3.

Run:

pip install git+https://github.com/Rendaw/polytaxis-python
pip install git+https://github.com/Rendaw/polytaxis-monitor

Utilities

polytaxis-monitor

polytaxis-monitor monitors directories for polytaxis file additions/modifications/deletions and indexes their tags.

Files with no tags will be categorized with the tag 'untagged'.

note If you want to monitor a mount, make sure it's mounted before you start the monitor or nothing will be detected.

For usage, run polytaxis-monitor -h.

Launching at boot

note: If you haven't yet indexed existing files, run polytaxis-monitor manually with the -s argument before setting up the service.

Linux (with systemd)

Requires a distribution that supports user systemd instances.

Create the file ~/.config/systemd/user/polytaxis-monitor.service with the contents:

[Unit]
Description=polytaxis-monitor

[Service]
Type=simple
ExecStart=/usr/bin/polytaxis-monitor /home/my/files

[Install]
WantedBy=default.target

Configure the line ExecStart to contain directories you wish to monitor.

Run the following to start and run polytaxis-monitor at boot (with proper systemd configuration).

systemctl --user start polytaxis-monitor.service
systemctl --user enable polytaxis-monitor.service

Mac OSX (with launchd)

Create the file ~/Library/LaunchAgents/polytaxis-monitor.plist with the contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.zarbosoft.polytaxis-monitor</string>
    <key>ProgramArguments</key>
    <array>
        <string>polytaxis-monitor</string>
        <string>/Users/Me/my/files/</string>
    </array>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>

Run

launchctl load ~/Library/LaunchAgents/polytaxis-monitor.plist
launchctl start ~/Library/LaunchAgents/polytaxis-monitor.plist

note: This service doesn't run outside of your login, so if you modify/create/delete/move files as a different user (for example) the modifications won't be detected.

ptq

ptq is a command line tool to query the polytaxis-monitor database. ptq can search for files by tag as well as search available tags.

For information on flags and other arguments, run ptq -h.

File Queries

File queries are written as a list of terms. A term can be an inclusion (tag or tag=value, matched in full), an exclusion (^tag or ^tag=value), or a special term. Terms should be escaped if there are non-syntax special characters (equal signs, spaces, newlines, etc.) in the text.

Inclusions and exclusions can also incorporate %, which acts as a wildcard.

Special terms:

COLUMN>VALUE    Only output rows where the value of COLUMN > VALUE.
COLUMN>=VALUE   Only output rows where the value of COLUMN >= VALUE.
COLUMN<VALUE    Only output rows where the value of COLUMN < VALUE.
COLUMN<=VALUE   Only output rows where the value of COLUMN <= VALUE.
sort+:COLUMN    Sort output, ascending, by COLUMN.
sort-:COLUMN    Sort output, descending, by COLUMN.
sort?:COLUMN    Sort output, randomly, by COLUMN.
col:COLUMN      Include COLUMN in the output. If no columns are specified,
                show the filename.

Sorts are specified in higher to lower pecedence. Currently, columns cannot be selected (only the filename is displayed).

Example:

ptq 'album=polytaxis official soundtrack' sort+:discnumber sort+:tracknumber

Tag Queries

Tag queries take a single string. The string is used as a query parameter based on the query modifier ('prefix' or 'anywhere').

Example:

ptq -t prefix album=

The above lists all albums.

Support

Ask questions and raise issues on the GitHub issue tracker.

See Contributing below for information about prioritizing issues.

Contributing

  1. Develop and submit pull requests.

  2. Fund development via https://www.bountysource.com/

polytaxis-monitor's People

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.