<commit_before># pymba

pymba is a Python wrapper for the Allied Vision Technologies (AVT) Vimba C API. It wraps the VimbaC.dll file included in the AVT Vimba installation to provide a simple Python interface for AVT cameras. It currently supports most of the functionality provided by VimbaC.dll.

## Installation

Install the Vimba SDK from AVT to the default directory.

Run the AVTDriverInstaller tool and install the AVT Vimba SDK drivers.

Install pymba.

## Usage

### Testing installation 

If Vimba and pymba are installed correctly, then the following code should give the installed Vimba version. No camera is needed.

    from pymba import *
    
    with Vimba() as vimba:
        print vimba.getVersion()
	
### Interacting with cameras

Discover, open, manipulate, and capture frames from a camera.
    
    from pymba import *
    import time
    
    # start Vimba
    with Vimba() as vimba:
        # get system object
        system = vimba.getSystem()
        
        # list available cameras (after enabling discovery for GigE cameras)
        if system.GeVTLIsPresent:
            system.runFeatureCommand("GeVDiscoveryAllOnce")<commit_msg>Added non context manager example<commit_after># pymba

pymba is a Python wrapper for the Allied Vision Technologies (AVT) Vimba C API. It wraps the VimbaC.dll file included in the AVT Vimba installation to provide a simple Python interface for AVT cameras. It currently supports most of the functionality provided by VimbaC.dll.

## Installation

Install the Vimba SDK from AVT to the default directory.

Run the AVTDriverInstaller tool and install the AVT Vimba SDK drivers.

Install pymba.

## Usage

### Testing installation 

If Vimba and pymba are installed correctly, then the following code examples should give the installed Vimba version. No camera is needed.

Checking the version using a context manager:

    from pymba import *
    
    with Vimba() as vimba:
        print vimba.getVersion()
	
Or without using a context manager:

    from pymba import *
    
    vimba = Vimba()
    vimba.startup()
    print vimba.getVersion()
    vimba.shutdown()

### Interacting with cameras

Discover, open, manipulate, and capture frames from a camera.
    
    from pymba import *
    import time
    
    # start Vimba
    with Vimba() as vimba:
        # get system object
        system = vimba.getSystem()
        
        # list available cameras (after enabling discovery for GigE cameras)
        if system.GeVTLIsPresent:
            system.runFeatureCommand("GeVDiscoveryAllOnce")
{'fraction_non_alphanumeric': 0.05123191239734063, 'fraction_numerical': 0.0, 'mean_word_length': 3.1191626409017714, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6656396', 'n_tokens_mistral': 749, 'n_tokens_neox': 710, 'n_words': 312}