Metadata-Version: 2.4
Name: uvify
Version: 0.1.1
Summary: Get one-liner commands for faster python environment uv python manager.
Author-email: Avi Lumelsky <avilum+gh@protonmail.com>
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: gitingest>=0.1.5
Requires-Dist: toml>=0.10.2
Requires-Dist: typer[all]>=0.12.3
Requires-Dist: rich>=13.7.1
Requires-Dist: fastapi>=0.111.0
Requires-Dist: uvicorn>=0.29.0

# Uvify
Faster python environments. Turn any GitHub repository or local directory to a `uv` command.<br>
- `uvify` uses <a href="https://gitingest.com/">GitIngest</a> and <a href="https://github.com/astral-sh/uv">uv</a> python manager.
- It creates python environments faster, and to build dockerfiles faster.

> uv is by far the fastest python and package manager. 
<img src="assets/image.png">

<i>Source: https://github.com/astral-sh/uv</i>

## Command Line: Using uvify CLI locally
Dog Fooding - uvify on uvify: 
```shell
uv run --with uvify uvify https://github.com/psf/requests | jq

[
  {
    "file": "pyproject.toml",
    "fileType": "pyproject.toml",
    "oneLiner": "uv run --python '3.10' python",
    "uvInstallFromSource": "uv run --with 'git+https://github.com/psf/requests' --python '3.10' python",
    "dependencies": [],
    "packageName": null,
    "pythonVersion": "3.10",
    "isLocal": false
  },
  {
    "file": "setup.py",
    "fileType": "setup.py",
    "oneLiner": "uv run --python '>=3.8.10' --with 'certifi>=2017.4.17,charset_normalizer>=2,<4,idna>=2.5,<4,urllib3>=1.21.1,<3,requests' python -c 'import requests; print(requests.__version__)'",
    "uvInstallFromSource": "uv run --with 'git+https://github.com/psf/requests' --python '>=3.8.10' python",
    "dependencies": [
      "certifi>=2017.4.17",
      "charset_normalizer>=2,<4",
      "idna>=2.5,<4",
      "urllib3>=1.21.1,<3"
    ],
    "packageName": "requests",
    "pythonVersion": ">=3.8",
    "isLocal": false
  }
]
```

## Query specific fields:
### Parse all python artifacts in repository:
```
uvify psf/requests
uvify https://github.com/psf/requests
```

### Parse specific fields in the response
```
uvify psf/black | jq '.[] | {file: .file, pythonVersion: .pythonVersion, dependencies: .dependencies, packageName: .packageName}'
```

### Use existing python repos with 'uv':
```
uvify psf/requests | jq '.[0].oneLiner'
"uv run --with 'git+https://github.com/psf/requests' --python '3.11' python"
```
### Install a repository with 'uv' from github sources:
```
uvify psf/requests | jq '.[0].uvInstallFromSource'
```

### List the dependencies.
```
uvify psf/requests | jq '.[].dependencies'
[
  "certifi>=2017.4.17",
  "charset_normalizer>=2,<4",
  "idna>=2.5,<4",
  "urllib3>=1.21.1,<3"
]
```


## HTTP API: Using uvify with client/server architecture instead of CLI
```shell
# Run the server
uv run uvicorn src.uvify:api --host 0.0.0.0 --port 8000

# Using curl
curl http://0.0.0.0:8000/psf/requests | jq

# Using wget
wget -O-  http://0.0.0.0:8000/psf/requests | jq .oneLiner
```


## Developing
```shell
# Install dependencies
uv venv
uv sync --dev
uv run pytest

# Install editable version locally
uv run pip install --editable .
uv run uvify psf/requests

# Run the HTTP API with reload
uv run uvicorn src.uvify:api --host 0.0.0.0 --port 8000 --reload 
curl http://0.0.0.0:8000/psf/requests | jq
```

# Thanks 
Thanks to the UV team and Astral for this amazing tool.
