Byper is a Python environment and workflow manager.
Project description
Byper
Byper is a Python environment and workflow manager. Each project uses its
own local environment ( packages/ ), a declarative manifest ( requirements.yaml ),
and a reproducible lockfile ( byper.lock ). You don't need to activate or
deactivate environments: every byper command automatically uses your project's
Python and dependencies.
- Local environment with
venv(packages/) - Dependencies declared in
requirements.yaml - Lockfile with hashes and PyPI metadata
- Built-in Python version management
- Scripts, tasks, and environment variables in a single file
- Global shims in
~/.byper/bin/
Installation
Install Byper like any other Python package:
pip install byper
Or from source:
git clone https://github.com/brayhandeaza/byper.git
cd byper/apps/python/byper
pip install -e .
Getting Started
1. Create a project
byper init my-project
To skip the interactive wizard and use defaults:
byper init my-project -y
This creates the following structure:
my-project/
├── requirements.yaml
├── main.py
└── packages/ # created after running byper install
2. Install dependencies
Edit requirements.yaml :
name: my-project
version: 0.0.1
description: My first Byper project
python: "3.12"
dependencies:
requests: "2.32.5"
fastapi: "0.116.1"
Then install:
byper install
Byper will:
- Find a compatible Python interpreter (download it if necessary).
- Create the local environment
packages/. - Install dependencies from PyPI.
- Generate
byper.lockwith exact versions, URLs, and hashes.
3. Run code with the project environment
byper main.py
No need for source packages/bin/activate ; byper runs main.py with the
Python from packages/ .
4. Add more dependencies
byper install pydantic
With an exact version:
byper install "pydantic==2.9.0"
Upgrade a package:
byper install requests --upgrade
Remove:
byper remove requests
Python version management
You can pin the Python version in requirements.yaml :
python: "3.12" # any 3.12.x
python: "3.12.4" # exact
python: ">=3.12,<3.13" # range
python: "^3.12" # compatible release
If you don't have the required version, byper can download it automatically
from python-build-standalone :
byper python install 3.12.8
List installed runtimes:
byper python list
Set a version for the project:
byper python use 3.12
This writes python: "3.12" to requirements.yaml .
Global shims
Every time you install a runtime, byper creates shims in ~/.byper/bin/ :
~/.byper/bin/python
~/.byper/bin/python3
~/.byper/bin/python3.12
~/.byper/bin/python3.12.8
~/.byper/bin/pip
~/.byper/bin/pip3
~/.byper/bin/pip3.12
Add ~/.byper/bin to your PATH to use these commands from anywhere.
On Unix:
export PATH="$HOME/.byper/bin:$PATH"
On Windows (CMD):
setx PATH "%PATH%;%USERPROFILE%\.byper\bin"
Scripts and tasks
Define scripts in requirements.yaml :
scripts:
start: python main.py
test: python -m pytest
lint: python -m ruff check .
Run them:
byper run start
byper run test
Tasks allow more elaborate step sequences:
tasks:
deploy:
- byper run test
- { call: src.deploy.run, kwargs: { env: prod } }
- { file: scripts/finalize.py }
Run:
byper task deploy
Environment variables
Declare variables inline or load them from a .env file:
env:
from_file: .env
DEBUG: "true"
API_URL: https://api.example.com
Access them from Python:
from byper.env import DEBUG, API_URL
They are also injected automatically into os.environ .
Regenerate stubs so your editor recognizes them:
byper refresh
Lockfile
requirements.yaml expresses the project's intent. byper.lock stores the
exact resolution:
lock_version: 1
python:
required: ">=3.12,<3.13"
resolved: "3.12.8"
implementation: "CPython"
packages:
"requests@2.32.5":
name: "requests"
version: "2.32.5"
source: "pypi"
resolved: "https://files.pythonhosted.org/..."
integrity: "sha256:..."
direct: true
group: "main"
dependencies:
charset-normalizer: ">=2.0.0,<4.0.0"
When byper.lock is in sync with requirements.yaml , byper install uses the
lockfile for a faster, reproducible install.
Main commands
| Command | Description |
|---|---|
byper install [--offline] |
Install/update dependencies from requirements.yaml |
byper install [packages] [--upgrade] [--offline] [--no-cache] |
Install dependencies or specific packages |
byper remove <pkg> |
Remove a package |
byper run <script> |
Run a manifest script |
byper task <name> |
Run a manifest task |
byper <file.py> |
Run a Python file with the local environment |
byper list [--outdated | --freeze | --cache] |
List installed packages |
byper tree |
Show directory tree (hiding packages/ ) |
byper reset [-y] |
Rebuild packages/ from scratch |
byper doctor [--fix] |
Diagnose and repair the environment |
byper build |
Build the package with python -m build |
byper publish |
Upload the package to PyPI |
byper login / byper logout |
Manage PyPI credentials |
byper cache <list|clear|dir> |
Manage pip cache |
byper wheel <pkg> |
Build a wheel for a package |
byper python install <version> |
Download and install a Python runtime |
byper python list |
List installed runtimes |
byper python use <version> |
Pin the project's Python version |
byper refresh |
Regenerate .pyi stubs for tasks and env |
Typical workflow
# 1. Create project
byper init my-api -y
# 2. Enter directory
cd my-api
# 3. Pick Python
byper python use 3.12
# 4. Add dependencies
byper install fastapi
byper install "uvicorn[standard]"
# 5. Write code in main.py
# ...
# 6. Run
byper run start
# or directly
byper main.py
# 7. Diagnose environment issues
byper doctor
# 8. Publish (optional)
byper build
byper publish
Project structure
my-project/
├── requirements.yaml # project manifest
├── byper.lock # exact dependency resolution
├── packages/ # local environment (venv)
├── main.py # entry point (optional)
├── src/ # source code
└── tests/ # tests
- Do not commit
packages/to git. - Commit
requirements.yamlandbyper.lockfor reproducibility.
Additional documentation
docs/manifest.md— fullrequirements.yamlformatdocs/commands.md— complete command referencedocs/tasks-and-env.md— tasks and environment variablesdocs/publishing.md— build and publish to PyPIdocs/development.md— internal architecture for contributorsdocs/ESTADO.md— current status and roadmap
Contributing
Contributions are welcome. See docs/development.md to understand the codebase
and how to run the tests.
cd apps/python/byper
python -m pytest
Performance tests ( pytest -m performance ) require network access and are not
run by default.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file byper-1.0.4.tar.gz.
File metadata
- Download URL: byper-1.0.4.tar.gz
- Upload date:
- Size: 50.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c7111c46254154917648e18be9b1846d5bcdd78c69303f7fcb2291033b016c1
|
|
| MD5 |
54ce3ef8d7639dda8759cb96f8c5ddbe
|
|
| BLAKE2b-256 |
14371fb45441f7f66ccb0045b61ad1bee33adca2b84a447c450ae399daaafc8f
|
File details
Details for the file byper-1.0.4-py3-none-any.whl.
File metadata
- Download URL: byper-1.0.4-py3-none-any.whl
- Upload date:
- Size: 48.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c89718ca96828215d866bc47956f2727b0b43c6ddf1f051628c1ee1e5b5de08e
|
|
| MD5 |
62abc8de83a383626be9e1874dfb4387
|
|
| BLAKE2b-256 |
3fdc696428cac9f2397c38a703a5e35f6568d5b75d77639725d1c7c282e97576
|