{"id":16570239,"url":"https://github.com/hadisfr/python-sqlserver-macos-sample","last_synced_at":"2026-04-14T23:34:36.040Z","repository":{"id":112569222,"uuid":"152871710","full_name":"hadisfr/python-sqlserver-macos-sample","owner":"hadisfr","description":"Create Python apps using SQL Server on macOS","archived":false,"fork":false,"pushed_at":"2018-12-16T14:02:19.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T12:48:04.228Z","etag":null,"topics":["macos","mssql","osx","python","sqlserver","sqlserver-2017"],"latest_commit_sha":null,"homepage":"https://www.microsoft.com/en-us/sql-server/developer-get-started/python/mac/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hadisfr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2018-10-13T12:52:59.000Z","updated_at":"2018-12-16T14:02:21.000Z","dependencies_parsed_at":"2023-05-16T08:45:30.311Z","dependency_job_id":null,"html_url":"https://github.com/hadisfr/python-sqlserver-macos-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hadisfr/python-sqlserver-macos-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadisfr%2Fpython-sqlserver-macos-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadisfr%2Fpython-sqlserver-macos-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadisfr%2Fpython-sqlserver-macos-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadisfr%2Fpython-sqlserver-macos-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hadisfr","download_url":"https://codeload.github.com/hadisfr/python-sqlserver-macos-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadisfr%2Fpython-sqlserver-macos-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31819951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: 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":["macos","mssql","osx","python","sqlserver","sqlserver-2017"],"created_at":"2024-10-11T21:18:08.918Z","updated_at":"2026-04-14T23:34:36.022Z","avatar_url":"https://github.com/hadisfr.png","language":"Python","readme":"# Create Python apps using SQL Server on macOS\n\n## Preparation\n\n### Docker\n\nIt's possible to install Docker using HomeBrew. You need _docker_ and _docker-machine_, and _VirtualBox_ to run docker.\n\n```bash\nbrew cask install VirtualBox\nbrew install docker-machine\nbrew install docker\n```\n\nThen, you should create a VM and start `docker-machine`.\nConfigure at least 4GB of memory for your Docker environment, also consider adding multiple cores if you want to evaluate performance.\nYou may need to add the last line to your _~/.bash_profile_.\n```bash\ndocker-machine create -d virtualbox --virtualbox-memory 4096  --cpus 2 default\ndocker-machine start\neval $(docker-machine env default)\n```\n\nYou can use the following to run docker-machine daemon on start up:\n```bash\nbrew services start docker-machine\n```\n\nIt's possible to modify VM's characteristics while it's not running:\n```bash\ndocker-machine stop\nVBoxManage modifyvm default --cpus 2\ndocker-machine start\n```\n\n### Python\n\nIt's possible to install python using HomeBrew:\n```bash\nbrew install python\n```\n\n### Appendix: Install HomeBrew\n\n```bash\nruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n```\n\n## Install and Run\n\n### Get and Run Docker Image\n\n```bash\ndocker pull microsoft/mssql-server-linux:2017-latest\ndocker run -e 'HOMEBREW_NO_ENV_FILTERING=1' -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -d microsoft/mssql-server-linux\n```\n\nDB username will be `SA` (case-insensitive) and password will be what you pass as `SA_PASSWORD`. You can chose the edition by passing `MSSQL_PID`,too [[+](https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-configure-docker?view=sql-server-2017#production)]. By default, developer edition will be run.\n\nYou can ensure the success of installation by running `docker images`, after `docker pull`. \n\nThe exposed port will be exposed to docker-machine, not host (your machine). You should use it's IP instead, where needed. You can find the IP by `docker-machine ip`. It's noticeable that the IP will be change whenever docker-machine starts.\n\nYou can check the docker using lightweight _hello-world_ web server:\n```bash\ndocker pull crccheck/hello-world\ndocker run -d --name web-test -p 80:8000 crccheck/hello-world\ncurl $(docker-machine ip):80\n```\n\n### ODBC Driver and SQL Command Line Utility\n\nIt's possible to install these utilities by HomeBrew, too:\n```bash\nbrew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release\nbrew update\nHOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=y brew install --no-sandbox msodbcsql17 mssql-tools\n```\n\nNow, you can use `sqlcmd` to communicate with DB server. Try:\n```bash\nsqlcmd -S $(docker-machine ip),1433 -U sa -P 'yourStrong(!)Password' -Q \"SELECT @@VERSION\"\n```\n\nYou can use a CLI by:\n```bash\nsqlcmd -S $(docker-machine ip),1433 -U sa -P 'yourStrong(!)Password'\n```\n\n### Python\n\nYou can install python wrapper for ODBC by `pip`:\n```bash\npip install pyodbc\n```\n\nYou should add the following line to your code because of [a bug in MS SQL Server](https://github.com/Microsoft/homebrew-mssql-release/issues/18#issuecomment-397420786).\n```python\nlocale.setlocale(locale.LC_CTYPE, \"C\")\n```\n\n## More Complicated Python Program\n\nSee [**Create Python apps using SQL Server on macOS** at Microsoft Get started with SQL Server](https://www.microsoft.com/en-us/sql-server/developer-get-started/python/mac/).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadisfr%2Fpython-sqlserver-macos-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhadisfr%2Fpython-sqlserver-macos-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadisfr%2Fpython-sqlserver-macos-sample/lists"}