Skip to main content

Double check sdist/bdist on pypi

Project description

Honesty

There's a long tail of people doing interesting/sketchy things to packages on pypi. Most aren't malicious, but this project gives you an easy way to check for some of the obvious ways that packages might be tampered with.

Usage

honesty list <package name>
honesty check <package name>[==version|==*] [--verbose]
honesty download <package name>[==version|==*] [--dest=some-path/]
honesty extract <package name>[==version|==*] [--dest=some-path/]
honesty license <package name>[==version|==*]

(provisional)
honesty ispep517 <package name>[==version|==*]
honesty native <package name>[==version|==*]
honesty age <package name>[==version|==*]
honesty deps [--flat|--pick] <package name>[==version|==*]

It will store a package cache, using the normal appdirs package to pick a location (on Linux, this defaults to ~/.cache/honesty/pypi but, you can override with XDG_CACHE_HOME or HONESTY_CACHE environment variables).

If you have a local bandersnatch, specify HONESTY_INDEX_URL to your /simple/ url. It also must support /pypi/<package>/json or pass --nouse-json to the commands that support it.

Exit Status of 'check'

These are bit flags to make sense when there are multiple problems. If you pass * for version, they are or'd together.

0   if only sdist or everything matches
1   if only bdist
2   (reserved for future "extraction error")
4   some .py from bdist not in sdist
8   some .py files present with same name but different hash in sdist (common
    when using versioneer or 2to3)

API

The user-facing API is intended to be used to analyze metadata and download sdists. It is somewhat provisional, in that the exceptions raised are not well-defined.

from honesty.cache import Cache
from honesty.releases import async_parse_index
from honesty.api import async_download_one
async def foo(pkgname, pkgversion):
  with Cache() as c:
      pkg = await async_parse_index(pkgname, c, use_json=True)
      path = async_download_one(pkg, pkgversion, cache=c)

License

Honesty is copyright Tim Hatch, and licensed under the MIT license. I am providing code in this repository to you under an open source license. This is my personal repository; the license you receive to my code is from me and not from my employer. See the LICENSE file for details.

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

honesty-0.3.0a5.tar.gz (39.1 kB view details)

Uploaded Source

Built Distribution

honesty-0.3.0a5-py3-none-any.whl (41.1 kB view details)

Uploaded Python 3

File details

Details for the file honesty-0.3.0a5.tar.gz.

File metadata

  • Download URL: honesty-0.3.0a5.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for honesty-0.3.0a5.tar.gz
Algorithm Hash digest
SHA256 214590805a8cd70d44bd0088727a834faacd771add0dc77fd8cd4ad49b40f2fd
MD5 0426d029c08ff9fd1a53e769d8890606
BLAKE2b-256 4fe6e000ff4958c72368a61cea1192210e4868a8ae6995bce5380f1c29e7d577

See more details on using hashes here.

File details

Details for the file honesty-0.3.0a5-py3-none-any.whl.

File metadata

  • Download URL: honesty-0.3.0a5-py3-none-any.whl
  • Upload date:
  • Size: 41.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for honesty-0.3.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 aee70f2bcd86453d378d1412e7390208d0cba26b0742644704062386e95a115f
MD5 5f81b9370d1d5c5a0b261c7f79a8a254
BLAKE2b-256 c57adb3c7dca73290ff771246c3ee53aba5d902bc286c66d724d791978d7b376

See more details on using hashes here.

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