{"id":48519525,"url":"https://github.com/amadou-6e/py-docker","last_synced_at":"2026-04-07T20:31:54.369Z","repository":{"id":293912569,"uuid":"984606398","full_name":"amadou-6e/py-docker","owner":"amadou-6e","description":"Docker-DB is a Python library for managing database containers via Docker: supporting fast, scriptable setup of MongoDB, PostgreSQL, MySQL, and SQL Server for development and testing.","archived":false,"fork":false,"pushed_at":"2026-03-02T22:03:07.000Z","size":641,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-03T00:32:45.574Z","etag":null,"topics":["containerization","database","devops","docker","docker-python","mongodb","mysql","pgvector","postgresql","python","sql-server","testing","vector-database","vectorstore","vectorstores"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amadou-6e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-16T07:52:42.000Z","updated_at":"2026-03-02T16:33:19.000Z","dependencies_parsed_at":"2025-05-20T09:26:54.481Z","dependency_job_id":"8a48c111-b43a-4ba2-a2c4-2f4cbf5b33a4","html_url":"https://github.com/amadou-6e/py-docker","commit_stats":null,"previous_names":["amadou-6e/docker-db","amadou-6e/py-dockerdb","amadou-6e/py-docker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amadou-6e/py-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadou-6e%2Fpy-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadou-6e%2Fpy-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadou-6e%2Fpy-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadou-6e%2Fpy-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amadou-6e","download_url":"https://codeload.github.com/amadou-6e/py-docker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amadou-6e%2Fpy-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31528328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["containerization","database","devops","docker","docker-python","mongodb","mysql","pgvector","postgresql","python","sql-server","testing","vector-database","vectorstore","vectorstores"],"created_at":"2026-04-07T20:31:53.525Z","updated_at":"2026-04-07T20:31:54.345Z","avatar_url":"https://github.com/amadou-6e.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# py-dockerdb\n\n*Pythonic Docker database management for notebooks, tutorials, and fast MVPs.*\n\n[![Build](https://img.shields.io/github/actions/workflow/status/amadou-6e/docker-db/cicd.yml?branch=main\u0026label=tests)](https://github.com/amadou-6e/docker-db/actions/workflows/cicd.yml)\n[![PyPI](https://img.shields.io/pypi/v/py-dockerdb)](https://pypi.org/project/py-dockerdb/)\n[![License](https://img.shields.io/badge/license-MIT-lightgrey)](./LICENSE)\n[![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://amadou-6e.github.io/py-docker/introduction.html)\n\n```bash\npip install py-dockerdb\n```\n\n`py-dockerdb` gives you one Python API to create, connect, and clean up Docker\ndatabases: PostgreSQL, MySQL, MongoDB, MSSQL, Redis, Neo4j, and Ollama. It is built\nfor people who teach, demo, and prototype with notebooks and need repeatable local\ndatabases in seconds.\n\nSwitch from PostgreSQL to MongoDB without changing a line of connection code. Test\na pgvector RAG pipeline, then swap to Neo4j for GraphRAG with one config change.\nOr hand every student a pre-seeded database at the start of class without touching\nDocker on their machine.\n\n## When to use this\n\n- **Teaching a SQL workshop:** two lines give every learner a working, pre-seeded\n  database, identical across Windows/Mac/Linux.\n- **Comparing databases for an MVP:** run Postgres, MongoDB, Redis, and Neo4j\n  through the same interface and pick based on behaviour, not setup time.\n- **Local RAG prototype:** spin up pgvector, validate retrieval, swap to another\n  backend in one config change without touching orchestration code.\n- **GraphRAG with Neo4j:** `Neo4jDB.connection` returns a `neo4j.Driver` that\n  plugs directly into LlamaIndex's `Neo4jGraphStore` and LangChain's `Neo4jGraph`.\n\n## Supported Databases\n\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-4169E1?logo=postgresql\u0026logoColor=white)](https://www.postgresql.org/docs/)\n[![MySQL](https://img.shields.io/badge/MySQL-4479A1?logo=mysql\u0026logoColor=white)](https://dev.mysql.com/doc/)\n[![MongoDB](https://img.shields.io/badge/MongoDB-47A248?logo=mongodb\u0026logoColor=white)](https://www.mongodb.com/docs/)\n[![SQL Server](https://img.shields.io/badge/SQL_Server-CC2927?logo=microsoftsqlserver\u0026logoColor=white)](https://learn.microsoft.com/en-us/sql/sql-server/)\n[![Redis](https://img.shields.io/badge/Redis-DC382D?logo=redis\u0026logoColor=white)](https://redis.io/docs/)\n[![Neo4j](https://img.shields.io/badge/Neo4j-008CC1?logo=neo4j\u0026logoColor=white)](https://neo4j.com/docs/)\n[![Ollama](https://img.shields.io/badge/Ollama-000000?logo=ollama\u0026logoColor=white)](https://ollama.com/library)\n\n## Prerequisites\n\n- Python 3.10+ · Docker running\n\n## Installation\n\n```bash\npip install py-dockerdb                # core\npip install \"py-dockerdb[graph]\"       # + Neo4j / LlamaIndex / LangChain\npip install \"py-dockerdb[rag]\"         # + pgvector / LlamaIndex\n```\n\n## Usage\n\nDefine a config, call `create_db()`, run your workload, tear down with `delete_db()`.\n\n### PostgreSQL\n\n```python\nfrom docker_db.dbs.postgres_db import PostgresConfig, PostgresDB\n\ndb = PostgresDB(PostgresConfig(user=\"u\", password=\"p\", database=\"d\", project_name=\"demo\"))\ndb.create_db()\nconn = db.connection          # psycopg2 connection\ncur = conn.cursor()\ncur.execute(\"SELECT version();\")\nprint(cur.fetchone())\ndb.delete_db(running_ok=True)\n```\n\n\n### Neo4j / GraphRAG\n\n```python\nfrom docker_db.dbs.neo4j_db import Neo4jConfig, Neo4jDB\n\ndb = Neo4jDB(Neo4jConfig(password=\"p\", project_name=\"demo\"))\ndb.create_db()\ndriver = db.connection        # neo4j.Driver -\u003e hand to Neo4jGraphStore or Neo4jGraph\nwith driver.session() as s:\n    s.run(\"CREATE (n:Person {name: 'Alice'})\")\n    print(s.run(\"MATCH (n:Person) RETURN n.name\").single()[0])\ndb.delete_db(running_ok=True)\n```\n\n### Ollama\n\n```python\nfrom docker_db.dbs.ollama_db import OllamaConfig, OllamaDB\n\ndb = OllamaDB(OllamaConfig(project_name=\"demo\"))\ndb.create_db()\nsession = db.connection       # requests.Session\ndb.pull_model(\"llama3\")\nresp = session.post(f\"{db.base_url}/api/generate\", json={\"model\": \"llama3\", \"prompt\": \"Hello\", \"stream\": False})\nprint(resp.json()[\"response\"])\ndb.delete_db(running_ok=True)\n```\n\n### More examples\n\nFull runnable notebooks are in [`usage/`](./usage/):\n\n[PostgreSQL](./usage/postgres_example.ipynb) · [MySQL](./usage/mysql_example.ipynb)\n· [MongoDB](./usage/mongo_example.ipynb) · [MSSQL](./usage/mssql_example.ipynb)\n· [Redis](./usage/redis_example.ipynb) · [Neo4j / GraphRAG](./usage/neo4j_example.ipynb)\n· [pgvector RAG](./usage/pgvector_rag_example.ipynb) · [Lifecycle](./usage/db_management_example.ipynb)\n\n## Roadmap\n\n- [x] PostgreSQL + `pgvector`\n- [x] Neo4j\n- [x] Qdrant\n- [ ] Chroma\n- [ ] Weaviate\n- [ ] Milvus\n\n## Development\n\n```bash\ngit clone https://github.com/amadou-6e/docker-db.git\ncd docker-db\npip install -e \".[test]\"\n```\n\n## Testing\n\n```bash\npython -m pytest -vv -s tests/test_manager.py\npython -m pytest -vv -s tests/test_postgres.py\npython -m pytest -vv -s tests/test_postgres_pgvector.py\npython -m pytest -vv -s tests/test_mysql.py\npython -m pytest -vv -s tests/test_mongodb.py\npython -m pytest -vv -s tests/test_mssql.py\npython -m pytest -vv -s tests/test_redis.py\npython -m pytest -vv -s tests/test_cassandra.py\npython -m pytest -vv -s tests/test_neo4j.py\npython -m pytest -vv -s tests/test_opensearch.py\npython -m pytest -vv -s tests/test_qdrant.py\npython -m pytest -vv -s tests/test_ollama.py\npython -m pytest -vv -s tests/test_notebooks.py\n```\n\n## Contributing\n\nPRs welcome. Include tests for behaviour changes and keep notebooks runnable.\n\n## License\n\nMIT License. See `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famadou-6e%2Fpy-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famadou-6e%2Fpy-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famadou-6e%2Fpy-docker/lists"}