"""
DARKOP - Advanced Python Code Encryption System
Encrypt your Python code into a custom language
"""

from .darkop import encrypt, run, create

__version__ = "1.0.0"
__author__ = "DARKOP Team"

def encrypt_file(input_file, output_file):
    """Encrypt Python file using DARKOP"""
    return create(input_file, output_file)

def load_and_run(encrypted_file):
    """Load and run encrypted DARKOP file"""
    with open(encrypted_file, 'r', encoding='utf-8') as f:
        lines = f.readlines()
        for line in lines:
            if line.strip().startswith('darkop_code ='):
                import ast
                code = ast.literal_eval(line.split('=', 1)[1].strip())
                run(code)
                return
    raise ValueError("No DARKOP code found in file")

__all__ = ['encrypt', 'run', 'create', 'encrypt_file', 'load_and_run']