{"id":15102052,"url":"https://github.com/ginkgobioworks/curious","last_synced_at":"2025-12-30T15:24:39.237Z","repository":{"id":36272844,"uuid":"40577312","full_name":"ginkgobioworks/curious","owner":"ginkgobioworks","description":"Graph-based data exploration tool","archived":true,"fork":true,"pushed_at":"2018-04-06T15:38:13.000Z","size":1151,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-12-02T11:54:23.766Z","etag":null,"topics":["django","graph-database","query","query-language","sql"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/curious","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"benjiec/curious","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ginkgobioworks.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-12T03:01:50.000Z","updated_at":"2023-01-28T20:50:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ginkgobioworks/curious","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginkgobioworks%2Fcurious","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginkgobioworks%2Fcurious/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginkgobioworks%2Fcurious/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ginkgobioworks%2Fcurious/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ginkgobioworks","download_url":"https://codeload.github.com/ginkgobioworks/curious/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232242735,"owners_count":18493786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","graph-database","query","query-language","sql"],"created_at":"2024-09-25T18:45:51.549Z","updated_at":"2025-09-27T00:30:47.626Z","avatar_url":"https://github.com/ginkgobioworks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Curious\n=======\n\n.. image:: https://travis-ci.org/ginkgobioworks/curious.svg?branch=master\n    :target: https://travis-ci.org/ginkgobioworks/curious\n\nCurious traverses relationships in a relational database. Curious\nqueries allow users to explore relationships among objects, traverse\nrecursive relationships, and jump between loosely connected databases.\nCurious also provides a JSON interface to the objects. Users and\nprogrammers can use Curious queries in analysis scripts and\napplications.\n\nCurious favors a data centric model of application construction; Curious\nqueries expose normalized, relational data, reducing UI dependency on UI\nspecific API end-points serving denormalized data. Changing what data an\nUI needs no longer requires changing the UI specific end-points.\n\nCurious works well with deep data models with many relationships. A\nCurious query can traverse 10s of foreign key like relationships\nefficiently. Curious queries always operate on sets of objects, and can\nconnect a small number of objects via a relationship to a large number\nof objects, then via another relationship from the large number of\nobjects to a smaller set again. For example, Book to Authors to Country\nof Residence. Unlike GraphQL, Curious outputs relationships between\nobjects, rather than an ever growing tree of JSON representations of the\nobjects.\n\nExample\n-------\n\n::\n\n    Book.last(10) Book.author_set Author.country(continent__name=\"North America\")\n\nQuery Language\n--------------\n\nThe query language allows traversing models by identfying the relationships between them,\nthrough foreign keys in Django models, or arbitrary id-mapping functions. A Curious query\nis a space-separated set of terms, which connect models together by relationships.\n\nSeveral kinds of \"joins\" are possible using these relationship primitives:\n\n- A traditional `inner join` ``Book Book.author_set``\n- A `left outer join`: ``Book.last(10) ?(Book.author_set)``\n- A `recusrive join`: ``Parent.children_*``\n\nFurthermore, at each stage in a join, `filtering` can happen:\n\n- Filtering by `Django field lookups`_: ``Book Book.author_set(id__in=[2,3,4])``\n- Filtering by `subquery`: ``Book +(Book.author_set(id__in=[2,3,4]))``\n- Filtering by `exclusive subquery` ``Book -(Book.author_set(id__in=[2,3,4]))``\n\nFinally, relationships can generate `counts`:\n\n- Counting ``Book Book.author_set__count``\n\n.. _Django field lookups: https://docs.djangoproject.com/en/1.11/ref/models/querysets/#field-lookups\n\nConfiguring Curious\n-------------------\n\n::\n\n    import myapp.models\n    from curious import model_registry\n\n    def register():\n      model_registry.register(myapp.models)\n\nThen include ``register`` when your Django app boots up.\n\nUsing Curious\n-------------\n\nTurn off CSRF. Deploy it as a Django app.\n\nWriting Customized Relationships\n--------------------------------\n\nUse filter and deferred to real functions.\n\nDevelopment\n-----------\n\nRequires Docker. Spin up your container using the provided ``docker-compose.yml`` file and Makefile\nby running ``make image``. This creates an image with a correct git configuration for your user,\nwhich makes it easy to release. All of the commands you should need to run are defined the\n``Makefile`` as targets. All of the targets except for ``image``, are meant to be run inside the\nDocker container, but can be run from the host machine by having ``-ext`` appended to them. For\nexample, to run tests, you could either call ``make test`` from inside the container, or ``make\ntest-ext`` from the host.\n\nIf you are modifying the static assets during development, they can be recompiled with the\n``build_assets`` make task, or by calling ``python setup.py build_assets``.\n\n::\n\n    ./make test-ext\n\n\nDeployment\n----------\n\nDeployment of tagged commits happens to PyPI automatically via Travis CI. To bump and deploy a new\nversion, run ``make bump/[foo]-ext``, where ``[foo]`` is ``major``, ``minor``, or ``patch``. Then\n``git push origin --tags master``.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fginkgobioworks%2Fcurious","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fginkgobioworks%2Fcurious","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fginkgobioworks%2Fcurious/lists"}