Kox - A simple code management tool for version control
Project description
Kox
A simple and intuitive code management tool for version control, similar to Git but designed for easier use.
Installation
Install Kox using pip:
pip install kox
Quick Start
1. Configure Kox
First, configure your server connection:
# Set server host
kox set-host localhost
# Set username
kox set-username your_username
# Set password
kox set-password your_password
# Set port (optional, default is 8000)
kox set-port 8000
2. View Configuration
Check your current configuration:
kox show-config
3. Use Kox
Command Line Interface
# List all projects
kox show-projects
# View project version history
kox show-version -p my_project
# Download latest version
kox clone -p my_project
# Download specific version
kox clone -p my_project -v 1.23
# Upload project (auto-increment version)
kox upload -p my_project
# Upload with specific version
kox upload -p my_project -v 1.24
Python API
from kox import Kox
# Initialize with configuration from file
kox = Kox()
# Show all projects
kox.show_projects()
# Show version history
kox.show_histories(project='my_project')
# Download project
kox.clone(project='my_project', version='1.23', path='./downloads')
# Upload project
kox.upload(project='my_project', path='./my_code')
Features
- Simple Version Control: Manage code versions with automatic version increment
- Easy Configuration: Store connection settings in configuration file
- Multiple Interfaces: Use via command line or Python API
- Progress Tracking: Visual progress bars for upload/download operations
- Version History: View complete version history for any project
Configuration
Kox stores configuration in ~/.kox/config.json. You can manage it using:
# Set configuration
kox set-host <host>
kox set-port <port>
kox set-username <username>
kox set-password <password>
# View configuration
kox show-config
# Delete configuration
kox del-username
kox del-password
Command Line Usage
Configuration Commands
kox set-host <host> # Set server host
kox set-port <port> # Set server port
kox set-username <username> # Set username
kox set-password <password> # Set password
kox show-config # Show current configuration
kox del-username # Delete username from config
kox del-password # Delete password from config
Project Commands
kox show-projects # List all projects
kox show-version -p <project> # Show project version history
kox clone -p <project> # Download latest version
kox clone -p <project> -v <version> -l <path> # Download specific version
kox upload -p <project> # Upload with auto-increment
kox upload -p <project> -v <version> -l <path> # Upload with specific version
Global Options
All project commands support these options to override configuration:
--host, -h Server address
--username, -u Username
--password, -P Password
Example:
kox clone -p my_project --host example.com --username admin --password secret
Python API
Initialization
from kox import Kox
# Use configuration from file
kox = Kox()
# Override specific parameters
kox = Kox(host='custom.example.com')
kox = Kox(host='example.com', port=9000)
# Use all custom parameters
kox = Kox(host='example.com', user='admin', password='secret', port=8080)
Methods
show_projects()
Display all projects with their latest versions.
kox.show_projects()
show_histories(project: str)
Display version history for a specific project.
kox.show_histories(project='my_project')
clone(project: str, version: Optional[str] = None, path: str = './')
Download a project.
project: Project name (required)version: Version number (optional, default: latest version)path: Download path (optional, default: current directory)
# Download latest version
kox.clone(project='my_project')
# Download specific version
kox.clone(project='my_project', version='1.23')
# Download to specific path
kox.clone(project='my_project', version='1.23', path='./downloads')
upload(project: str, version: Optional[str] = None, path: str = './')
Upload a project.
project: Project name (required)version: Version number (optional, default: auto-increment)path: Upload path (optional, default: current directory)
# Upload with auto-increment version
kox.upload(project='my_project', path='./my_code')
# Upload with specific version
kox.upload(project='my_project', version='1.24', path='./my_code')
Examples
See the examples/ directory for complete usage examples:
basic_usage.py- Basic operationsdownload_project.py- Download examplesupload_project.py- Upload examplescustom_configuration.py- Configuration examplescomplete_workflow.py- Complete workflow example
Version Management
Version Format
- Versions use decimal format with up to 2 decimal places
- Examples:
1.0,1.23,10.99 - Invalid:
1.234(three decimal places)
Auto-increment
When uploading without specifying a version, Kox automatically increments the version by 0.01:
- Current version:
1.22→ Next upload:1.23 - Current version:
1.0→ Next upload:1.01
Version Validation
- New version must be greater than the current latest version
- If current latest is
1.22, new version must be at least1.23
Requirements
- Python 3.7+
- requests >= 2.31.0
- tqdm >= 4.66.0
- click >= 8.0.0
License
MIT License
Support
For issues, questions, or contributions, please visit the GitHub repository.
Project details
Release history Release notifications | RSS feed
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 kox-1.0.0.tar.gz.
File metadata
- Download URL: kox-1.0.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e68a74d9f830acbba36fcc3622386805d4ffabf416fee56eae60e85c6555bde4
|
|
| MD5 |
277afc69e06cfeca611c682c12a8c421
|
|
| BLAKE2b-256 |
cec302d4b46e250bea3e3abe26d144b7ad55bc59bb50a6928a2fb282cbf74c8c
|
File details
Details for the file kox-1.0.0-py3-none-any.whl.
File metadata
- Download URL: kox-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61ff383ac3e0ddf4e99a684475c3ae3ee465bedc76683715831561ae4177d875
|
|
| MD5 |
153fbae4fe082733c058fb75b284239c
|
|
| BLAKE2b-256 |
474d91085ee28ecf246505de08ae6219354578cef666afc996b6377686f177be
|