Giter Site home page Giter Site logo

typescore's Introduction

typescore

typescore generates typing completeness scores (and more) for a set of packages.

Usage:

  typescore [--packages <packages>] [--scores <scorefile>] [--sep <sep>] [--verbose] [<package>...]
  typescore --help
  typescore --version

Options:
  --packages <packages> File containing the list of packages.
  --scores <scorefile>  The output file (if not stdout).
  --sep <sep>           CSV column separator. [default: ,]
  -v, --verbose         Include package info in the output.
  -h, --help            Show this help.
  -V, --version         Show the version.

typescore uses pyright to score the typing completeness of a set of Python packages. It reads this list from <packages> and writes the results to <scorefile>. If errors prevent it from scoring a package it will set the score to 0%.

The output has the form:

package,typed,module,score,extra_columns

or, if --verbose is specified:

package,version,typed,module,score,stub_package,package_description,extra_columns

typed is a Boolean and tells whether the package had a py.typed file.

Note: we only score top-level modules, not submodules. The assumption is that scores for top-level modules would be reasonably representative of the packages all-up.

<packages> should have one package name per line. It can be a CSV file with the package name as the first column, in which case other columns will be included in the score file output (the extra_columns). A typical extra column might be the package rank on PyPI downloads.

While it would be useful to be able to measure the coverage scores on stub packages too, pyright does not support doing so. As a result, you should evaluate whether a stub package is better than the inline types for a package yourself beffore making use of it.

See latest-scores.md for results in markdown form.

typescore's People

Contributors

gramster avatar

Watchers

 avatar  avatar

typescore's Issues

UnicodeDecodeError when getting the package name from METADATA

  • Package Version: 0.11
  • Operating System: Windows
  • Python Version: 3.10

Getting the following error: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 3281: character maps to undefined

from this line of code:

with open(metadata_file) as f:

when trying to open this file: charset_normalizer-2.1.1.dist-info\METADATA

I think this could be solved by passing encoding="utf-8" into open() for us Windows users. :) Happy to open a PR if it's easier.

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.