semvec/pypi-packages huggingface dataset:
plexcli 0.3.0
Command Line Interface for Plex
License: MIT

plexcli
=======

**CLI for Plex**

|Maturity| |License| |Change Log| |Build Status| |Version|

About
-----

Installation provides a command line utility (plex) which can be used to
interact with Plex services. Commands are subtasks of the plex utility.
The full list of subtasks are visible by running 'plex --help'.

Requirements
------------

-  syndicate Python Library
-  humanize Python Library
-  Plex Account
-  Plex Server [and/or Client (soon)]

Installation
------------

**PyPi Stable Release**

::

    pip3 install plexcli

**Development Release**

::

    python3 ./setup.py build
    python3 ./setup.py install

*or*

::

    python3 ./setup.py develop

Compatibility
-------------

-  Python 3.4+

Mac OSX Notes
-------------

I feel compelled to make a note about OSX as I've decided to only
support Python 3.4+ for this tool. In my experience, using Python 3 as
installed by Homebrew and setuptools as installed by pip, a usable PATH
is not provided and/or symlinking behavior for python3 setuptools
scripts is not handled.

To work around this I'm simply adding the 'bin' directory used for the
Python 3 framework to my PATH variable, a la..

.. code:: shell

    PATH=$PATH:/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/bin

I welcome someone explaining to me a better solution.

.. |Maturity| image:: https://img.shields.io/pypi/status/plexcli.svg
   :target: https://pypi.python.org/pypi/plexcli
.. |License| image:: https://img.shields.io/pypi/l/plexcli.svg
   :target: https://pypi.python.org/pypi/plexcli
.. |Change Log| image:: https://img.shields.io/badge/change-log-blue.svg
   :target: https://github.com/mayfield/plexcli/blob/master/CHANGELOG.md
.. |Build Status| image:: https://semaphoreci.com/api/v1/projects/5c2797d3-7839-4176-a14f-be1ed80a06f2/547084/shields_badge.svg
   :target: https://semaphoreci.com/mayfield/plexcli
.. |Version| image:: https://img.shields.io/pypi/v/plexcli.svg
   :target: https://pypi.python.org/pypi/plexcli
clfparser 0.3
Apache Common/Combined Log Format Parser
License: MIT
Keywords: apache common combined log spark

=================================
Apache Common/Combined Log Parser
=================================

Parses a single Apache web log format record. The parser wil first attempt to match a *combined* format record, if this fails it will attempt to match a *common* format record. In the event that the record matches neither pattern, a null record will be returned.

To return a dictionary representing the entire record or a list of specified objects call *CLFParser.logDict(record)*, passing a single log record::

    >>> from clfparser import CLFParser
    >>> logRecord='10.223.157.186 - - [15/Jul/2009:14:58:59 -0700] "GET /favicon.ico HTTP/1.1" 404 209'
    >>> clfDict=CLFParser.logDict(logRecord)
    >>> print clfDict
    {'b': '209', 'h': '10.223.157.186', 'time': datetime.datetime(2009, 7, 15, 14, 58, 59), 'l': '-', 'Referer': '', 
        's': '404', 'r': '"GET /favicon.ico HTTP/1.1"', 'u': '-', 't': '[15/Jul/2009:14:58:59 -0700]', 'timezone': '-0700', 'Useragent': ''}

Note that the returned dictionary keys lack the leading %, this will hopefully be amended in a later release.

To return a subset of the log record as a list, call *CLFParser.logParts(record, formatMask)*. where *formatMask* is a quoted string listing the log items required in the output::

    >>> clfParts=CLFParser.logParts(test,'%h %time')
    >>> print clfParts
    ['10.223.157.186', datetime.datetime(2009, 7, 15, 14, 58, 59)]

Common Log Format
-----------------

Described by::

    '%h %l %u %t "%r" %>s %b'

Where:

- *%h* - host
- *%l* - identity
- *%u* - userid
- *%t* - time
- *%r* - request
- *%>s* - status
- *%b* - size

Combined Log Format
-------------------

As Common Log Format with the addition of 2 further fields::

    '%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"'

Where:

- *%{Referer}i* - HTTP request header referer
- *%{User-agent}i* - HTTP request header user agent

Additional Fields
-----------------

In addition to the standard log fields, clfparser also parses the log time field, *%t*, to create a Python datetime object *%time* and a string object representing the timezone, *%timezone*.

Installation
------------

Install using **pip**::

    pip install clfparser

To Do
-----

- Amend dictionary key names to reflect the Apache specification (add leading %).
- Performance improvements
- Command line tools
- Identify request resource as an additional data item