semvec/pypi-packages huggingface dataset:
thorcam 0.1.7
Python interface to the .NET Thor cameras.
License: MIT

ThorCam
==========

[![Github Build Status](https://github.com/matham/thorcam/workflows/Python%20application/badge.svg)](https://github.com/matham/thorcam/actions)

A Python interface to the Thor scientific Cameras using `.Net`.

This library does **not** support the **DCx cameras**, only the **scientific cameras**.

See the [docs](https://matham.github.io/thorcam/index.html) for more information
and to get started.

To install in **Anaconda** or **native Python** see the
[installation instructions](https://matham.github.io/thorcam/installation.html).

Basic example
-------------

First create a subclass that prints the camera results:

```python
from thorcam.camera import ThorCam
class MyThorCam(ThorCam):
    def received_camera_response(self, msg, value):
        super(MyThorCam, self).received_camera_response(msg, value)
        if msg == 'image':
            return
        print('Received "{}" with value "{}"'.format(msg, value))
    def got_image(self, image, count, queued_count, t):
        print('Received image "{}" with time "{}" and counts "{}", "{}"'
              .format(image, t, count, queued_count))
```

Then use the camera:

```python
>>> # create camera
>>> cam = MyThorCam()
<__main__.MyThorCam at 0x25a72f6a748>
>>> # start the server etc.
>>> cam.start_cam_process()
>>> # get list of attached cams
>>> cam.refresh_cameras()
Received "serials" with value "['03756']"
>>> # open the camera
>>> cam.open_camera('03756')
Received "settings" with value "{'binning_x': 1, 'binning_x_range': [1, 24], ..."
Received "cam_open" with value "None"
>>> cam.exposure_range
[0.0, 1000000.0]
>>> cam.exposure_ms
241.948
>>> # update the exposure value
>>> cam.set_setting('exposure_ms', 150)
Received "settings" with value "{'exposure_ms': 150.0}"
>>> cam.exposure_ms
150.0
>>> # now play the camera
>>> cam.play_camera()
Received "playing" with value "True"
Received image "<ffpyplayer.pic.Image object at 0x000001D1D8D67900>" with time "2e-07" and counts "1", "1"
Received image "<ffpyplayer.pic.Image object at 0x000001D1D8D67990>" with time "0.2310473" and counts "2", "1"
Received image "<ffpyplayer.pic.Image object at 0x000001D1D8D67A68>" with time "0.4735178" and counts "3", "1"
Received image "<ffpyplayer.pic.Image object at 0x000001D1D8D67B40>" with time "0.7157285" and counts "4", "1"
Received image "<ffpyplayer.pic.Image object at 0x000001D1D8D67C18>" with time "0.9583721" and counts "5", "1"
>>> # now stop playing
>>> cam.stop_playing_camera()
Received "playing" with value "False"
>>> # close the camera
>>> cam.close_camera()
Received "cam_closed" with value "None"
>>> # close the server and everything
>>> cam.stop_cam_process(join=True)
```
DbConnection 0.0.4
Convenient wrapper to create database connection engine based on the parameters passed. This engine can be used to run sql queries on the respective databases.
License: MIT

# Database connection creator
Convenient wrapper to create database connection engine based on the parameters passed. This engine can be used to run 
sql queries on the respective databases.

## Install with pip
```bash
$ pip install DbConnection
```

## Usage
1. Import the library.
    ```python
   from DbConnection.DbConnectionCreator import DbConnectionCreator
    ```

2. Create an instance.
    ```python 
   sql_db_con = DbConnectionCreator(project_path="", logger=<your_logger_instance>, env="", db_library="").get_database_connection_object()
    ```
    Arguments (all are mandatory):
    * `project_path`: Project name, which would serve as the logger's name (*if specified*), and the prefix for log filenames.
    * `logger`: your Logger Instance
    * `"env"`: Execution Environment
    * `"env"`: select specifc library either 'sqlalchemy' and 'oracledb' 
    
3. create a connection string
    ```python
   conn_string = sql_db_con.get_session_conn_string(self, test='local', co_name=None, 
                schema=False, vault_cred_dict=None, local_creds_json_file_with_path=None,
                 connection_keys_mapper_file_with_path=None)
    ```
    Arguments (all are mandatory):
    * `test`: 'local' or 'deploy' which says whether to run in local or deploy
    * `co_name`: 'AZURE' or 'Postgres' or 'CRM'. returns the respective connection string
    * `schema`: pass False as value to establish connection only to database and not schema
    * `vault_cred_dict`: dictionary which contains values read from vault secret paths
    * `local_creds_json_file_with_path`: json file which contains credentials in the same format as vault secret values
    * `connection_keys_mapper_file_with_path`: json file contains the specific creds keys to use for each co_name
   
4. create an engine
   ```python
   conn_engine = sql_db_con.create_eng(conn_string)
    ```
    Arguments (all are mandatory):
    * `conn_string`: connection string obtained in step 3

5. create a session
   ```python
   conn_session = sql_db_con.create_session(conn_string)
    ```
    Arguments (all are mandatory):
    * `conn_string`: connection string obtained in step 3
   
## Author

**&copy; 2022, [Mallikarjuna Devaraya](mallikarjuna.devaraya@gartner.com)**.