Metadata-Version: 2.4
Name: uvify
Version: 0.1.3
Summary: Get one-liner commands for faster python environment uv python manager.
Author-email: Avi Lumelsky <avilum+gh@protonmail.com>
License: MIT License
        
        Copyright (c) 2025 Avi Lumelsky.
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: homepage, https://github.com/avilum/uvify
Keywords: uv,python,environment,uvify,virtualenv,pip,poetry,venv
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: gitingest>=0.1.5
Requires-Dist: toml>=0.10.2
Requires-Dist: typer>=0.12.3
Requires-Dist: rich>=13.7.1
Provides-Extra: api
Requires-Dist: fastapi>=0.111.0; extra == "api"
Requires-Dist: uvicorn>=0.29.0; extra == "api"
Dynamic: license-file

# Uvify
Turn python repositories to `uv` environments and oneliners, without diving into the code.<br>
- Generates oneliners for quick python environment setup
- Helps with migration to `uv` for faster builds in CI/CD
- It works on existing projects based on: `requirements.txt`, `pyproject.toml` or `setup.py`, recursively.
  - Supports local directories.
  - Supports GitHub links using <a href="https://gitingest.com/">Git Ingest</a>.
- It's fast!
 
> 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
You can run uvify with uv. <br>
Let's generate oneliners for a virtual environment that has `requests` installed, using PyPi or from source:
```shell
# Run on a local directory
uv run --with uvify uvify . | jq

# Run on requests
uv run --with uvify uvify https://github.com/psf/requests | jq
# or:
# uv run --with uvify uvify psf/requests | jq

[
  ...
  {
    "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)'",
    "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
  }
]
```

### 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].dependencies'
```

### 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"
]
```

## Uvify HTTP Server: Using uvify with client/server architecture instead of SDK

First, install uvify with the optional API dependencies:
```shell
uv add uvify[api]
# or with pip:
# pip install uvify[api]
```

Then run the server:
```shell
# Run the server using the built-in serve command
uvify serve --host 0.0.0.0 --port 8000

# Or using uvicorn directly
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
```


## Developing
```shell
# Install dependencies (including optional API dependencies)
uv venv
uv sync --dev --extra api
uv run pytest

# Run linter before PR 
./lint.sh

# Install editable version locally
uv run pip install --editable .
uv run python -m src.uvify --help
uv run python -m src.uvify psf/requests

# Run the HTTP API with reload
uv run uvicorn src.uvify:api --host 0.0.0.0 --port 8000 --reload 
# Or use the built-in serve command:
# uv run python -m src.uvify serve --host 0.0.0.0 --port 8000

curl http://0.0.0.0:8000/psf/requests | jq
```

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