Skip to main content

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

  1. Generate a GitHub Personal Access Token with repo access
  2. Set environment variables:
    DASTAANS_LIB_REPO=https://github.com/yourusername/repo.git
    DASTAANS_LIB_GIT_TOKEN=ghp_your_token
    

SSH with Private Key

  1. Add your SSH public key to GitHub
  2. Set environment variables:
    DASTAANS_LIB_REPO=git@github.com:yourusername/repo.git
    DASTAANS_LIB_SSH_KEY=/path/to/private/key
    

How It Works

  1. Reads configuration from environment variables
  2. Clones the private repository to a temporary directory
  3. Installs the package using pip
  4. Automatically cleans up the temporary directory
  5. Library remains installed in your virtual environment

License

MIT License

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

dastaans_lib_manager-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

dastaans_lib_manager-0.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

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

Hashes for dastaans_lib_manager-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5846e05bc03b6a363bdaa241539c70ac3589f5eddb7288d596c9d8a86610cbed
MD5 04ca7f762176f997671b567bb9540ffb
BLAKE2b-256 b89333b2bca5efdd91aa41c311ddc0f1627d714df95ca65e7a4abf8fa7d22726

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dastaans_lib_manager-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f2fd192f0c5a55d531108cd6b80a70086b128b1da6bb08e4640605654e16386
MD5 8e1793a09eafedbc046e4db9ae5b19b4
BLAKE2b-256 a3dee5cba44312f18329fd4556c76d3d16ffefcc92a7fcd024e86328cfb53b5d

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