{"id":21797,"library":"pystardog","title":"PyStardog","description":"Python client for Stardog Knowledge Graph Platform endpoints and Stardog Cloud. Current version 0.20.0, requires Python >=3.9. Release cadence is irregular; breaking changes occur between minor versions.","status":"active","version":"0.20.0","language":"python","source_language":"en","source_url":"https://github.com/stardog-union/pystardog","tags":["stardog","knowledge-graph","sparql","rdf","database-client"],"install":[{"cmd":"pip install pystardog","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"pystardog is a module; the main class is Stardog.","wrong":"import pystardog","symbol":"Stardog","correct":"from pystardog import Stardog"},{"note":"Exceptions are in the exceptions submodule.","wrong":"from pystardog import ConnectionException","symbol":"ConnectionException","correct":"from pystardog.exceptions import ConnectionException"}],"quickstart":{"code":"from pystardog import Stardog\n\nsd = Stardog(endpoint=os.environ.get('STARDOG_ENDPOINT', 'http://localhost:5820'))\n# Authentication optional\n# sd.set_credentials('admin', 'admin')\ndb = sd.database('myDB')\nprint(db.size())","lang":"python","description":"Connect to a Stardog server and get database size. Uses environment variable for endpoint; adjust credentials as needed."},"warnings":[{"fix":"Use `ssl_config=SSLConfig(...)` instead of `ssl=True/False`.","message":"In version 0.17.0, the `Stardog` constructor changed from `Stardog(endpoint=..., ..., ssl=...)` to `Stardog(endpoint=..., ssl_config=...)`. Old `ssl` parameter is removed.","severity":"breaking","affected_versions":">=0.17.0"},{"fix":"Use `result = db.query('...'); rows = result.results`.","message":"In version 0.18.0, `database.query()` no longer returns raw results by default; returns `QueryResult` object. Access via `result.results`.","severity":"breaking","affected_versions":">=0.18.0"},{"fix":"Use `sd.databases().get('myDB')` instead.","message":"`Stardog.database(name)` is deprecated in favor of `Stardog.databases().get(name)`.","severity":"deprecated","affected_versions":">=0.20.0, <1.0"},{"fix":"`Stardog(endpoint=..., timeout=120)`","message":"Default timeout is 30 seconds; long-running SPARQL queries may timeout. Set custom timeout when constructing Stardog client.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `from pystardog import Stardog`.","cause":"Wrong import: `import pystardog` instead of `from pystardog import Stardog`.","error":"AttributeError: module 'pystardog' has no attribute 'Stardog'"},{"fix":"Verify endpoint URL and SSL config. For local server use `http://localhost:5820`.","cause":"Stardog server not running, wrong endpoint, or SSL misconfiguration.","error":"pystardog.exceptions.ConnectionException: Unable to connect to Stardog"},{"fix":"Use `ssl_config=SSLConfig(...)` instead.","cause":"Using old `ssl` parameter which was removed in 0.17.0.","error":"TypeError: __init__() got an unexpected keyword argument 'ssl'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}