A library manager for installing private Python libraries from Git
Project description
Dastaans Library Manager
A Python package for managing private library installations from Git repositories in microservice environments.
Features
- Install private Python libraries from Git repositories (HTTPS with token or SSH with key)
- Automatic cleanup after installation
- Update/reinstall functionality
- Virtual environment detection
- Support for both public and private repositories
Installation
From PyPI (once published)
pip install dastaans-lib-manager
From Git Repository
pip install git+https://github.com/yourusername/dastaans-lib-manager.git
Configuration
The library manager uses environment variables for configuration. Create a .env file:
# Required: Your shared library repository URL
DASTAANS_LIB_REPO=https://github.com/yourusername/dastaans-shared-lib.git
# Option 1: HTTPS with Personal Access Token
DASTAANS_LIB_GIT_TOKEN=ghp_your_token_here
# Option 2: SSH with Private Key
# DASTAANS_LIB_REPO=git@github.com:yourusername/dastaans-shared-lib.git
# DASTAANS_LIB_SSH_KEY=/path/to/your/private/key
Usage
Command Line Interface
# Install the shared library
dastaans-lib install
# Update to latest version
dastaans-lib update
# Check if installed
dastaans-lib check
# Uninstall
dastaans-lib uninstall
# Install from specific branch
dastaans-lib install --branch develop
# Force reinstall
dastaans-lib install --force
Python API
from dastaans_lib_manager import LibraryManager
# Initialize manager
manager = LibraryManager(
repo_url="https://github.com/yourusername/dastaans-shared-lib.git",
branch="main"
)
# Install library
manager.install()
# Update library
manager.update()
# Check if installed
if manager.check_installed():
print("Library is installed")
# Uninstall
manager.uninstall()
Authentication Methods
HTTPS with Personal Access Token
- Generate a GitHub Personal Access Token with
repoaccess - Set environment variables:
DASTAANS_LIB_REPO=https://github.com/yourusername/repo.git DASTAANS_LIB_GIT_TOKEN=ghp_your_token
SSH with Private Key
- Add your SSH public key to GitHub
- Set environment variables:
DASTAANS_LIB_REPO=git@github.com:yourusername/repo.git DASTAANS_LIB_SSH_KEY=/path/to/private/key
How It Works
- Reads configuration from environment variables
- Clones the private repository to a temporary directory
- Installs the package using pip
- Automatically cleans up the temporary directory
- Library remains installed in your virtual environment
License
MIT License
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 dastaans_lib_manager-0.1.0.tar.gz.
File metadata
- Download URL: dastaans_lib_manager-0.1.0.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5846e05bc03b6a363bdaa241539c70ac3589f5eddb7288d596c9d8a86610cbed
|
|
| MD5 |
04ca7f762176f997671b567bb9540ffb
|
|
| BLAKE2b-256 |
b89333b2bca5efdd91aa41c311ddc0f1627d714df95ca65e7a4abf8fa7d22726
|
File details
Details for the file dastaans_lib_manager-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dastaans_lib_manager-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f2fd192f0c5a55d531108cd6b80a70086b128b1da6bb08e4640605654e16386
|
|
| MD5 |
8e1793a09eafedbc046e4db9ae5b19b4
|
|
| BLAKE2b-256 |
a3dee5cba44312f18329fd4556c76d3d16ffefcc92a7fcd024e86328cfb53b5d
|