Skip to main content

Aito.ai Python SDK

Project description

Info:

Check Github for the latest source code and documentation for more information.

Maintainer:

Aito <admin@aito.ai>

PyPI PyPI version

About

The Aito Python SDK is an open-source library that helps you to integrate your Python application to Aito quicker and more efficiently.

The SDK also includes the Aito Command Line Interface (CLI) that enables you to interact with Aito using commands in your command-line shell, e.g: infer a table schema from a file or upload a file to Aito.

Support / Feedback

For issues with, questions about, or feedback, please join our support channels.

Installation

Aito Python SDK can be installed with pip

$ pip install aitoai

Check our installation guide for more information

Documentation

You will need sphinx installed to generate the documentation.

$ pip install sphinx $ pip install sphinx_rtd_theme

Documentation can be generated by:

$ cd docs
$ make clean html

Generated documentation can be found in the docs/build/html/* directory.

Dependencies:

The Python SDK SQL integration and the tests depend on the ODBC db drivers and the postgres and mysql functionality.

The main drivers can be installed in Debian based Linuxes with:

` sudo apt install unixodbc-dev odbc-postgresql postgresql-client default-mysql-client pip install pyodbc `

You can find more information about installing the MySQL ODBC drivers [here](https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-installation.html)

Also note: that the database integration tests require local postgres / mySQL servers.

Environment:

To run the test, you need to have the following environment variables defined:

  • AITO_GROCERY_DEMO_INSTANCE_URL

  • AITO_GROCERY_DEMO_API_KEY

  • AITO_INSTANCE_URL

  • AITO_API_KEY

Testing

Install the required packages:

$ pip install -r requirements/build.txt
$ pip install -r requirements/test.txt

You can use our test cli to run tests:

$ python -m tests -h

There are multiple test suites:

  1. CLI suite:

$ python -m tests -v suite cli
  1. SDK suite:

$ python -m tests -v suite sdk
  1. SQL functions tests:

  • Test against Postgres:

    $ python -m tests -v case sql_functions.test_connection.TestPostgresConnection
    $ python -m tests -v case sql_functions.test_cli_sql_functions.TestPostgresFunctions
  • Test against MySQL:

    $ python -m tests -v case sql_functions.test_connection.TestMySQLConnection
    $ python -m tests -v case sql_functions.test_cli_sql_functions.TestMySQLFunctions
  1. Build and test built package:

  • To build the package:

    $ pip install -r requirements/deploy.txt
    $ ./scripts/deploy test.pypi --no-publish -b dev

    WARNING: This will update the version in ‘aito/__init__’ file. DO NOT commit this to Git!

  • The built wheel should be at `dist/`. To install:

    $ pip install dist/aitoai-<version>.whl
  • To test the built package, create an environment variable `TEST_BUILT_PACKAGE` and run the above tests

  1. Test the documentation:

  • To test the inline documentation:

    $ python -m tests -v suite inline_docs
  • To test the code blocks in rst files:

    $ cd docs
    $ curl -o reddit_sample.csv https://raw.githubusercontent.com/AitoDotAI/kickstart/master/reddit_sample.csv
    $ export SPHINX_DISABLE_MOCK_REQUIREMENTS=TRUE
    $ make doctest

Contributing

  1. Making changes

  2. Add unittest to the appropriate test suite (e.g: test case for Aito Schema: tests/sdk/test_aito_schema.py) or create a new test suite inside the tests folder

  3. Add documentation:

  • Inline documentation if applicable

  • Update .rst file in docs/source folder (e.g: Add a new Client function to docs/source/sdk.rst)

  1. Add inline doc test if applicable (e.g: inline doc test for Aito Client: tests/inline_docs/test_client_inline_docs.py)

  1. Update the version in aito/__init__ to e.g. ‘1.2.3rc1’ and write release notes in docs/changelog.rst

  2. Check CircleCI and issue a PR

  3. Deploy to production (scripts/deploy) with the appropriate version after the PR is reviewed

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

aitoai-0.5.3.tar.gz (53.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aitoai-0.5.3-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

File details

Details for the file aitoai-0.5.3.tar.gz.

File metadata

  • Download URL: aitoai-0.5.3.tar.gz
  • Upload date:
  • Size: 53.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for aitoai-0.5.3.tar.gz
Algorithm Hash digest
SHA256 b5e8d2e98b3f57965376d6e6a0578eb8f886622098e654e4abd06c180eea89a5
MD5 6867e140f6cea0ed6684e7d213dd4ca2
BLAKE2b-256 27b493a5ee01f910ea4786f441de4b81082da8ffc9e298d710e0ddfc144bbd6e

See more details on using hashes here.

File details

Details for the file aitoai-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: aitoai-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 63.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for aitoai-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ee38b0c3c893c874b1cc99c820f7805eb508f5ce461205598f1308e395a55763
MD5 d811b2e510a8d00ae8da7548f289ba0c
BLAKE2b-256 f59353da835c21c98f75842ffe23f735398a82f5fd4c69b3db4f475b95711cac

See more details on using hashes here.

Supported by

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