connector-factory


Nameconnector-factory JSON
Version 0.0.5 PyPI version JSON
download
home_pagehttps://github.com/shrivastava-v-ankit/connector-factory
SummaryConnector Factory;
upload_time2024-07-15 04:53:26
maintainerNone
docs_urlNone
authorAnkit Shrivastava
requires_python<3.13,>3.8
licenseMIT
keywords python os independent database sqlalchemy sqlite3 sqlite postgres mysql maridb snowflake aws s3select salesforce
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # connector-factory

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI](https://img.shields.io/pypi/v/connector-factory.svg)](https://pypi.org/project/connector-factory)


Connector factory is used to manage/create connection with execute queries using the connection.
The concept of having single source to connect various sources and perform operations on top of it.


User need not to worry on the crafting the connection string and to identify the methods for the basic operations.
Connector factory supports DML / DDL executions and have support of Pandas DataFrame to create or replace existing tables.

Connector factory is wrapper on various sources and for database source it uses sqlalchemy for crafting the connection and supports below databases:

```bash
* Sqlite3
* PostgreSQl
* Snowflake
* MariaDB
* MySQL
* Redshift
* Salesforce
* S3Select
* Databricks
* Synapse
* DynamoDB
* IBM DB2
```

* Note: Only select operations are supported for Salesforce and S3Select and limited functionality. These are not managed by the usage of sqlalchemy.

* Note: Connector factory can be enhanced for all the sqlalchemy supported database.

* Note: DynamoDB is supported via PyDynao. Please check the features and limitations at [PyDynamoDB](https://github.com/passren/PyDynamoDB/wiki).

Connector factory also provide the facility to create the connections for Salesforce
using simple-saleforce python package. Only Select query is supported in Salesforce. For advance usage it exposes the Salesforce object (simple-saleforce python package) which can be used as per the requirements. Refer [simple-saleforce](https://pypi.org/project/simple-salesforce/) for more detail.

## Getting Started

```bash
pip install connector-factory
```

By default connector-factory is installed with only SQlite3 support only. For other support it can be installed using combinations of below flags
* postgres
* redshift
* snowflake
* mysql
* mariadb
* salesforce
* s3select
* databricks
* synapse
* db2
* dynamodb
* all (For all supported types)
```
pip install connector-factory["postgres"]
```


### Using connector-factory
-----
```python
from connector_factory import ConnectorFactory
import tempfile

temp_dir = tempfile.gettempdir()
config = {
  "path": temp_dir,
  "database": "site.db"
  }
db = ConnectorFactory(connector_type="sqlite", config=config)

db.execute_sql(sql="create table test (id int PRIMARY KEY)")
db.execute_sql(sql="insert into test values (1)")
db.execute_sql(sql="insert into test values (2)")

rows = db.execute_sql(sql="select * from test")
if rows:
  print(rows)


df = db.get_df(sql="select * from test")
print(df)

db.execute_df(panda_df=df, table_name="copy_test", exist_action="replace")
# db.execute_df(panda_df=df, table_name=copy_test, exist_action="replace", chunk_size=100)
db.execute_sql(sql="insert into copy_test values (3)")
rows_copy = db.execute_sql(sql="select * from copy_test")
if rows_copy:
  print(rows_copy)
```

## Appendix
### Supported database type:
----
```
*   sqlite (default)
*   postgres
*   mysql
*   mariadb
*   snowflake
*   redshift
*   salesforce
*   s3select
*   databricks
*   synapse
*   db2
*   dynamodb
```

### Configuration parameters for sqlite:
-----
-----
```python
* connector_type: sqlite
* config = {
    "path": "<folder_path_where_sqlite_database_file_exist>",
    "database": "<name_of_sqlite_database_file>"
}
```
**Details:**
* path: (Optional)=> Default user home directory. Path to folder where flat sqlite database file is present.
* database (Required)=> .db is optional, if not present .db will attach to look for database flat file. If file not present will create the file.
-----

### Connection parameters for postgres:
-----
-----
```python
* connector_type: postgres
* config = {
    "username": "<postgres_user>",
    "password": "<user_password>",
    "host": "<host_of_postgres_service>",
    "port": "<port_of_postgres_service>",
    "database": "<name_of_database>"
}
```

**Details:**
* username: (Required)=> Name of user for connection.
* password (Required)=> Password of user.
* host: (Required)=> Host of PostgreSql service.
* port: (Optional)=> Default 5432. Port of PostgreSql service.
* database: (Optional)=> If provided will be used as default database in connection. If not then query should comply with fully qualified path to table.
-----

### Connection parameters for mysql:
-----
-----
```python
* connector_type: mysql
* config = {
    "username": "<mysql_user>",
    "password": "<user_password>",
    "host": "<host_of_mysql_service>",
    "port": "<port_of_mysql_service>",
    "database": "<name_of_database>"
}
```

**Details:**
* username: (Required)=> Name of user for connection.
* password (Required)=> Password of user.
* host: (Required)=> Host of MySQL service.
* port: (Optional)=> Default 3306. Port of MySQL service.
* database: (Optional)=> If provided will be used as default database in connection. If not then query should comply with fully qualified path to table.
-----

### Connection parameters for mariadb:
-----
-----
```python
* connector_type: mariadb
* config = {
    "username": "<mariadb_user>",
    "password": "<user_password>",
    "host": "<host_of_mariadb_service>",
    "port": "<port_of_mariadb_service>",
    "database": "<name_of_database>"
}
```

**Details:**
* username: (Required)=> Name of user for connection.
* password (Required)=> Password of user.
* host: (Required)=> Host of MariaDB service.
* port: (Optional)=> Default 3306. Port of MariaDB service.
* database: (Optional)=> If provided will be used as default database in connection. If not then query should comply with fully qualified path to table.
-----

### Connection parameters for snowflake:
-----
-----
```python
* connector_type: snowflake
* config = {
    "username": "<snowflake_user>",
    "password": "<user_password>",
    "role": "<snowflake_role>",
    "account": "<snowflake_account>",
    "warehouse": "<snowflake_warehouse>",
    "schema": "<snowflake_schema>",
    "database": "<name_of_database>",
    "key": "<private_key_path>"
}
```

**Details:**
* username: (Required)=> Name of user for connection.
* account: (Required)=> Snowflake account name.
* password (Optional)=> Password of user/private key. Required if private key is not provided.
* role: (Optional)=> If not provided user default role will be used. Consider USE statement to switch from default role.
* database: (Optional)=> If provided will be used as default database in connection. If not then query should comply with fully qualified path to table.
* warehouse: (Optional)=> If not provided user default warehouse will be used. Consider USE statement to switch from default warehouse.
* schema: (Optional)=> If not provided default public schema will be used. Consider USE statement to switch from default schema or fully qualified path to table. Ignored if database is not proivided.
* key: (Optional)=> Either Key or Password is required. If key is present and password is also present then password will be used to decrypt the key. If password is not given then consider the unencrypted key. We strongly recommended to use only encrypted key.
-----

### Connection parameters for redshift:
-----
-----
```python
* connector_type: redshift
* config = {
    "username": "<redshift_user>",
    "password": "<user_password>",
    "host": "<host_of_redshift_service>",
    "port": "<port_of_redshift_service>",
    "database": "<name_of_database>"
}
```

**Details:**
* username: (Required)=> Name of user for connection.
* password (Required)=> Password of user.
* host: (Required)=> Host of Redshift service.
* port: (Optional)=> Default 5469. Port of Redshift service.
* database: (Required)=> Name of database for connection.
-----

### Connection parameters for Salesforce:
-----
-----
```python
* connector_type: salesforce
* config = {
    "username": "<salesforce_user>",
    "password": "<user_password>",
    "domain": "<domain_of_salesforce_service>",
    "token": "<user_token_for_salesforce_service>"
}
```

**Details:**
* username: (Required)=> Name of user for connection.
* password (Required)=> Password of user.
* domain: (Required)=> Host of Salesforce service.
* token: (Required)=> User token for Salesforce service.
-----


### Connection parameters for S3select:
-----
-----
```python
* connector_type: s3select
* config = {
    "bucket": "<AWS_S3_bucket>",
    "file": "<Path_of_file_in_bucket>",
    "type": "<file_type>",
    "limit": "<limit_of_record_to_fetch>",
    "compression": "<compression_type>"
}
```

**Details:**
* bucket: (Required)=> Name of AWS S3 bucket to look for files for queries.
* type: (Required)=> Supported types is one of csv, json or parquet.
* file (Required)=> Full file path without bucket or prefix key to serach for similar files as per the type of files provided. First line is considered as header of file for csv. Example: if only prefix is provided like mypath/mydatafile and type is csv then all files named as mypath/mydatafile*.csv will be read.
* limit: (Optional)=> Commulative number of records to read from the file (multiple files).
* compression: (Optional)=> Supported types is one of GZIP, BZIP2 or NONE.
-----


### Connection parameters for Synapse:
-----
-----
```python
* connector_type: synapse
* config = {
    "username": "<synapse_user>",
    "password": "<user_password>",
    "host": "<hostname_of_synapse_service>",
    "port": "<port_of_synapse_service>",
    "database": "<database_name>",
    "driver": "<driver_to_connect_synapse_service>",
    "trust_certificate": "<trust_the_synapse_connection>",
    "authentication_with": "<authentication_type_of_synapse_service>",
    "connection_timeout": "<connection_timeout_to_synapse_service>"
}
```

**Details:**
* username: (Required)=> Name of user for connection.
* password (Required)=> Password of user.
* host: (Required)=> Host of Synapse service.
* port: (Optional)=> Port of Synapse service. Default to 1433
* database: (Required)=> Database name.
* driver: (Optional)=> Name of driver to use. Default to ODBC Driver 17 for SQL Server.
* trust_certificate: (Optional)=> Trust the connection with certificate. Default to no.
* authentication_with: (Optional)=> Default to None and not in use to authenticate with. If service principal or AD authenitication is used then pass appropriate value.
* connection_timeout: (Optional)=> Connection timeout. Default to 30.
-----


### Connection parameters for Databricks:
-----
-----
```python
* connector_type: databricks
* config = {
    "hostname": "<hostname_of_databricks_service>",
    "token": "<pat_token_of_databricks_as_password>",
    "http_path": "<path_of_warehouse_or_cluster>",
    "catalog": "<catalog_name_of_databricks>",
    "schema": "<schema_name_of_databricks>",
}
```

**Details:**
* hostname: (Required)=> Databricks hostname.
* token (Required)=> Pat token of user.
* http_path: (Required)=> Path of warehouse or cluster.
* catalog: (Required)=> Unity catalog name
* schema: (Required)=> Schema name under catalog.
-----


### Connection parameters for IBM DB2:
-----
-----
```python
* connector_type: db2
* config = {
    "username": "<hostname_of_databricks_service>",
    "password": "<pat_token_of_databricks_as_password>",
    "host": "<path_of_warehouse_or_cluster>",
    "port": "<catalog_name_of_databricks>",
    "database": "<schema_name_of_databricks>",
}
```

**Details:**
* username: (Required)=> Name of user for connection.
* password (Required)=> Password of user.
* host: (Required)=> Host of IBM DB2 Server.
* port: (Optional)=> Port of IBM DB2 Server. Default to 50000
* database: (Required)=> Database name.
-----


### Connection parameters for DynamoDB:
-----
-----
```python
* connector_type: dynamodb
* config = {
    "region": "<aws_region_of_dynamodb>"
}
```

**Details:**
* region: (Optional)=> AWS Region. Default is us-east-1
-----


### Development Setup

#### Using virtualenv

```bash
python3 -m venv venv
source env/bin/activate
pip install .["all"]
```

### Contributing

1. Fork repo- https://github.com/shrivastava-v-ankit/connector-factory.git
2. Create your feature branch - `git checkout -b feature/name`
3. Install Python packages under all virtual environments of Python 3.9, 3.10, 3.11, 3.12
    * pip install .["all"]
    * pip install coverage==7.2.3
    * pip install exceptiongroup==1.1.1
    * pip install pluggy==1.0.0
    * pip install pytest==7.3.0
    * pip install pytest-cov==4.0.0
    * pip install tomli==2.0.1
4. Run Python test (pytest)
    * For Python 3.9:
      ```python
      pytest -v --cov --cov-report=html:test-results/connection_factory_test/htmlcov.3.9 --cov-report=xml:test-results/connection_factory_test/coverage.3.9.xml --junitxml=test-results/connection_factory_test/results.3.9.xml
      ```
    * For Python 3.10:
      ```python
      pytest -v --cov --cov-report=html:test-results/connection_factory_test/htmlcov.3.10 --cov-report=xml:test-results/connection_factory_test/coverage.3.10.xml --junitxml=test-results/connection_factory_test/results.3.10.xml
      ```
    * For Python 3.11:
      ```python
      pytest -v --cov --cov-report=html:test-results/connection_factory_test/htmlcov.3.11 --cov-report=xml:test-results/connection_factory_test/coverage.3.11.xml --junitxml=test-results/connection_factory_test/results.3.11.xml
      ```
    * For Python 3.12:
      ```python
      pytest -v --cov --cov-report=html:test-results/connection_factory_test/htmlcov.3.12 --cov-report=xml:test-results/connection_factory_test/coverage.3.12.xml --junitxml=test-results/connection_factory_test/results.3.12.xml
      ```

5. Add Python test (pytest) and covrage report for new/changed feature generated under test-results/connection_factory_test/
6. Commit your changes - `git commit -am "Added name"`
7. Push to the branch - `git push origin feature/name`
8. Create a new pull request


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/shrivastava-v-ankit/connector-factory",
    "name": "connector-factory",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>3.8",
    "maintainer_email": null,
    "keywords": "python, os independent, database, sqlalchemy, sqlite3, sqlite, postgres, mysql, maridb, snowflake, aws, s3select, salesforce",
    "author": "Ankit Shrivastava",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/5a/03/fdc8bde231f4a25ff2cf85ea454f5158ba224196e082bb37e90f1feacd04/connector_factory-0.0.5.tar.gz",
    "platform": "any",
    "description": "# connector-factory\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![PyPI](https://img.shields.io/pypi/v/connector-factory.svg)](https://pypi.org/project/connector-factory)\n\n\nConnector factory is used to manage/create connection with execute queries using the connection.\nThe concept of having single source to connect various sources and perform operations on top of it.\n\n\nUser need not to worry on the crafting the connection string and to identify the methods for the basic operations.\nConnector factory supports DML / DDL executions and have support of Pandas DataFrame to create or replace existing tables.\n\nConnector factory is wrapper on various sources and for database source it uses sqlalchemy for crafting the connection and supports below databases:\n\n```bash\n* Sqlite3\n* PostgreSQl\n* Snowflake\n* MariaDB\n* MySQL\n* Redshift\n* Salesforce\n* S3Select\n* Databricks\n* Synapse\n* DynamoDB\n* IBM DB2\n```\n\n* Note: Only select operations are supported for Salesforce and S3Select and limited functionality. These are not managed by the usage of sqlalchemy.\n\n* Note: Connector factory can be enhanced for all the sqlalchemy supported database.\n\n* Note: DynamoDB is supported via PyDynao. Please check the features and limitations at [PyDynamoDB](https://github.com/passren/PyDynamoDB/wiki).\n\nConnector factory also provide the facility to create the connections for Salesforce\nusing simple-saleforce python package. Only Select query is supported in Salesforce. For advance usage it exposes the Salesforce object (simple-saleforce python package) which can be used as per the requirements. Refer [simple-saleforce](https://pypi.org/project/simple-salesforce/) for more detail.\n\n## Getting Started\n\n```bash\npip install connector-factory\n```\n\nBy default connector-factory is installed with only SQlite3 support only. For other support it can be installed using combinations of below flags\n* postgres\n* redshift\n* snowflake\n* mysql\n* mariadb\n* salesforce\n* s3select\n* databricks\n* synapse\n* db2\n* dynamodb\n* all (For all supported types)\n```\npip install connector-factory[\"postgres\"]\n```\n\n\n### Using connector-factory\n-----\n```python\nfrom connector_factory import ConnectorFactory\nimport tempfile\n\ntemp_dir = tempfile.gettempdir()\nconfig = {\n  \"path\": temp_dir,\n  \"database\": \"site.db\"\n  }\ndb = ConnectorFactory(connector_type=\"sqlite\", config=config)\n\ndb.execute_sql(sql=\"create table test (id int PRIMARY KEY)\")\ndb.execute_sql(sql=\"insert into test values (1)\")\ndb.execute_sql(sql=\"insert into test values (2)\")\n\nrows = db.execute_sql(sql=\"select * from test\")\nif rows:\n  print(rows)\n\n\ndf = db.get_df(sql=\"select * from test\")\nprint(df)\n\ndb.execute_df(panda_df=df, table_name=\"copy_test\", exist_action=\"replace\")\n# db.execute_df(panda_df=df, table_name=copy_test, exist_action=\"replace\", chunk_size=100)\ndb.execute_sql(sql=\"insert into copy_test values (3)\")\nrows_copy = db.execute_sql(sql=\"select * from copy_test\")\nif rows_copy:\n  print(rows_copy)\n```\n\n## Appendix\n### Supported database type:\n----\n```\n*   sqlite (default)\n*   postgres\n*   mysql\n*   mariadb\n*   snowflake\n*   redshift\n*   salesforce\n*   s3select\n*   databricks\n*   synapse\n*   db2\n*   dynamodb\n```\n\n### Configuration parameters for sqlite:\n-----\n-----\n```python\n* connector_type: sqlite\n* config = {\n    \"path\": \"<folder_path_where_sqlite_database_file_exist>\",\n    \"database\": \"<name_of_sqlite_database_file>\"\n}\n```\n**Details:**\n* path: (Optional)=> Default user home directory. Path to folder where flat sqlite database file is present.\n* database (Required)=> .db is optional, if not present .db will attach to look for database flat file. If file not present will create the file.\n-----\n\n### Connection parameters for postgres:\n-----\n-----\n```python\n* connector_type: postgres\n* config = {\n    \"username\": \"<postgres_user>\",\n    \"password\": \"<user_password>\",\n    \"host\": \"<host_of_postgres_service>\",\n    \"port\": \"<port_of_postgres_service>\",\n    \"database\": \"<name_of_database>\"\n}\n```\n\n**Details:**\n* username: (Required)=> Name of user for connection.\n* password (Required)=> Password of user.\n* host: (Required)=> Host of PostgreSql service.\n* port: (Optional)=> Default 5432. Port of PostgreSql service.\n* database: (Optional)=> If provided will be used as default database in connection. If not then query should comply with fully qualified path to table.\n-----\n\n### Connection parameters for mysql:\n-----\n-----\n```python\n* connector_type: mysql\n* config = {\n    \"username\": \"<mysql_user>\",\n    \"password\": \"<user_password>\",\n    \"host\": \"<host_of_mysql_service>\",\n    \"port\": \"<port_of_mysql_service>\",\n    \"database\": \"<name_of_database>\"\n}\n```\n\n**Details:**\n* username: (Required)=> Name of user for connection.\n* password (Required)=> Password of user.\n* host: (Required)=> Host of MySQL service.\n* port: (Optional)=> Default 3306. Port of MySQL service.\n* database: (Optional)=> If provided will be used as default database in connection. If not then query should comply with fully qualified path to table.\n-----\n\n### Connection parameters for mariadb:\n-----\n-----\n```python\n* connector_type: mariadb\n* config = {\n    \"username\": \"<mariadb_user>\",\n    \"password\": \"<user_password>\",\n    \"host\": \"<host_of_mariadb_service>\",\n    \"port\": \"<port_of_mariadb_service>\",\n    \"database\": \"<name_of_database>\"\n}\n```\n\n**Details:**\n* username: (Required)=> Name of user for connection.\n* password (Required)=> Password of user.\n* host: (Required)=> Host of MariaDB service.\n* port: (Optional)=> Default 3306. Port of MariaDB service.\n* database: (Optional)=> If provided will be used as default database in connection. If not then query should comply with fully qualified path to table.\n-----\n\n### Connection parameters for snowflake:\n-----\n-----\n```python\n* connector_type: snowflake\n* config = {\n    \"username\": \"<snowflake_user>\",\n    \"password\": \"<user_password>\",\n    \"role\": \"<snowflake_role>\",\n    \"account\": \"<snowflake_account>\",\n    \"warehouse\": \"<snowflake_warehouse>\",\n    \"schema\": \"<snowflake_schema>\",\n    \"database\": \"<name_of_database>\",\n    \"key\": \"<private_key_path>\"\n}\n```\n\n**Details:**\n* username: (Required)=> Name of user for connection.\n* account: (Required)=> Snowflake account name.\n* password (Optional)=> Password of user/private key. Required if private key is not provided.\n* role: (Optional)=> If not provided user default role will be used. Consider USE statement to switch from default role.\n* database: (Optional)=> If provided will be used as default database in connection. If not then query should comply with fully qualified path to table.\n* warehouse: (Optional)=> If not provided user default warehouse will be used. Consider USE statement to switch from default warehouse.\n* schema: (Optional)=> If not provided default public schema will be used. Consider USE statement to switch from default schema or fully qualified path to table. Ignored if database is not proivided.\n* key: (Optional)=> Either Key or Password is required. If key is present and password is also present then password will be used to decrypt the key. If password is not given then consider the unencrypted key. We strongly recommended to use only encrypted key.\n-----\n\n### Connection parameters for redshift:\n-----\n-----\n```python\n* connector_type: redshift\n* config = {\n    \"username\": \"<redshift_user>\",\n    \"password\": \"<user_password>\",\n    \"host\": \"<host_of_redshift_service>\",\n    \"port\": \"<port_of_redshift_service>\",\n    \"database\": \"<name_of_database>\"\n}\n```\n\n**Details:**\n* username: (Required)=> Name of user for connection.\n* password (Required)=> Password of user.\n* host: (Required)=> Host of Redshift service.\n* port: (Optional)=> Default 5469. Port of Redshift service.\n* database: (Required)=> Name of database for connection.\n-----\n\n### Connection parameters for Salesforce:\n-----\n-----\n```python\n* connector_type: salesforce\n* config = {\n    \"username\": \"<salesforce_user>\",\n    \"password\": \"<user_password>\",\n    \"domain\": \"<domain_of_salesforce_service>\",\n    \"token\": \"<user_token_for_salesforce_service>\"\n}\n```\n\n**Details:**\n* username: (Required)=> Name of user for connection.\n* password (Required)=> Password of user.\n* domain: (Required)=> Host of Salesforce service.\n* token: (Required)=> User token for Salesforce service.\n-----\n\n\n### Connection parameters for S3select:\n-----\n-----\n```python\n* connector_type: s3select\n* config = {\n    \"bucket\": \"<AWS_S3_bucket>\",\n    \"file\": \"<Path_of_file_in_bucket>\",\n    \"type\": \"<file_type>\",\n    \"limit\": \"<limit_of_record_to_fetch>\",\n    \"compression\": \"<compression_type>\"\n}\n```\n\n**Details:**\n* bucket: (Required)=> Name of AWS S3 bucket to look for files for queries.\n* type: (Required)=> Supported types is one of csv, json or parquet.\n* file (Required)=> Full file path without bucket or prefix key to serach for similar files as per the type of files provided. First line is considered as header of file for csv. Example: if only prefix is provided like mypath/mydatafile and type is csv then all files named as mypath/mydatafile*.csv will be read.\n* limit: (Optional)=> Commulative number of records to read from the file (multiple files).\n* compression: (Optional)=> Supported types is one of GZIP, BZIP2 or NONE.\n-----\n\n\n### Connection parameters for Synapse:\n-----\n-----\n```python\n* connector_type: synapse\n* config = {\n    \"username\": \"<synapse_user>\",\n    \"password\": \"<user_password>\",\n    \"host\": \"<hostname_of_synapse_service>\",\n    \"port\": \"<port_of_synapse_service>\",\n    \"database\": \"<database_name>\",\n    \"driver\": \"<driver_to_connect_synapse_service>\",\n    \"trust_certificate\": \"<trust_the_synapse_connection>\",\n    \"authentication_with\": \"<authentication_type_of_synapse_service>\",\n    \"connection_timeout\": \"<connection_timeout_to_synapse_service>\"\n}\n```\n\n**Details:**\n* username: (Required)=> Name of user for connection.\n* password (Required)=> Password of user.\n* host: (Required)=> Host of Synapse service.\n* port: (Optional)=> Port of Synapse service. Default to 1433\n* database: (Required)=> Database name.\n* driver: (Optional)=> Name of driver to use. Default to ODBC Driver 17 for SQL Server.\n* trust_certificate: (Optional)=> Trust the connection with certificate. Default to no.\n* authentication_with: (Optional)=> Default to None and not in use to authenticate with. If service principal or AD authenitication is used then pass appropriate value.\n* connection_timeout: (Optional)=> Connection timeout. Default to 30.\n-----\n\n\n### Connection parameters for Databricks:\n-----\n-----\n```python\n* connector_type: databricks\n* config = {\n    \"hostname\": \"<hostname_of_databricks_service>\",\n    \"token\": \"<pat_token_of_databricks_as_password>\",\n    \"http_path\": \"<path_of_warehouse_or_cluster>\",\n    \"catalog\": \"<catalog_name_of_databricks>\",\n    \"schema\": \"<schema_name_of_databricks>\",\n}\n```\n\n**Details:**\n* hostname: (Required)=> Databricks hostname.\n* token (Required)=> Pat token of user.\n* http_path: (Required)=> Path of warehouse or cluster.\n* catalog: (Required)=> Unity catalog name\n* schema: (Required)=> Schema name under catalog.\n-----\n\n\n### Connection parameters for IBM DB2:\n-----\n-----\n```python\n* connector_type: db2\n* config = {\n    \"username\": \"<hostname_of_databricks_service>\",\n    \"password\": \"<pat_token_of_databricks_as_password>\",\n    \"host\": \"<path_of_warehouse_or_cluster>\",\n    \"port\": \"<catalog_name_of_databricks>\",\n    \"database\": \"<schema_name_of_databricks>\",\n}\n```\n\n**Details:**\n* username: (Required)=> Name of user for connection.\n* password (Required)=> Password of user.\n* host: (Required)=> Host of IBM DB2 Server.\n* port: (Optional)=> Port of IBM DB2 Server. Default to 50000\n* database: (Required)=> Database name.\n-----\n\n\n### Connection parameters for DynamoDB:\n-----\n-----\n```python\n* connector_type: dynamodb\n* config = {\n    \"region\": \"<aws_region_of_dynamodb>\"\n}\n```\n\n**Details:**\n* region: (Optional)=> AWS Region. Default is us-east-1\n-----\n\n\n### Development Setup\n\n#### Using virtualenv\n\n```bash\npython3 -m venv venv\nsource env/bin/activate\npip install .[\"all\"]\n```\n\n### Contributing\n\n1. Fork repo- https://github.com/shrivastava-v-ankit/connector-factory.git\n2. Create your feature branch - `git checkout -b feature/name`\n3. Install Python packages under all virtual environments of Python 3.9, 3.10, 3.11, 3.12\n    * pip install .[\"all\"]\n    * pip install coverage==7.2.3\n    * pip install exceptiongroup==1.1.1\n    * pip install pluggy==1.0.0\n    * pip install pytest==7.3.0\n    * pip install pytest-cov==4.0.0\n    * pip install tomli==2.0.1\n4. Run Python test (pytest)\n    * For Python 3.9:\n      ```python\n      pytest -v --cov --cov-report=html:test-results/connection_factory_test/htmlcov.3.9 --cov-report=xml:test-results/connection_factory_test/coverage.3.9.xml --junitxml=test-results/connection_factory_test/results.3.9.xml\n      ```\n    * For Python 3.10:\n      ```python\n      pytest -v --cov --cov-report=html:test-results/connection_factory_test/htmlcov.3.10 --cov-report=xml:test-results/connection_factory_test/coverage.3.10.xml --junitxml=test-results/connection_factory_test/results.3.10.xml\n      ```\n    * For Python 3.11:\n      ```python\n      pytest -v --cov --cov-report=html:test-results/connection_factory_test/htmlcov.3.11 --cov-report=xml:test-results/connection_factory_test/coverage.3.11.xml --junitxml=test-results/connection_factory_test/results.3.11.xml\n      ```\n    * For Python 3.12:\n      ```python\n      pytest -v --cov --cov-report=html:test-results/connection_factory_test/htmlcov.3.12 --cov-report=xml:test-results/connection_factory_test/coverage.3.12.xml --junitxml=test-results/connection_factory_test/results.3.12.xml\n      ```\n\n5. Add Python test (pytest) and covrage report for new/changed feature generated under test-results/connection_factory_test/\n6. Commit your changes - `git commit -am \"Added name\"`\n7. Push to the branch - `git push origin feature/name`\n8. Create a new pull request\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Connector Factory;",
    "version": "0.0.5",
    "project_urls": {
        "Homepage": "https://github.com/shrivastava-v-ankit/connector-factory",
        "Source": "https://github.com/shrivastava-v-ankit/connector-factory/",
        "Tracker": "https://github.com/shrivastava-v-ankit/connector-factory/issues"
    },
    "split_keywords": [
        "python",
        " os independent",
        " database",
        " sqlalchemy",
        " sqlite3",
        " sqlite",
        " postgres",
        " mysql",
        " maridb",
        " snowflake",
        " aws",
        " s3select",
        " salesforce"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a741398e53b06e963ea6b68daa8815d205208bda11420a0fe9a9ae6878348cc5",
                "md5": "3d3073e1192fb8e393a283a736aba2e4",
                "sha256": "30286f5a21662fdbc7d1e2bfe60714811cd38822d940bf8672d851329c6b5292"
            },
            "downloads": -1,
            "filename": "connector_factory-0.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3d3073e1192fb8e393a283a736aba2e4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>3.8",
            "size": 29754,
            "upload_time": "2024-07-15T04:53:24",
            "upload_time_iso_8601": "2024-07-15T04:53:24.171800Z",
            "url": "https://files.pythonhosted.org/packages/a7/41/398e53b06e963ea6b68daa8815d205208bda11420a0fe9a9ae6878348cc5/connector_factory-0.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5a03fdc8bde231f4a25ff2cf85ea454f5158ba224196e082bb37e90f1feacd04",
                "md5": "3ece221cfee5d0da8afc3bc98a1b7473",
                "sha256": "b639014628719ae4c473ebb1e9df764ce0f49fae4f89105d1f95411f61d5c56e"
            },
            "downloads": -1,
            "filename": "connector_factory-0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "3ece221cfee5d0da8afc3bc98a1b7473",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>3.8",
            "size": 27004,
            "upload_time": "2024-07-15T04:53:26",
            "upload_time_iso_8601": "2024-07-15T04:53:26.183510Z",
            "url": "https://files.pythonhosted.org/packages/5a/03/fdc8bde231f4a25ff2cf85ea454f5158ba224196e082bb37e90f1feacd04/connector_factory-0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-15 04:53:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "shrivastava-v-ankit",
    "github_project": "connector-factory",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": false,
    "lcname": "connector-factory"
}
        
Elapsed time: 0.32229s