GithubHelp home page GithubHelp logo

bepuzzled / unitdb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ghostwrench/unitdb

0.0 0.0 0.0 32 KB

A simple JSON database containing conversion factors and other information for a large number of measurement units

License: MIT License

unitdb's Introduction

unitdb

A simple JSON database containing conversion factors and other information for a large number of measurement units

Repository Structure

  • The db.json file contains all prefix and unit definitions
  • The schema.json file is a jsonschema that defines the structure of the db.json file
  • The nist811 folder contains .csv that contain conversion factors defined by NIST more info

db.json

This file contains definitions for standard (SI) prefixes and measurement units (SI and non-SI). Each field is keyed by it's most common symbol. Prefixes are structured as in the following example:

{
    "m": {
        "scale": "1e-3",
        "name": "milli"
    }
}

This tells us that the prefix "m" modifies a value by a multiple of 1e-3 and it's full name is "milli".

Units are defined as in the following example:

{
    "gf": {
        "name": "Gram Force",
        "description": "Defined as the amount of force exerted by standard gravity on a 1 gram mass",
        "category": "force",
        "scale": "9.80665e-3",
        "dimensions": {"mass": 1, "length": 1, "time": -2},
        "aliases": ["pond"]
    },
}

This tells us that the "gf" symbol is defined a Gram-Force, it has dimensionality (mass * length / time^2), and has a scale of 9.80665e-3 relative to the SI standard measure of corce (the Newton). Common alternative symbols are in the aliases array. Note that scale values are implemented as strings rather than floating point literals because some units can be precisely defined with a mathematical expression. For example, the US Survey Foot is defined as 1200/3937 meters and a Revolution is defined as 2*pi radians, both of which cannot be represented exactly in floating point.

unitdb's People

Contributors

ghostwrench avatar

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.