Skip to content

Commit

Permalink
add usage to README
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Friend committed Apr 10, 2015
1 parent ed58c03 commit e153c3e
Showing 1 changed file with 26 additions and 35 deletions.
61 changes: 26 additions & 35 deletions README.md
@@ -1,47 +1,38 @@
ScreenCalc
======
A simple screen size calculator
# ScreenCalc
A simple screen size calculator to convert screen measurement units at various
densities

[![Build Status](http://img.shields.io/travis/joshfriend/dpi-converter/master.svg)](https://travis-ci.org/joshfriend/dpi-converter)
[![Coverage Status](http://img.shields.io/coveralls/joshfriend/dpi-converter/master.svg)](https://coveralls.io/r/joshfriend/dpi-converter)
[![Build Status](http://img.shields.io/travis/joshfriend/screencalc/master.svg)](https://travis-ci.org/joshfriend/screencalc)
[![Coverage Status](http://img.shields.io/coveralls/joshfriend/screencalc/master.svg)](https://coveralls.io/r/joshfriend/screencalc)
[![PyPI Version](http://img.shields.io/pypi/v/ScreenCalc.svg)](https://pypi.python.org/pypi/ScreenCalc)
[![PyPI Downloads](http://img.shields.io/pypi/dm/ScreenCalc.svg)](https://pypi.python.org/pypi/ScreenCalc)

# Getting Started

Getting Started
===============

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

* Python 2.7+ or Python 3.3+

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

ScreenCalc can be installed with pip:

Install:
```
$ pip install ScreenCalc
```

or directly from the source code:

```
$ git clone https://github.com/joshfriend/dpi-converter.git
$ cd dpi-converter
$ python setup.py install
```

Basic Usage
===========

After installation, the package can imported:

Use it:
```
$ python
>>> import sc
>>> sc.__version__
$ sc 100px@hdpi 100dp ...
100.0px@240dpi
+-----------+---------+----------+---------+---------+----------+------+
| density | dp | px | sp | mm | in | pt |
|-----------+---------+----------+---------+---------+----------+------|
| ldpi | 66.6667 | 50 | 66.6667 | 10.5833 | 0.416667 | 30 |
| mdpi | 66.6667 | 66.6667 | 66.6667 | 10.5833 | 0.416667 | 30 |
| tvdpi | 66.6667 | 88.75 | 66.6667 | 10.5833 | 0.416667 | 30 |
| hdpi | 66.6667 | 100 | 66.6667 | 10.5833 | 0.416667 | 30 |
| xhdpi | 66.6667 | 133.333 | 66.6667 | 10.5833 | 0.416667 | 30 |
| xxhdpi | 66.6667 | 200 | 66.6667 | 10.5833 | 0.416667 | 30 |
| xxxhdpi | 66.6667 | 266.667 | 66.6667 | 10.5833 | 0.416667 | 30 |
+-----------+---------+----------+---------+---------+----------+------+
...
```

ScreenCalc doesn't do anything, it's a template.
Known measurement units are: `dp`, `px`, `sp`, `mm`, `in`, and `pt`. Screen
density can be one of the named values (`ldpi`, `mdpi`, `tvdpi`, `hdpi`,
`xhdpi`, `xxhdpi`, or `xxxhdpi`), or a decimal value (e.g. `100`).

0 comments on commit e153c3e

Please sign in to comment.