{"id":46558,"date":"2017-09-21T00:00:00","date_gmt":"2017-09-21T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/using-griddbs-cpythonruby-apis\/"},"modified":"2025-11-13T12:54:29","modified_gmt":"2025-11-13T20:54:29","slug":"using-griddbs-cpythonruby-apis","status":"publish","type":"post","link":"https:\/\/www.griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/","title":{"rendered":"Using GridDB&#8217;s C\/Python\/Ruby APIs"},"content":{"rendered":"<h2>Introduction {#blog-intro} Most databases today have support for many frameworks and programming languages. Some of the commonly supported languages are Java, C, Ruby, and Python. GridDB is no different. GridDB now provides toolkits to developers with APIs to C, Python, and Ruby programming languages.<\/h2>\n<h3 id=\"c-intro\">Setting Up the C API<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2017\/09\/dreamstime_xs_55515590.jpg\" alt=\"C lang\" class=\"aligncenter\" \/> GridDB&#8217;s C client API has support for <strong>CentOS 6.7<\/strong> and <strong>CentOS 7.3<\/strong>. The client is compatible <strong>gcc version-4.8.5<\/strong> and can be used with either Community or Standard edition. The C client&#8217;s Standard Edition version supports all the functionality as its Java counterpart with support for Geometry columns and operations etc. The files and instructions to setup the C client for Community Edition can all be found on the <a href=\"https:\/\/github.com\/griddb\/c_client\" target=\"_blank\" title=\"C client\" rel=\"noopener noreferrer\">GridDB Github page<\/a> If for some reason, either the <code>configure<\/code> or <code>bootstrap.sh<\/code> scripts throw errors, install the following libraries with these commands.<\/p>\n<pre class=\"prettyprint\">$ sudo yum groupinstall &lsquo;Development Tools'\n$ sudo yum makecache fast\n<\/pre>\n<p>When running the<\/p>\n<p><code>make<\/code> command, if the error **<em>recursive error<\/em> is thrown, a quick fix is to ensure the above libraries are installed. Then remove the <em>c_client<\/em> directory by obtaining and cloning a new one from <a href=\"https:\/\/github.com\/griddb\/c_client\" target=\"_blank\" title=\"GridDB C Client\" rel=\"noopener noreferrer\">Github C repository<\/a>. From there you can test the client by running a few sample programs provided in the c_client repository to test the client and your GridDB connection. Some things to note about compiling and linking C client files with GridDB. When compiling with <code>gcc<\/code>, the include <code>(-I)<\/code> flag should point to an <code>include<\/code> directory with the <code>gridstore.h<\/code> file. The library, or <code>(-L)<\/code> flag should always point to the <em>bin<\/em> directory in the c-client folder that has <code>.so<\/code> file and symbolic links.<\/p>\n<pre class=\"prettyprint\">$ ls c_client\/bin\nlibgridstore.so\nlibgridstore.so.0\nlibgridstore.so.0.0.0\n<\/pre>\n<p>You should use the<\/p>\n<p><code>-lgridstore<\/code> option as well to successfully compile the file. Also for your compiled executables to successfully run, the environment variable known as <code>LD_LIBRARY_PATH<\/code> needs to be set. This variable needs to point to the <code>bin<\/code> folder in the GridDB C-client directory. Example compilation of a C source code file.<\/p>\n<pre class=\"prettyprint\">$ export LD_LIBRARY_PATH=\/path\/to\/c_client\/bin\n$ gcc -o cSample cSample.c -I.\/include -L.\/bin -lgridstore\n$ .\/cSample 239.0.0.1 31999 defaultCluster admin admin\n<\/pre>\n<p>A more detailed for the C API reference can be found<\/p>\n<p><a href=\"http:\/\/www.griddb.org\/griddb_nosql\/manual\/GridDB_API_Reference.html#sec-6\" target=\"_blank\" title=\"C API Reference\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<h3>Python\/Ruby API Setup {#python-intro} GridDB gives support for Python 2.6, 2.7, and now Python 3.6. One important thing to successfully build the Python library you will need to have the C client successfully built. You will also need the development kits for Python and Ruby installed as well.<\/h3>\n<pre class=\"prettyprint\">$ sudo yum install ruby-devel\n$ sudo yum install python-devel\n<\/pre>\n<p>You will also need the SWIG and pcre libraries as well. Installation instructions and sample programs can be found at the<\/p>\n<p><a href=\"https:\/\/github.com\/griddb\/griddb_client\" target=\"_blank\" title=\"Python\/Ruby Client\" rel=\"noopener noreferrer\">griddb_client<\/a> page as well. An important thing to know about using the Python or Ruby library is that the C client has to be installed and setup because variables in the client&#8217;s <code>Makefile<\/code> point to the c_client library. If you have the C client setup then your environment variable <code>LD_LIBRARY_PATH<\/code> should be set. You will need this variable&#8217;s value to successfully build the client library files for both Ruby and Python. Simply edit this line in the <strong>Makefile<\/strong>.<\/p>\n<pre class=\"prettyprint\">LDFLAGS = -L\/path\/c_client\/library\/bin -lpthread -lrt -lgridstore\n<\/pre>\n<p>In the Makefile, the default version of Python used is Python 2.6. If you want to use 2.7 or Python 3.6 simply edit line 11 of the<\/p>\n<p><code>Makefile<\/code> so the <code>make<\/code> command can successfully run. Example of changing Makefile Python version from 2.6 to 2.7: Line 11 of <code>Makefile<\/code>:<\/p>\n<pre class=\"prettyprint\">INCLUDES_PYTHON = $(INCLUDES) -I\/usr\/include\/python2.6 ## Before Makefile used (Python 2.6)\n## Change it to\nINCLUDES_PYTHON = $(INCLUDES) -I\/usr\/include\/python2.7 ## After, now uses (Python 2.7)\n<\/pre>\n<p>In your source code, simply import the<\/p>\n<p><code>griddb_python_client<\/code> file so you have access to the gridstore functions. A reference for Python&#8217;s API can be found <a href=\"http:\/\/www.griddb.org\/griddb_client\/PythonAPIReference.htm\" target=\"_blank\" title=\"Python API Reference\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<h3>Ruby API Features {#ruby-intro} When cloning the repository for the GridDB Python client, you will also get all the files needed to build and run the Ruby client as well. GridDB supports Ruby version 1.8 and version 2.4. Details on how to build and run the Ruby client can be found in the<\/h3>\n<p><code>ReadME.md<\/code> of the <a href=\"https:\/\/github.com\/griddb\/griddb_client#user-content-build-and-run\" target=\"_blank\" title=\"Ruby Setup\" rel=\"noopener noreferrer\">griddb_client page<\/a>. Similar rules apply to the Ruby client as the Python client. The one difference is that in your source code simply <code>require<\/code> the <code>&amp;lsquo;griddb_ruby_client'<\/code> which refers to the <code>griddb_ruby_client.so<\/code> file that contains the Ruby client library. A reference for Ruby&#8217;s API can be found <a href=\"http:\/\/www.griddb.org\/griddb_client\/RubyAPIReference.htm\" target=\"_blank\" title=\"Ruby API Reference\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<h2>Connecting to your GridDB Cluster {#connect-intro} For the most part connecting to a GridDB cluster in the C\/Python\/Ruby APIs are similar to connecting to GridDB in the Java API. Create a<\/h2>\n<p><strong>Properties<\/strong> object or similar data structure and fill in the fields with the host, port, and configuration settings of the database you wish to connect to. Then simply use a <code>StoreFactory<\/code> object to fetch a connection with those properties to retrieve a <code>Gridstore<\/code> instance which will represent the connection to GridDB.<\/p>\n<h4 id=\"connect-c\">C<\/h4>\n<pre class=\"prettyprint\">#include \"gridstore.h\"\n\/\/ (snip)\nGSGridStore* gridstore;\nconst GSPropertyEntry properties[] = {\n    {\"notificationAddress\",host},\n    {\"notificationPort\",port},\n    {\"clusterName\",clusterName},\n    {\"user\",username},\n    {\"password\",password}\n};\nsize_t propertyCount = sizeof(properties) \/ sizeof(*properties);\ngsGetGridStore(gsGetDefaultFactory(),properties,propertyCount,&gridstore);\n<\/pre>\n<h4 id=\"connect-python\">Python<\/h4>\n<pre class=\"prettyprint\">#!\/usr\/bin\/python\nimport sys\nimport griddb_python_client\n# (snip)\ngriddb = griddb_python_client\nfactory = griddb.StoreFactory.get_default()\ntry:\n     gridstore = factory.get_store({\n    \"notificationAddress\":host,\n    \"notificationPort\": port,\n    \"clusterName\":cluster,\n    \"user\":user,\n    \"password\":password\n    })\n<\/pre>\n<h4 id=\"connect-ruby\">Ruby<\/h4>\n<pre  class=\"prettyprint\">#!\/usr\/bin\/ruby\n$:.unshift File.dirname(__FILE__)\nrequire 'griddb_ruby_client'\nGriddb = Griddb_ruby_client\nfactory = Griddb::StoreFactory.get_default()\ngridstore = factory.get_store({\n                        \"notificationAddress\"=> ARGV[0],\n                        \"notificationPort\"=> ARGV[1],\n                        \"clusterName\"=> ARGV[2],\n                        \"user\"=> ARGV[3],\n                        \"password\"=> ARGV[4]\n                      }) \n<\/pre>\n<h2>Issuing TQL Queries {#tql-intro} In GridDB&#8217;s C API there are a variety of built-in functions for querying and aggregating rows in a container. For the most part though the simplest and easiest way to make and issue a query to a container is to use a TQL string.<\/h2>\n<p><strong>TQL<\/strong> is GridDB&#8217;s simplified form of SQL querying. The query begins as a TQL string. From there a <em>query<\/em> object is formed by issuing that TQL to a container which can then be fetched to retrieve a resulting set of rows. The resulting <em>row set<\/em> can then be iterated over to get individual row and column values. <em>Aggregation results<\/em> are also retrieved from row sets. This flow is fairly the same for the C, Python, and Ruby APIs.<\/p>\n<h3>TQL Query in C {#tql-c} Like many other querying languages, you can perform<\/h3>\n<p><a href=\"http:\/\/www.griddb.org\/griddb_nosql\/manual\/GridDB_API_Reference.html#sec-3-2-5\" target=\"_blank\" title=\"GridDB String Operations with TQL\" rel=\"noopener noreferrer\">string operations<\/a> like length checking, substring slicing, and pattern recognition with GridDB&#8217;s TQL.<\/p>\n<pre class=\"prettyprint\">Device nextDevice;\nGSQuery* generalQuery;\nGSRowSet* generalRowSet;\n\ngsQuery(collection,  \n\"select * where (SUBSTRING(name,8,3)='r12' OR name LIKE '&#37;LUE&#37;R55_') and CHAR_LENGTH(name) > 4\",  &generalQuery);\n\ngsFetch(generalQuery,GS_FALSE,&generalRowSet);\nprintf(\"Performing a String Operation on Collection ampCollection151 in TQLnn\");\nwhile(gsHasNextRow(generalRowSet)){\n    GSChar timeString[GS_TIME_STRING_SIZE_MAX];\n    gsGetNextRow(generalRowSet,&nextDevice); \/\/ Obtain  row object\n    gsFormatTime(nextDevice.timestamp,timeString,sizeof(timeString)); \/\/ Format timestamp number\n\n    printf(\"Row in collection ampMeter151: Name=%s\",nextDevice.name);\n    printf(\" Amperage = %.2lf\",nextDevice.amperage);\n    printf(\" Count = %d\",nextDevice.count);\n    printf(\" Timestamp = %sn\",timeString);\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre  class=\"prettyprint\">Performing a String Operation on Collection ampCollection151 in TQL\n\nRow in collection ampMeter151: Name=ampMeter12 Amperage = 1.45  \nCount = 3 Timestamp = 2017-09-15T18:13:52.710Z\nRow in collection ampMeter151: Name=BLUESEAMETER555 Amperage = 2.43  \nCount = 5 Timestamp = 2017-09-15T18:13:52.710Z\n<\/pre>\n<h3>Python {#tql-python} With the exception of Geometry-specific queries and functions, TQL can be used to make any query in both the Python and Ruby API. For example, while there are no built-in functions to perform Timeseries aggregations in Python, they can be issued in TQL. These include time-specific queries and functions in GridDB like time-sampling, time-averages, and interpolation.<\/h3>\n<p><strong>TQL Time Query in Python<\/strong><\/p>\n<pre  class=\"prettyprint\">query = timeseries.query(select * where timestamp > TIMESTAMPADD(HOUR,NOW(),-12)&rdquo;)\nrowSet = query.fetch(False)\nwhile rowSet.has_next():\n    rowSet.get_next(row)\n    time = row.get_field_as_timestamp(0)\n    voltage = row.get_field_as_double(2)\n    print(Voltage at timestamp: {0} is {1} volts in Timeseries voltmeter2.&rdquo;.format(time,voltage)\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre  class=\"prettyprint\">Voltage at timestamp: 1505398224644 is 12.34 volts in Timeseries voltmeter2\n<\/pre>\n<h3>Ruby {#tql-ruby} You can also combine certain aggregation functions with time-specific functions in TQL as well.<\/h3>\n<p><strong>Aggregation TQL Query in Ruby<\/strong><\/p>\n<pre  class=\"prettyprint\">update = false\ntimestamp = Griddb::Timestamp.current()\naggCommand = \"select AVG(voltage) from voltmeter502 where timestamp > TIMESTAMPADD(MINUTE, \nTO_TIMESTAMP_MS(#{timestamp}), -10) AND timestamp &lt; TIMESTAMPADD(MINUTE,  \nTO_TIMESTAMP_MS(#{timestamp}), 10)\"\naggQuery = timeseries.query(aggCommand) \naggRowSet = aggQuery.fetch(update)\nwhile aggRowSet.has_next()\n      aggResult = aggRowSet.get_next_aggregation()\n      print \"Aggregation Result from voltmeter502: Average voltage = #{aggResult.get_double()}n\"\nend\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre  class=\"prettyprint\">Aggregation result from voltmeter502: Average voltage = 10.5\n<\/pre>\n<h3>Inserting Collection into GridDB with C API {#insert-collection-c} In C, schemas for containers can be created and updated into GridDB using either static schemas or dynamic schemas. Static schemas come in the form of struct bindings. Dynamic schemas come in the form of<\/h3>\n<p><code>columnInfo<\/code> and <code>containerInfo<\/code> objects that can be used to update or insert containers.<br \/>\n<strong>Creating a Static Schema with a C-Struct<\/strong><\/p>\n<pre  class=\"prettyprint\">typedef struct {\n    const GSChar* name;\n    double amperage;\n    int count;\n    GSTimestamp timestamp;\n} Device; \/\/ Static Column Schema in GridDB C API\n<\/pre>\n<p>To use the struct as a schema for a container in GridDB, you need to create a<\/p>\n<p><em>struct-binding<\/em> for it where you define what is the row-key and explicitly assign a type to each of the fields in the struct.<br \/>\n<strong>Creating a Column Schema from a Struct<\/strong><\/p>\n<pre  class=\"prettyprint\">GS_STRUCT_BINDING(Device,\n    GS_STRUCT_BINDING_KEY(name,GS_TYPE_STRING)\n    GS_STRUCT_BINDING_ELEMENT(amperage,GS_TYPE_DOUBLE)\n    GS_STRUCT_BINDING_ELEMENT(count,GS_TYPE_INTEGER)\n    GS_STRUCT_BINDING_ELEMENT(timestamp,GS_TYPE_TIMESTAMP));\n<\/pre>\n<p>From there once the struct has been bound and made into a row schema it can be used in containers.<\/p>\n<p><strong>Inserting a Struct Binding Schema into a Container<\/strong><\/p>\n<pre  class=\"prettyprint\">GSCollection* collection;\ngsPutCollection(gridstore,\"ampCollection151\",GS_GET_STRUCT_BINDING(Device),NULL,GS_FALSE,&collection);\n<\/pre>\n<p>From there the<\/p>\n<p><code>Device<\/code> struct can be used as a <em>row<\/em> object to fetch and insert rows.<br \/>\n<strong>Inserting a Struct as a GSRow<\/strong><\/p>\n<pre  class=\"prettyprint\">Device insertionDevice;\ninsertionDevice.name = \"ampMeter12\";\ninsertionDevice.amperage = 1.45;\ninsertionDevice.count = 3;\ninsertionDevice.timestamp = gsCurrentTime();\n<\/pre>\n<p><strong>Having a Struct Represent a Row Schema<\/strong><\/p>\n<pre  class=\"prettyprint\">Device device;\nwhile(gsHasNextRow(rowSet)){\n    gsGetNextRow(rowSet,&device);\n    GSChar timeStr[GS_TIME_STRING_SIZE_MAX];\n    gsFormatTime(device.timestamp,timeStr,sizeof(timeStr));\n    printf(\"Device in ampCollection151: \");\n    printf(\"name=%s\",device.name);\n    printf(\" amperage=%.2lf\",device.amperage);\n    printf(\" count=%d\",device.count);\n    printf(\" timestamp=%sn\",timeStr);\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre  class=\"prettyprint\">Device in ampCollection151: name=ampMeter12 amperage=1.45 count=3  \ntimestamp=2017-09-14T20:05:06.285Z\n<\/pre>\n<h3>Python {#timeseries-insert-python} In both Python and Ruby, the approach to creating schemas and inserting containers is similar to the dynamic approach shown with the C API. Simply give your columns and container a name and define their column types. Determine whether they are TimeSeries or Collections and what indexes they should have. The column types available can be found in the<\/h3>\n<p><a href=\"https:\/\/griddb.net\/en\/docs\/documents\/5-1-6_container-schema.php\" target=\"_blank\" title=\"GridDB column types\" rel=\"noopener noreferrer\">GridDB documentation<\/a> and <a href=\"http:\/\/www.griddb.org\/griddb_nosql\/manual\/GridDB_API_Reference.html\" target=\"_blank\" title=\"GridDB API reference\" rel=\"noopener noreferrer\">API references<\/a>.<br \/>\n<strong>Inserting a Timeseries in Python<\/strong><\/p>\n<pre  class=\"prettyprint\">timeseries = gridstore.put_container(\"voltmeter2\",[\n        (\"timestamp\",griddb.GS_TYPE_TIMESTAMP),\n        (\"active\",griddb.GS_TYPE_BOOL),\n        (\"voltage\",griddb.GS_TYPE_DOUBLE)\n        ],griddb.GS_CONTAINER_TIME_SERIES)\n<\/pre>\n<p>In Python since there is no need to explicitly state the types of variables. Row fields can be inserted and fetched a lot more fluidly. All that needs to be known is the column type and index. The created row object will have its row schema set by the container it is based off of. Inserting a row can be done as below.<\/p>\n<p><strong>Inserting a Row in Python<\/strong><\/p>\n<pre  class=\"prettyprint\">## Create rows and set all Row Fields\ninsertionRow = timeseries.create_row()\ninsertionRow.set_field_by_timestamp(0,griddb.Timestamp_add_time(griddb.Timestamp_current(),-6,  \n griddb.GS_TIME_UNIT_HOUR))\n\ninsertionRow.set_field_by_bool(1,True)\ninsertionRow.set_field_by_double(2, 12.34)\n\n## Insert Row into Timeseries\ntimeseries.put_row(insertionRow)\n<\/pre>\n<h3>Ruby {#insert-collection-ruby} The same process is used to create schemas and containers in Ruby as<\/h3>\n<p><a href=\"#timeseries-insert-python\">in Python<\/a>. Simply name the column and set the types and set the type of the container, collection or timeseries.<br \/>\n<strong>Inserting a Collection in Ruby<\/strong><\/p>\n<pre  class=\"prettyprint\">Collection = gridstore.put_container(collection121&rdquo;,[\n{name&rdquo;=>Grid db::GS_TYPE_STRING},\n{status&rdquo;=>Grid db::GS_TYPE_BOOL},\n{count&rdquo;=>Grid db::GS_TYPE_LONG},\n{lob&rdquo;=>Grid db::GS_TYPE_BLOB }\n],CONTAINER_TYPE_COLLECTION)\n<\/pre>\n<p>From there the rows can be fetched, inserted, and updated in the same manner as in Python.<\/p>\n<p><strong>Fetching and Updating Rows in Ruby<\/strong><\/p>\n<pre  class=\"prettyprint\">rowSet.get_next(row)\nname = row.get_field_as_string(0)\nstatus = row.get_field_as_bool(1)\ncount = row.get_field_as_long(2) + 1\nlob = row.get_field_as_blob(3)\nprint \"Row in Collection: collection121, Person: name=#{name} status=#{status} count=#{count} lob=\"\np lob.unpack(\"U*\")\nrow.set_field_as_long(2,count)\nrowSet.update_current(row)\n<\/pre>\n<p><strong>Output<\/strong><\/p>\n<pre  class=\"prettyprint\">Row in Collection: collection121, Person: name=secondRow status=false \n count=6 lob=[65, 66, 67, 68, 69, 70, 71, 72, 73, 74]\n<\/pre>\n<p>As seen from the above examples, interactions with GridDB can be understood and used by many languages. This illustrates how GridDB provides wide support through easy to use APIs, it can be used as a base to create a wide variety of applications.<\/p>\n<h2>Source Code {#source-code} All the code snippets seen here were from sample programs that you can download and run from the link below. There are 3 in total, one in Ruby, one in Python, and one in C. <a  data-e-Disable-Page-Transition=\"true\" class=\"download-link\" title=\"Version 1\" href=\"https:\/\/www.griddb.net\/en\/download\/15753\/?tmstv=1776006380\" rel=\"nofollow\" id=\"download-link-15753\" data-redirect=\"false\" >\n\tapi_samples.tar.gz\t(7613 downloads\t)\n<\/a>\n<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>Introduction {#blog-intro} Most databases today have support for many frameworks and programming languages. Some of the commonly supported languages are Java, C, Ruby, and Python. GridDB is no different. GridDB now provides toolkits to developers with APIs to C, Python, and Ruby programming languages. Setting Up the C API GridDB&#8217;s C client API has support [&hellip;]<\/p>\n","protected":false},"author":123,"featured_media":22052,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46558","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Using GridDB&#039;s C\/Python\/Ruby APIs | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"Introduction {#blog-intro} Most databases today have support for many frameworks and programming languages. Some of the commonly supported languages are\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using GridDB&#039;s C\/Python\/Ruby APIs | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"Introduction {#blog-intro} Most databases today have support for many frameworks and programming languages. Some of the commonly supported languages are\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-09-21T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-13T20:54:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.griddb.net\/wp-content\/uploads\/2017\/09\/blog_title_17.png\" \/>\n\t<meta property=\"og:image:width\" content=\"870\" \/>\n\t<meta property=\"og:image:height\" content=\"490\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Joshua Pascascio\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joshua Pascascio\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/\"},\"author\":{\"name\":\"Joshua Pascascio\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/ca72185e9a3778df765a76313f789fd8\"},\"headline\":\"Using GridDB&#8217;s C\/Python\/Ruby APIs\",\"datePublished\":\"2017-09-21T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:54:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/\"},\"wordCount\":1409,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2017\/09\/blog_title_17.png\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/\",\"url\":\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/\",\"name\":\"Using GridDB's C\/Python\/Ruby APIs | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2017\/09\/blog_title_17.png\",\"datePublished\":\"2017-09-21T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:54:29+00:00\",\"description\":\"Introduction {#blog-intro} Most databases today have support for many frameworks and programming languages. Some of the commonly supported languages are\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2017\/09\/blog_title_17.png\",\"contentUrl\":\"\/wp-content\/uploads\/2017\/09\/blog_title_17.png\",\"width\":870,\"height\":490},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb.net\/en\/#website\",\"url\":\"https:\/\/griddb.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/ca72185e9a3778df765a76313f789fd8\",\"name\":\"Joshua Pascascio\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/872ef8be79cb5117c256feb4c279ac41b954bfba599d647db925185c449aff1c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/872ef8be79cb5117c256feb4c279ac41b954bfba599d647db925185c449aff1c?s=96&d=mm&r=g\",\"caption\":\"Joshua Pascascio\"},\"url\":\"https:\/\/www.griddb.net\/en\/author\/joshua\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using GridDB's C\/Python\/Ruby APIs | GridDB: Open Source Time Series Database for IoT","description":"Introduction {#blog-intro} Most databases today have support for many frameworks and programming languages. Some of the commonly supported languages are","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/","og_locale":"en_US","og_type":"article","og_title":"Using GridDB's C\/Python\/Ruby APIs | GridDB: Open Source Time Series Database for IoT","og_description":"Introduction {#blog-intro} Most databases today have support for many frameworks and programming languages. Some of the commonly supported languages are","og_url":"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2017-09-21T07:00:00+00:00","article_modified_time":"2025-11-13T20:54:29+00:00","og_image":[{"width":870,"height":490,"url":"https:\/\/www.griddb.net\/wp-content\/uploads\/2017\/09\/blog_title_17.png","type":"image\/png"}],"author":"Joshua Pascascio","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"Joshua Pascascio","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/"},"author":{"name":"Joshua Pascascio","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/ca72185e9a3778df765a76313f789fd8"},"headline":"Using GridDB&#8217;s C\/Python\/Ruby APIs","datePublished":"2017-09-21T07:00:00+00:00","dateModified":"2025-11-13T20:54:29+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/"},"wordCount":1409,"commentCount":0,"publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2017\/09\/blog_title_17.png","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/","url":"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/","name":"Using GridDB's C\/Python\/Ruby APIs | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2017\/09\/blog_title_17.png","datePublished":"2017-09-21T07:00:00+00:00","dateModified":"2025-11-13T20:54:29+00:00","description":"Introduction {#blog-intro} Most databases today have support for many frameworks and programming languages. Some of the commonly supported languages are","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#primaryimage","url":"\/wp-content\/uploads\/2017\/09\/blog_title_17.png","contentUrl":"\/wp-content\/uploads\/2017\/09\/blog_title_17.png","width":870,"height":490},{"@type":"WebSite","@id":"https:\/\/griddb.net\/en\/#website","url":"https:\/\/griddb.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/ca72185e9a3778df765a76313f789fd8","name":"Joshua Pascascio","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/872ef8be79cb5117c256feb4c279ac41b954bfba599d647db925185c449aff1c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/872ef8be79cb5117c256feb4c279ac41b954bfba599d647db925185c449aff1c?s=96&d=mm&r=g","caption":"Joshua Pascascio"},"url":"https:\/\/www.griddb.net\/en\/author\/joshua\/"}]}},"_links":{"self":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/users\/123"}],"replies":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/comments?post=46558"}],"version-history":[{"count":1,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46558\/revisions"}],"predecessor-version":[{"id":51250,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46558\/revisions\/51250"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media\/22052"}],"wp:attachment":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media?parent=46558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/categories?post=46558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/tags?post=46558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}