• Stars
    star
    139
  • Rank 262,954 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 2 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A utility to fetch and download python packages

unearth

Tests pypi version Code style: black pdm-managed

A utility to fetch and download python packages

NOTICE This project is still in its early stage and the API may change before 1.0 release.

Why this project?

This project exists as the last piece to complete the puzzle of a package manager. The other pieces are:

  • resolvelib - Resolves concrete dependencies from a set of (abstract) requirements.
  • unearth (This project) - Finds and downloads the best match(es) for a given requirement.
  • build - Builds wheels from the source code.
  • installer - Installs packages from wheels.

They provide all the low-level functionalities that are needed to resolve and install packages.

Why not pip?

The core functionality is basically extracted from pip. However, pip is not designed to be used as a library and hence the API is not very stable. Unearth serves as a stable replacement for pip's PackageFinder API. It will follow the conventions of Semantic Versioning so that downstream projects can use it to develop their own package finding and downloading.

Requirements

unearth requires Python >=3.8

Installation

$ python -m pip install --upgrade unearth

Quickstart

Get the best matching candidate for a requirement:

>>> from unearth import PackageFinder
>>> finder = PackageFinder(index_urls=["https://pypi.org/simple/"])
>>> result = finder.find_best_match("flask>=2")
>>> result.best
Package(name='flask', version='2.1.2')

Using the CLI:

$ unearth "flask>=2"
{
  "name": "flask",
  "version": "3.0.0",
  "link": {
    "url": "https://files.pythonhosted.org/packages/36/42/015c23096649b908c809c69388a805a571a3bea44362fe87e33fc3afa01f/flask-3.0.0-py3-none-any.whl",
    "comes_from": "https://pypi.org/simple/flask/",
    "yank_reason": null,
    "requires_python": ">=3.8",
    "metadata": "https://files.pythonhosted.org/packages/36/42/015c23096649b908c809c69388a805a571a3bea44362fe87e33fc3afa01f/flask-3.0.0-py3-none-any.whl.metadata"
  }
}

Documentation

Read the docs

More Repositories

1

legit

Git for Humans, Inspired by GitHub for Mac™.
Python
5,702
star
2

marko

A markdown parser with high extensibility.
Python
342
star
3

tetos

A unified interface for multiple Text-to-Speech (TTS) providers.
Python
221
star
4

python-cfonts

Sexy fonts for the console
Python
192
star
5

Flog

A Simple Blog Powered by Flask
Vue
191
star
6

flask-crontab

Simple Flask scheduled tasks without extra daemons
Python
100
star
7

monas

Python monorepo made easy
Python
77
star
8

wordle-tui

Play WORDLE game in your terminal.
Python
61
star
9

pipfile-requirements

A CLI tool to covert Pipfile/Pipfile.lock to requirments.txt
Python
50
star
10

flask-vue-todo

A todo app with Vue and backed by Flask
Python
48
star
11

pdm-packer

A PDM plugin that packs your packages into a zipapp
Python
46
star
12

onepm

Picks the right package manager for you
Python
44
star
13

picguessr

Python
41
star
14

findpython

A utility to find python versions on your system
Python
36
star
15

fix-future-annotations

A CLI and pre-commit hook to fix future annotations
Python
35
star
16

oven

TypeScript
27
star
17

resume

Personal resume with a handwritten SSG
Python
24
star
18

pdm-vscode

DEPRECATED: A PDM plugin that autogenerates workspace vscode settings for you
Python
23
star
19

pycomplete

A Python library to generate static completion scripts for your CLI app
Python
22
star
20

frostming

My profile, including a chess game
Python
17
star
21

enum-adt

Python
13
star
22

renren-dumps

人人网数据备份器
Python
12
star
23

atoml

Yet another style-preserving TOML library for Python
Python
12
star
24

modul

Python modules with public exports
Python
12
star
25

lektor-tailwind

A Lektor plugin that adds Tailwind CSS to your project seamlessly
Python
11
star
26

flask-webconsole-example

A simple example of web console
HTML
10
star
27

rediswrapper

Pythonic wrapper for Redis Client.
Python
10
star
28

pbs-installer

Python
9
star
29

tokei-pie-cooker

Visualize your code statistics with Pie Chart
Python
8
star
30

scoop-frostming

My personal scoop bucket
PowerShell
7
star
31

pofmt

Your missing PO formatter and linter
Python
7
star
32

myrc

My personal profiles for Win and Mac
Shell
5
star
33

monas-example-repo

Serve as an example of how Monas manage a monorepo
Python
4
star
34

pep665_poc

A POC implementation of PEP 665
Python
4
star
35

pdm-mypyc

A build hook to compile source files with mypyc
Python
4
star
36

hexo-theme-landing-page

Hexo ported theme of Landing Page
CSS
3
star
37

package-manager-demo

Write a package manage from scratch demo repo
Python
3
star
38

transpyler-gpt

A GPT-powered Python transpiler that makes your Python code run on older versions
Python
3
star
39

flask-remote-file

Flask extension to serve remote files via sftp
Python
2
star
40

frostming.github.io

My personal wiki site
Vue
2
star
41

sodoku-solver

Python
2
star
42

wordle-tg

A Telegram Bot that lets you play wordle with other people
Python
2
star
43

daily-trending

Daily trending digest based on people you follow
Python
2
star
44

gorella

Monkey patch regular expression methods to built-in string types
Python
1
star
45

RimeConfig

My Rime Configuration
1
star
46

highlight-lexer-comparison

Lexer comparison of code highlighters
HTML
1
star
47

vscode-mingshe

VSCode language support for MingShe
1
star
48

Codingame

My solutions of https://www.codingame.com
Python
1
star
49

scoop-action

GitHub Action for Scoop buckets
JavaScript
1
star
50

tokei

PyPI package for https://github.com/XAMPPRocky/tokei
Python
1
star
51

pdm-lock-build-deps

Python
1
star
52

pycon-python-pm

PyCon 2019深圳站演讲Slide: Python包管理及Pipenv
CSS
1
star
53

backports.html

Backport of Python 3.4+'s html module
Python
1
star
54

blog_backup

个人博客MD备份
Shell
1
star