Skip to main content

This API was created to operate the TuxDB processes with Python Programming Language.

Project description

Tuxpy

Tuxpy is an API. It is developed to run processes located in Tuxdb with Python Programming Language.

Install: $ pip install tuxpy

API

Tuxpy contains 3 modules. These are client, database and collection.

  1. client

    Import Notation: import tuxpy.client

    • class tuxpy.client.Client(host="127.0.0.1", port=6060)

      It's a constructor method that connects to the Tuxdb.

      parameters description
      host: str This parameter specifies which host address to connect to. Also host parameter must be the same value as tuxdb's server host value. It is set "127.0.0.1" by default.
      port: int this parameter must be the same value as tuxdb's server port value. It is set 6060 by default.

      Client Class Member Functions

      • getDatabase(databaseName: str) -> tuxpy.database.Database

        This function returns a database object contained in Tuxdb. If there is no database associated with the databaseName parameter, the function creates a new database with the name specified by the databaseName parameter.

        parameters description
        databaseName: str The name of the database to be accessed.
      • getDatabaseNames() -> list

        This function returns a list of all database names contained in the Tuxdb.

  2. database

    Import Notation: import tuxpy.database

    • class tuxpy.database.Database(client: tuxpy.client.Client, databaseName: str)

      This is a constructor method that returns a database object if there is database associated with the name specified by databaseName parameter. If there is no database, the constructor method creates a database with the name specified by databaseName parameter and then returns a database object.

      parameters description
      client: tuxpy.client.Client It's a Client object connected to the Tuxdb.
      databaseName: str The name of the database to be accessed.

      Database Class Member Functions

      • getCollection(collectionName: str) -> tuxpy.collection.Collection

        This function returns a collection object found in the currently used database. If there is no collection associated with the collectionName parameter, the function creates a new collection for the used database with the name specified by the collectionName parameter.

        parameters description
        collectionName: str The name of the collection in the used database.
      • getCollectionNames() -> list

        This function returns a list of all collections found in the currently used database.

      • setDatabaseName(newDatabaseName: str) -> dict

        This function sets the name of used database. Returns a dict that indicates whether the result of the function was successful.

        parameters description
        newDatabaseName: str The new database name instead of the current name of the used database.
      • drop() -> dict

        This function delete the used database from Tuxdb. Returns a dict that indicates whether the result of the function was successful

  3. collection

    Import Notation: import tuxpy.collection

    • class tuxpy.collection.Collection(client: tuxpy.client.Client, databaseName: str, collectionName: str)

      This constructor method returns a collection object found in the database. If there is no collection associated with the collectionName parameter, the function creates a new collection for the database with the name specified by the collectionName parameter.

      parameters description
      client: tuxpy.client.Client It's a Client object connected to the Tuxdb
      databaseName: str The name of the database to be accessed.
      collectionName: str The name of the collection in database to be accessed in the database.

      Client Class Member Functions

      • setCollectionName(newCollectionName: str) -> dict

        This function sets the name of used collection. Returns a dict that indicates whether the result of the function was successful.

        parameters description
        newCollectionName: str The new collection name instead of the current name of the used collection.
      • getAllObjects() -> list

        Returns a list of all objects found in the used collection.

      • findFromObjectId(objectId: str) -> dict

        This function returns a dict of the object content found in the used collection.

        parameters description
        objectId: str The ID of object.
      • findOne(query: dict) -> dict

        This function returns a dict of an object associated the the query.

        parameters description
        query: dict The query to catch the object
      • find(query: dict) -> list

        This function returns a list of the objects associated with the query.

        parameters description
        query: dict The query to catch the objects.
      • insert(data: dict) -> dict

        This function creates a new object into used collection. Returns a dict that indicates whether the result of the function was successful.

        parameters description
        data: dict Content of new object
      • updateFromObjectId(objectId: str, updateData: dict) -> dict

        This function updates a object content associated with the objectId. Returns a dict that indicates whether the result of the function was successful.

        parameters description
        objectId: str The ID of object.
        updateData: dict It contains the names of the elements to be changed and their new values.
      • update(query: dict, updateData: dict) -> dict

        This function updates the objects content associated with the query. Returns a dict that indicates whether the result of the function was successful.

        parameters description
        query: dict The query to catch the objects.
        updateData: dict It contains the names of the elements to be changed and their new values.
      • deleteFromObjectId(objectId: str) -> dict

        This object deletes a object associated with the objectId. Returns a dict that indicates whether the result of the function was successful.

        parameters description
        objectId: str The ID of object.
      • delete(query: dict) -> dict

        This object deletes the objects associated with the query. Returns a dict that indicates whether the result of the function was successful.

        parameters description
        query: dict The query to catch the objects.
      • drop() -> dict

        This function deletes the used collection. Returns a dict that indicates whether the result of the function was successful.

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

tuxpy-1.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

tuxpy-1.1.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file tuxpy-1.1.0.tar.gz.

File metadata

  • Download URL: tuxpy-1.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for tuxpy-1.1.0.tar.gz
Algorithm Hash digest
SHA256 736470c9f9a8da75fd32ef4b384ab94ccd9c678985bddfb8d66444dd99e01d3a
MD5 ac57e4a5003be95502d0d771e62cafd3
BLAKE2b-256 23742b65a2d1c41602eab8a74455a8c8255ca7fdff458c35088389bd6aff0903

See more details on using hashes here.

File details

Details for the file tuxpy-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: tuxpy-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for tuxpy-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2489736aa8c90bd826ca2680aa7eefc7420ff8a026b1b0303959a61b7418b063
MD5 fe8c53549e710f87abde81f379533bf0
BLAKE2b-256 b25ddd4dfd35b353ff56c2e66235021ac4730b7e1591b8343d4b06b5a38e91e2

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