Skip to main content

Fortress Platform Python API SDK

Project description

Fortress Python SDK

Welcome to the Fortress Python SDK. This SDK provides a way for you to leverage the power of the Fortress platform in your Python applications.

Installation

You can install the SDK using pip. Simply run the following command:

pip install fortress-sdk-python

Quick Start

Here is a quick example to get you started with the SDK:

from fortress_sdk_python import Fortress

# Initialize the client with your API key
client = Fortress(org_id='your_org_id', api_key='your_api_key')

# Connect to a database
conn = client.connect_tenant(tenant_name='client1')
cursor = conn.cursor()

# Execute a query to fetch all rows from a table
results = cursor.execute('SELECT * FROM your_table_name').fetchall()

# Print the results
for row in results:
    print(row)

# Close the connection
conn.close()

Documentation

Below is a list of the available functionality in the SDK. Using the SDK you can create a new tenants and point them to existing or new databases. You can also easily route data requests based on tenant names. For more detailed information, please refer to the Fortress API documentation.

Database Management:

  • create_database(database_name: str, alias: str): Creates a new database.
  • delete_database(database_name: str): Deletes to a database.
  • list_databases(): Lists all databases.
  • connect_database(database_id: str): Connects to a database and turns into SQL connection.

Tenant Management:

  • create_tenant(tenant_name: str, alias: str, database_id: str = ""): Creates a new tenant.
  • delete_tenant(tenant_name: str): Deletes a tenant.
  • list_tenants(): Lists all tenants.
  • connect_tenant(tenant_name: str): Connects to a tenant and turns into SQL connection.

Configuration

To use the SDK, generate an API key from the Fortress dashboard to initialize the client. Also, provide the organization ID, which is available under the API Keys page on the platform website.

License

This SDK is licensed under the MIT License.

Support

If you have any questions or need help, don't hesitate to get in touch with our support team at founders@fortress.build.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fortress_sdk_python-0.1.8.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

fortress_sdk_python-0.1.8-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file fortress_sdk_python-0.1.8.tar.gz.

File metadata

  • Download URL: fortress_sdk_python-0.1.8.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for fortress_sdk_python-0.1.8.tar.gz
Algorithm Hash digest
SHA256 add1e22a2bd5a157859e2767f54e5ff61c6b79514a86304d3ea7fdad30259c97
MD5 5309d320f10aacea1de8a8a7350a81cf
BLAKE2b-256 304a0f89367e5f5285400170227fdd2febdfbe6a905b4f8e3b1b34a203a031fd

See more details on using hashes here.

File details

Details for the file fortress_sdk_python-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for fortress_sdk_python-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b36a46d0f6143fdf96e177a296632aa9ce8fa6185101f56fac7458ca5cd60a45
MD5 bb5bce3f36e59a0ad0bf7637c91c42b4
BLAKE2b-256 d9f1c576770895c49a17ff9f89cfea6471d7bf60bac8fead75f47deff07d0504

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page