Skip to main content

PTP / IP client

Project description

Getting started

import asyncio

from ptpip.client import PtpIpClient
from ptpip.report.html_device import HtmlDeviceReportGenerator

async def usePtpIpClient(client: PtpIpClient):
    device = await client.get_device_info()
    props = []
    for idx, prop in enumerate(device.properties):
        prop_desc = await client.get_device_prop_desc(
            prop=prop,
            transaction_id=0x100 | idx,
            delay=0
        )
        props.append(prop_desc)

    discoveredProps = await client.discover_device_prop_desc(device, delay=0)

    html = HtmlDeviceReportGenerator(device, props, discoveredProps) \
        .generate()

    reportFileName = 'd5300.html'
    f = open(reportFileName, 'w')
    f.write(html)
    f.close()

    print('Report saved ! ' + reportFileName)

PtpIpClient(usePtpIpClient)

Sample report for Nikon d5300

References

https://github.com/mmattes/ptpip
http://www.gphoto.org/doc/ptpip.php
https://github.com/Fimagena/libptp
https://github.com/whoozle/android-file-transfer-linux/tree/master/mtp/ptp
https://github.com/Parrot-Developers/sequoia-ptpy/blob/master/ptpy/ptp.py https://api.ricoh/docs/theta-web-api/property/still_capture_mode/

https://manualzz.com/download/46005016 D5000 MTP Specifications
https://www.usb.org/sites/default/files/MTPv1_1.zip
https://github.com/gphoto/libgphoto2/

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

ptpip-0.0.4.tar.gz (30.5 kB view hashes)

Uploaded Source

Built Distribution

ptpip-0.0.4-py3-none-any.whl (53.1 kB view hashes)

Uploaded Python 3

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