Skip to main content

Exiftool protocol and stream endpoint plugin to be used with twisted

Project description

https://travis-ci.org/znerol/twisted-exiftool.svg?branch=master

Exiftool protocol and stream endpoint plugin to be used with twisted.

Usage

from twisted.internet import defer, endpoints, protocol, reactor
from twisted_exiftool import ExiftoolProtocol

@defer.inlineCallbacks
def test():
    # Construct an exiftool endpoint. If the tool is installed in a custom
    # location, specify the path to the binary as the first argument. E.g.
    # 'exiftool:/path/to/exiftool'
    ep = endpoints.clientFromString(reactor, 'exiftool')

    # Instantiate the protocol by connecting to the endpoint
    f = protocol.Factory.forProtocol(ExiftoolProtocol)
    p = yield ep.connect(f)

    # Run commands and retrieve results.
    metadata = yield p.execute('-j', '/usr/share/pixmaps/gtkvim.png')
    print metadata

    # Disconnect
    yield p.loseConnection()

    reactor.stop()

reactor.callWhenRunning(test)
reactor.run()

License

The software is subject to the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TwistedExiftool-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file TwistedExiftool-0.1.1.tar.gz.

File metadata

File hashes

Hashes for TwistedExiftool-0.1.1.tar.gz
Algorithm Hash digest
SHA256 44e377d65a92571d0c11dab7df66fa1b35915bae68a037cf820afc7460eda249
MD5 e92351e97e3f5ca998d418955637aff6
BLAKE2b-256 1768fe0e4b6c6197cd54bf8130357d3bb8f44417be454bf350fe3c6561e1b600

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page