django-urlid-graph


Namedjango-urlid-graph JSON
Version 0.5.9 PyPI version JSON
download
home_pagehttps://github.com/PythonicCafe/django-urlid-graph/
SummaryDjango-based API to serve URLid + graph database
upload_time2024-01-15 06:54:56
maintainer
docs_urlNone
authorÁlvaro Justen
requires_python>=3.7
licenseGNU Lesser General Public License v3 (LGPLv3)
keywords graph data database api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # django-urlid-graph

Django-based API to serve URLid + graph database.
This repository hosts the app code and also a project structure so it's easier
to develop - only the `urlid_graph` folder is packaged before [going to
PyPI](https://pypi.org/project/django-urlid-graph).


## Installation and configuration

1. Add "urlid_graph" to your `INSTALLED_APPS` setting like this:

```python
INSTALLED_APPS = [
    ...
    "urlid_graph",
]
```

2. Change database configurations (this example uses
   [python-decouple](https://github.com/henriquebastos/python-decouple)):

```python
DATABASE_URL = config("DATABASE_URL")  # must be set
GRAPH_DATABASE_URL = config("GRAPH_DATABASE_URL")  # must be set
graph_config = config("GRAPH_DATABASE_URL", cast=db_url)
GRAPH_DATABASE = graph_config["NAME"]  # must be set
DATABASES = {
    "default": config("DATABASE_URL", cast=db_url),
    GRAPH_DATABASE: graph_config,  # must set this way
}
DATABASE_ROUTERS = ["urlid_graph.db_router.RelationAndGraphDBRouter"]
```

3. Configure Django caching system (used to store `ElementConfig` labels):

```python
CACHES = {
    "default": {
        "BACKEND": "django.core.cache.backends.locmem.LocMemCache",
        "TIMEOUT": 24 * 3600,
        "MAX_ENTRIES": 1024,
    }
}
```

4. Include the `urlid_graph` URLconf in your project's `urls.py` like this:

```python
    path('v1/', include("urlid_graph.urls")),
```

5. Run `python manage.py migrate` to create the needed models, triggers etc.

6. Populate the database:

```shell
# you may want to add entities to urlid_graph_entity model
python manage.py import_config data/config.csv  # must create this file before
```


## Importing data

```shell
python manage.py import_objects appname Model file.csv[.gz|.xz]
python manage.py import_relationship relname file.csv[.gz|.xz]
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/PythonicCafe/django-urlid-graph/",
    "name": "django-urlid-graph",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "graph data database api",
    "author": "\u00c1lvaro Justen",
    "author_email": "alvarojusten@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/db/09/dd00f7282883fa6ec5487f47eb099f04533bf5b63b9b6a086dc26e2e95a9/django-urlid-graph-0.5.9.tar.gz",
    "platform": null,
    "description": "# django-urlid-graph\n\nDjango-based API to serve URLid + graph database.\nThis repository hosts the app code and also a project structure so it's easier\nto develop - only the `urlid_graph` folder is packaged before [going to\nPyPI](https://pypi.org/project/django-urlid-graph).\n\n\n## Installation and configuration\n\n1. Add \"urlid_graph\" to your `INSTALLED_APPS` setting like this:\n\n```python\nINSTALLED_APPS = [\n    ...\n    \"urlid_graph\",\n]\n```\n\n2. Change database configurations (this example uses\n   [python-decouple](https://github.com/henriquebastos/python-decouple)):\n\n```python\nDATABASE_URL = config(\"DATABASE_URL\")  # must be set\nGRAPH_DATABASE_URL = config(\"GRAPH_DATABASE_URL\")  # must be set\ngraph_config = config(\"GRAPH_DATABASE_URL\", cast=db_url)\nGRAPH_DATABASE = graph_config[\"NAME\"]  # must be set\nDATABASES = {\n    \"default\": config(\"DATABASE_URL\", cast=db_url),\n    GRAPH_DATABASE: graph_config,  # must set this way\n}\nDATABASE_ROUTERS = [\"urlid_graph.db_router.RelationAndGraphDBRouter\"]\n```\n\n3. Configure Django caching system (used to store `ElementConfig` labels):\n\n```python\nCACHES = {\n    \"default\": {\n        \"BACKEND\": \"django.core.cache.backends.locmem.LocMemCache\",\n        \"TIMEOUT\": 24 * 3600,\n        \"MAX_ENTRIES\": 1024,\n    }\n}\n```\n\n4. Include the `urlid_graph` URLconf in your project's `urls.py` like this:\n\n```python\n    path('v1/', include(\"urlid_graph.urls\")),\n```\n\n5. Run `python manage.py migrate` to create the needed models, triggers etc.\n\n6. Populate the database:\n\n```shell\n# you may want to add entities to urlid_graph_entity model\npython manage.py import_config data/config.csv  # must create this file before\n```\n\n\n## Importing data\n\n```shell\npython manage.py import_objects appname Model file.csv[.gz|.xz]\npython manage.py import_relationship relname file.csv[.gz|.xz]\n```\n",
    "bugtrack_url": null,
    "license": "GNU Lesser General Public License v3 (LGPLv3)",
    "summary": "Django-based API to serve URLid + graph database",
    "version": "0.5.9",
    "project_urls": {
        "Homepage": "https://github.com/PythonicCafe/django-urlid-graph/"
    },
    "split_keywords": [
        "graph",
        "data",
        "database",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "db09dd00f7282883fa6ec5487f47eb099f04533bf5b63b9b6a086dc26e2e95a9",
                "md5": "70433f81d46ab025c4091139dd334ae1",
                "sha256": "186ced72d65b2962965ce63032a5dfb7a0ca3f24c8bbfe4faf818691ff9b1201"
            },
            "downloads": -1,
            "filename": "django-urlid-graph-0.5.9.tar.gz",
            "has_sig": false,
            "md5_digest": "70433f81d46ab025c4091139dd334ae1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 33151,
            "upload_time": "2024-01-15T06:54:56",
            "upload_time_iso_8601": "2024-01-15T06:54:56.331001Z",
            "url": "https://files.pythonhosted.org/packages/db/09/dd00f7282883fa6ec5487f47eb099f04533bf5b63b9b6a086dc26e2e95a9/django-urlid-graph-0.5.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-15 06:54:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PythonicCafe",
    "github_project": "django-urlid-graph",
    "github_not_found": true,
    "lcname": "django-urlid-graph"
}
        
Elapsed time: 0.44905s