Skip to main content

Codex is a Python package that provides a simple, yet powerful API designed to make working with the Grakn knowledge graph intuitive

Project description

Codex - Programmatic Knowledge Graph Framework

What is Codex

Codex is a Python package that provides a simple, yet powerful API designed to make working with the Grakn knowledge graph intuitive.

Why develop Codex

Building, querying, and interrupting results from the Grakn knowledge graph requires expertise in learning the specific query language graql and learning how to use the verbose API. Codex abstracts away the mundane and tedious aspects of using knowledge graphs, so you can focus on organizing your data and getting answers.

Installing Codex


The following are dependencies need to properly run Codex

Installing Codex

Codex is compatible with Python 3.6 or later. The simplest way to install Codex and its dependencies is by...

git clone 
cd grakn-codex
pip install grakn-codex

In addition to the python package, Codex leverages Grakn and the Redis docker images to store data.

Quick Start

Here's how you can quickly use Codex

Setup Database

mkdir -p data
mkdir -p redis_data
docker-compose up -d

Load and query

import logging
import pandas as pd
from codex import CodexKg 

#Load csv data
df = pd.read_csv("sample_data/tech_companies.csv")

#Make new codex object
codexkg = CodexKg()

#Create new keyspace

#Load data into Grakn
codexkg.create_entity(df, "Company", entity_key="name")

# Find Company that has a name equal to Google
ans = codexkg.find(

#Display data as a DataFrame

# {'Company':      name  budget
#				0  Google  999.99}

For complete documentation on Codex, tutorials and teaching resources, frequently asked questions, and more, please visit our Wiki.

Codex Workbase

Powered by the Codex API and Streamlit you can use a web based GUI to interact with your data.

To start simply run

streamlit run

You can upload data

You can do queries

You can make rules

Contributing to Codex

Codex is an open source project that is supported by a community who will gratefully and humbly accept any contributions you might make to the project. Large or small, any contribution makes a big difference; and if you've never contributed to an open source project before, we hope you will start with Codex!

If you are interested in contributing, here are some of the many ways to contribute:

  • Submit a bug report or feature request on GitHub Issues.
  • Assist us with user testing.
  • Add to the documentation or help with our website,
  • Write unit or integration tests for our project.
  • Answer questions on our issues, mailing list, Stack Overflow, and elsewhere.
  • Translate our documentation into another language.
  • Write a blog post, tweet, or share our project with others.
  • Teach someone how to use Codex.

As you can see, there are lots of ways to get involved and we would be very happy for you to join us! The only thing we ask is that you abide by the principles of openness, respect, and consideration of others as described in the Python Software Foundation Code of Conduct.

Project details

Download files

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

Files for grakn-codex, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size grakn_codex-0.0.3.tar.gz (25.2 kB) File type Source Python version None Upload date Hashes View
Filename, size grakn_codex-0.0.3-py3-none-any.whl (27.9 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page