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
Dependencies
The following are dependencies need to properly run Codex
- docker (https://docs.docker.com/get-docker/)
- docker-compose (https://docs.docker.com/compose/install/)
- python3.6+ (https://www.python.org/downloads/)
Installing Codex
Codex is compatible with Python 3.6 or later. The simplest way to install Codex and its dependencies is by...
git clone https://github.com/banjtheman/grakn-codex.git
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
codexkg.create_db("tech_example")
#Load data into Grakn
codexkg.create_entity(df, "Company", entity_key="name")
# Find Company that has a name equal to Google
ans = codexkg.find(
concept="Company",
concept_attrs=["name"],
concept_conds=["equals"],
concept_values=["Google"],
)
#Display data as a DataFrame
logging.info(ans)
# {'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 codex_st.py
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file grakn_codex-0.0.3.tar.gz
.
File metadata
- Download URL: grakn_codex-0.0.3.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30a7c3ad6b5eeaae5d1756a24a06e963e8b17d373300030c68881466bf561421 |
|
MD5 | eaf7d0ea72caceb67703b74c77d30c53 |
|
BLAKE2b-256 | 064d51e4205e6845b2ff92d4eedcf1bbda050db0785ac5c272725a220e6e8dd2 |
File details
Details for the file grakn_codex-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: grakn_codex-0.0.3-py3-none-any.whl
- Upload date:
- Size: 27.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41f940a153e149fdbfa35966fcfe3450a5dedc5b34ed1e6d48d0e3f87d6c04c0 |
|
MD5 | 27ee71551c3a8e1a0981bf99d0ad33bb |
|
BLAKE2b-256 | bf7194888fee9b33b1f93b102ea95fac9c3d5326d8686492f67348ec679f1606 |