Giter VIP home page Giter VIP logo

pyedid's Introduction

pyEDID

Build Status codecov PyPI PyPI - Python Version PyPI - Status PyPI - Downloads PyPI - License

Getting started

This is a python library to parse extended display identification data (EDID).

This project based on pyedid

EDID data format

The EDID data frame format is described in detail on the Wikipedia page.

Requirements

  • Python 3.6+
  • requests

Setup

pip3 install pyedid

Features

  • Parsing EDID data from hex or bytes
  • Embedded PNP ID registry with dump/restore to CSV file
  • Updatable PNP ID registry from www.uefi.org

Docs

ToDO

Quickstart

Parsing some hex EDID data with the default registry

import pyedid

edid_hex = (
    '00ffffffffffff000469982401010101'
    '1e1b01031e351e78ea9265a655559f28'
    '0d5054bfef00714f818081409500a940'
    'b300d1c00101023a801871382d40582c'
    '4500132b2100001e000000fd00324c1e'
    '5311000a202020202020000000fc0056'
    '533234380a20202020202020000000ff'
    '0048374c4d51533132323136310a0000'
)

# returned Edid object, used the Default embedded registry
edid = pyedid.parse_edid(edid_hex)

edid.name # 'VS248'
edid.manufacturer # 'Ancor Communications Inc'
edid.serial # 'H7LMQS122161'
edid.year # 2017 (year of manufacture)
edid.week # 30 (week of manufacture)
edid.width # 53.0 cm
edid.height # 30.0 cm
edid.resolutions # list with resulutions (x, y, rate), ex (720, 400, 70.0)
edid... # some other EDID data

json_str = str(edid) # making JSON string object

Getting EDID from xrandr --verbose

from pyedid import get_edid_from_xrandr_verbose
from subprocess import check_output

# getting `xrandr --verbose` output
randr = check_output(['xrandr', '--verbose'])

# parsing xrandr outputs to a bytes edid's list
edids = get_edid_from_xrandr_verbose(randr)

# parsing edid
edid = pyedid.parse_edid(edids[0])

Working with registry

from pyedid import Registry, DEFAULT_REGISTRY

# making a registry object from www.uefi.org
r_web = Registry.from_web()

# dumping the default registry to csv file
DEFAULT_REGISTRY.to_csv('/path/to/csv.file')

# restoring registry from csv file
r_csv = Registry.from_csv('/path/to/csv.file')

Licensing

See LICENSE

pyedid's People

Contributors

bksrb avatar dd4e avatar jojonas avatar mattalxndr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pyedid's Issues

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.