Skip to main content

Create offline-ready Python environments for your projects

Project description

auto-python-toolkit

Build Status

Create an out-of-the-box Python environment that supports offline development for your project, enhancing efficiency and simplifying your workflow.

auto-python-toolkit is a ready-to-use Python environment tailored for beginner developers. Whether working within an intranet or other offline settings, this toolkit simplifies the challenges of managing Python dependencies, environments, and versions. Key Features:

  • Offline-Friendly: Fully supports creating and managing Python environments in offline scenarios.
  • Automation: No need for in-depth knowledge of Python dependency or environment management—the toolkit handles the hassle for you.
  • Ready-to-Use: Quick setup and no complex configurations, enabling you to start coding instantly.

Quick Start

Download

Download the latest release from GitHub Releases.

Usage

  1. Unzip the toolkit to your project directory
  2. Run the tool:
    python main.py
    
  3. Follow the prompts to select your target OS and Python version

Installation

Prerequisites

  1. Install uv by following the instructions at https://github.com/astral-sh/uv
  2. Make sure Python is installed on your system (for running this tool)

Steps to create an offline environment

  1. Clone this repository or download it to your project directory
  2. Run the tool from your project root directory:
    python main.py
    
  3. Select the target Windows version from the menu (supports Windows 7/10/11 and Windows Server 2016/2019/2022)
  4. Select the Python version you want to use (all options are 3.7.9 or higher, as required by uv)
  5. The tool will:
    • Download the selected Python version using uv
    • Analyze your project files to determine dependencies
    • Install dependencies using uv
    • Package everything together for offline use
  6. The packaged project will be available in the output directory

Command Line Options

python main.py --version          # Show version information
python main.py --auto             # Automatically use default Python version without prompting
python main.py --lang en          # Use English interface
python main.py --lang zh_CN       # Use Chinese interface

Script Dependency Format

You can specify dependencies directly in your main script using this format:

# /// script
# dependencies = [
#   "requests<3",
#   "rich",
#   "pandas",
#   "tqdm",
# ]
# ///

This will override any automatically detected dependencies.

Supported Versions

Windows Versions

  • Windows 7 (64-bit)
  • Windows 10 (32-bit and 64-bit)
  • Windows 11 (64-bit)
  • Windows Server 2016 (64-bit)
  • Windows Server 2019 (64-bit)
  • Windows Server 2022 (64-bit)

Python Versions

This tool uses uv which supports Python 3.7 and above. Available versions:

  • 3.7.9
  • 3.8.20
  • 3.9.21
  • 3.10.16
  • 3.11.11
  • 3.12.9
  • 3.13.2
  • 3.14.0a6 (preview)

How It Works

  1. OS Selection: Choose the target Windows version for your offline environment
  2. Python Version Selection: Choose the specific Python version you want to use
  3. Dependency Analysis: The tool scans your Python files to detect imports and identifies the required packages
  4. Environment Creation: Using uv, it creates a virtual environment with your selected Python version
  5. Package Installation: Installs all detected dependencies into the virtual environment
  6. Project Packaging: Packages the project with its environment for offline use

Offline Usage

Once you've created the package:

  1. Transfer the ZIP file to your offline environment
  2. Extract the package
  3. Run the run_project.bat file to activate the Python environment
  4. You now have a fully functional Python environment with all dependencies ready to use!

Internationalization Support

The tool supports both English and Chinese interfaces:

  • Automatically detects your system language
  • Can be manually specified with the --lang parameter
  • Full i18n support for all menus and messages

Contributing

Contributions are welcome! See RELEASE.md for information about the release process.

To contribute:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Use Cases

  • Intranet development
  • Offline project deployment
  • Python beginner learning
  • Corporate environments with restricted internet access

Chinese Description

auto-python-toolkit 是一个专为初阶开发者设计的开箱即用 Python 环境解决方案。无论您是在内网还是其他离线环境中工作,这个工具可以帮助您轻松应对 Python 依赖、环境以及版本管理的难题。

核心特点:

  • 离线开发友好:完全支持在离线环境中创建和管理 Python 环境。
  • 自动化处理:无需对 Python 依赖和环境配置深入了解,工具会为您处理繁琐步骤。
  • 开箱即用:快速启动,无需复杂设置,即可开始开发。

支持的版本

Windows版本

  • Windows 7 (64位)
  • Windows 10 (32位和64位)
  • Windows 11 (64位)
  • Windows Server 2016 (64位)
  • Windows Server 2019 (64位)
  • Windows Server 2022 (64位)

Python版本

本工具使用uv,仅支持Python 3.7及以上版本。可用版本包括:

  • 3.7.9
  • 3.8.20
  • 3.9.21
  • 3.10.16
  • 3.11.11
  • 3.12.9
  • 3.13.2
  • 3.14.0a6 (预览版)

新增功能

  • Python版本选择:可以选择特定的Python版本,而不仅限于系统的默认版本
  • 多语言支持:支持中英文界面,可根据系统语言自动切换或手动指定
  • 脚本依赖声明:可以直接在脚本中声明项目依赖,无需手动管理requirements.txt

命令行选项

python main.py --version          # 显示版本信息
python main.py --auto             # 自动使用默认Python版本,不显示选择菜单
python main.py --lang en          # 使用英文界面
python main.py --lang zh_CN       # 使用中文界面

使用方法

  1. 在有网络的环境中运行此工具
  2. 选择目标Windows版本和Python版本
  3. 工具会自动下载Python、分析依赖并打包
  4. 将生成的zip包复制到离线环境
  5. 解压后运行run_project.bat即可激活Python环境

适用场景:内网开发、离线环境项目部署、Python 初阶入门学习。

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

auto_python_toolkit-0.1.0.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auto_python_toolkit-0.1.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file auto_python_toolkit-0.1.0.tar.gz.

File metadata

  • Download URL: auto_python_toolkit-0.1.0.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for auto_python_toolkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6cdbe3a46ab93059e6b6dd440e3d35ff9510f667b169b522507b3ce2b628e3f4
MD5 300eccf007e440919666f7c0c336fa1a
BLAKE2b-256 dd55dc9009b3f67a75bd1974a75528b0cdf51eee4283ee060314827568078771

See more details on using hashes here.

File details

Details for the file auto_python_toolkit-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for auto_python_toolkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fafbab6f3593aa390eb80ffe5f7150430293619ea82b2fcba65254ad2c8ae63
MD5 abb60eb43f39ec4b53b4469df9cfec76
BLAKE2b-256 adb78c3289c2613c35c595435c57642da42c02329417a4da5d679ca02a41fcde

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page