python-obfuscator 1.0.0

Python Obfuscator Web API interface can help you obfuscate and protect Python .py source code against analysis, reverse engineering and technology theft. Python Obfuscator provides advanced Python source code parsing based on AST trees, multiple advanced obfuscation, virtualization and protection strategies are available.
Documentation
/******************************************************************************
 * Python Obfuscator WebApi interface usage example.
 *
 * In this example we will verify our activation key status.
 *
 * Version        : v1.0.0
 * Language       : Rust
 * Author         : Bartosz Wójcik
 * Web page       : https://www.pelock.com
 *
 *****************************************************************************/

use python_obfuscator::{PythonObfuscator, PythonObfuscatorResponse};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    //
    // include Python Obfuscator class
    //

    //
    // if you don't want to use crates.io use a path dependency to this crate
    //
    // [dependencies]
    // python-obfuscator = { path = ".." }

    //
    // create Python Obfuscator class instance (we are using our activation key)
    //
    let my_python_obfuscator =
        PythonObfuscator::new(Some("ABCD-ABCD-ABCD-ABCD".to_string()));

    //
    // login to the service
    //
    let result = my_python_obfuscator.login(true).await;

    //
    // result object holds the information about the license
    //
    // result.demo          - demo mode (empty/invalid key); strategy flags ignored; always integers_to_arrays, mba_binops, encrypt_strings (no virt; 1000 char limit)
    // result.license_expiration - license end date (Y-m-d), empty if none
    // result.usages_total  - total obfuscations for this activation code
    // result.string_limit  - max. source code size allowed (it's 1000 bytes for demo mode)
    //
    match result {
        Some(PythonObfuscatorResponse::Object(obj)) => {
            println!(
                "Demo version status - {}",
                if obj.demo.unwrap_or(false) {
                    "true"
                } else {
                    "false"
                }
            );
            println!(
                "License expiration - {:?}",
                obj.license_expiration
            );
            println!(
                "Total obfuscations - {}",
                obj.usages_total.unwrap_or(0)
            );
            println!(
                "Max. source code size - {}",
                obj.string_limit.unwrap_or(0)
            );
        }
        Some(PythonObfuscatorResponse::Json(_)) => {}
        None => {
            return Err("Something unexpected happen while trying to login to the service.".into());
        }
    }

    Ok(())
}