{"id":18725572,"url":"https://github.com/reljicd/python-mongodb-object-document-mapper","last_synced_at":"2025-12-30T23:04:47.227Z","repository":{"id":94100415,"uuid":"581859756","full_name":"reljicd/python-mongodb-object-document-mapper","owner":"reljicd","description":"Document Object Mapper for MongoDB written in Python","archived":false,"fork":false,"pushed_at":"2023-01-17T11:53:52.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T18:48:59.393Z","etag":null,"topics":["bash","docker","docker-compose","mongo","mongodb","object-document-mapper","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reljicd.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}},"created_at":"2022-12-24T16:08:02.000Z","updated_at":"2022-12-24T21:49:22.000Z","dependencies_parsed_at":"2023-03-13T17:07:36.320Z","dependency_job_id":null,"html_url":"https://github.com/reljicd/python-mongodb-object-document-mapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reljicd/python-mongodb-object-document-mapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reljicd%2Fpython-mongodb-object-document-mapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reljicd%2Fpython-mongodb-object-document-mapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reljicd%2Fpython-mongodb-object-document-mapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reljicd%2Fpython-mongodb-object-document-mapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reljicd","download_url":"https://codeload.github.com/reljicd/python-mongodb-object-document-mapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reljicd%2Fpython-mongodb-object-document-mapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28133800,"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","status":"online","status_checked_at":"2025-12-30T02:00:05.476Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bash","docker","docker-compose","mongo","mongodb","object-document-mapper","python","python3"],"created_at":"2024-11-07T14:10:50.797Z","updated_at":"2025-12-30T23:04:47.210Z","avatar_url":"https://github.com/reljicd.png","language":"Python","readme":"# MongoDB Object Document Mapper\n\n## About \n\nObject Document Mapper for MongoDB written in Python.\n\n## Prerequisites\n\n\\[Optional\\] Install virtual environment:\n\n```bash\n$\u003e sudo apt install python3-pip\n$\u003e pip3 install virtualenv\n$\u003e python3 -m virtualenv venv\n```\n\nActivate virtual environment:\n\nOn macOS and Linux:\n```bash\n$\u003e source venv/bin/activate\n```\n\nOn Windows:\n```bash\n$\u003e .\\venv\\Scripts\\activate\n```\n\n\\[Optional\\] Install dependencies (in a new virtual environment):\n```bash\n$\u003e pip install -r requirements.txt\n```\n\nAdd project directory to PYTHONPATH\n```bash\n$\u003e export PYTHONPATH=$PYTHONPATH:$(pwd)\n```\n\n## Configuration parameters\n\nConfiguration parameters are passed through environment variables.\n\n* **MONGO_HOST** - Mongo host. Defaults to **localhost**.\n\n* **MONGO_PORT** - Mongo port. Defaults to **27017**.\n\n* **MONGO_USERNAME** - Mongo username. Defaults to empty string.\n\n* **MONGO_PASSWORD** - Mongo password. Defaults to empty string.\n\n* **MONGO_USE_SSL** - Should SSL be used. Defaults to **False**.\n\n* **MONGO_CERT_PATH** - Mongo certificate path. Defaults to empty string.\n\n* **MONGO_USE_REPLICA_SET** - Should replica set be used. Defaults to **False**.\n\n* **DB_CONFIGS** - Path of the databases configuration files in yaml format. Defaults to empty string.\n\n## How to run\n\n### Default\n\n```bash\n$\u003e python ${SERVICE_NAME} ${METHOD_NAME} [parameters...]\n```\n\n#### Helper script\n\nIt is possible to run all the above with helper script:\n\n```bash\n$\u003e chmod +x scripts/activate_venv_and_run_python.sh\n$\u003e scripts/activate_venv_and_run_python.sh ${SERVICE_NAME} ${METHOD_NAME} [parameters...]\n```\n\n### Docker\n\nIt is possible to run application using Docker:\n\nBuild Docker image:\n```bash\n$\u003e docker build -t mongo_odm -f docker/Dockerfile .\n```\n\nRun Docker container:\n```bash\n$\u003e docker run --rm -t \\\n        -e MONGO_HOST=${MONGO_HOST} \\\n        -e MONGO_PORT=${MONGO_PORT} \\\n        mongo_odm ${SERVICE_NAME} ${METHOD_NAME} [parameters...]\n```\n\n#### Docker helper script\n\nIt is possible to run all the above with helper script:\n\n```bash\n$\u003e chmod +x scripts/run_docker.sh\n$\u003e scripts/run_docker.sh ${SERVICE_NAME} ${METHOD_NAME} [parameters...]\n```\n\n## Tests\n\n### Default\n\n```bash\n$\u003e python -m pytest tests\n```\n\n#### Helper script\n\nIt is possible to run all the above with helper script:\n\n```bash\n$\u003e chmod +x scripts/activate_venv_and_run_python.sh\n$\u003e scripts/activate_venv_and_run_python.sh -m pytest tests\n```\n\n#### PyCharm\n\n- You can run individual tests from PyCharm by simply right-clicking a test file, and choosing \"Run 'pytest in ...''\".\n- A test may not work yet on the first try, because the Working directory needs to be adjusted. Go to `Run \u003e Edit Configurations...`. Now select the corresponding run configuration, and set the `Working directory` field to the root directory of the python-mongodb-object-document-mapper project. \n\n\n### Docker\n\nIt is possible to run application using Docker:\n\nBuild Docker image:\n```bash\n$\u003e docker build -t mongo_odm -f docker/Dockerfile .\n```\n\n\\[Optional\\] Build MongoDB:\n```bash\n$\u003e docker run --name mongo_db -p 27017:27017 -d mongo\n```\n\nRun Docker container, and specify MongoDB and PostgreSQL credentials:\n```bash\n$\u003e docker run --rm -t \\\n        -e MONGO_HOST=${MONGO_HOST} \\\n        -e MONGO_PORT=${MONGO_PORT} \\\n        mongo_odm -m pytest /tests\n```\n\n#### Docker helper script\n\nIt is possible to run all the above with helper script:\n\n```bash\n$\u003e chmod +x scripts/run_docker.sh\n$\u003e scripts/run_docker.sh -m pytest /tests\n```\n\n### Docker Compose\n\nIt is possible to run application using Docker Compose which includes both **python-mongodb-object-document-mapper** and **mongo**:\n\nBuild Docker Compose images:\n```bash\n$\u003e docker-compose -f docker/docker-compose.yml build\n```\n\nRun Docker Compose containers:\n```bash\n$\u003e docker-compose -f docker/docker-compose.yml run --rm \\\n       --name ${CONTAINER_NAME} \\\n       ${CONTAINER_NAME} -m pytest /tests\n```\n\n#### Docker Compose helper script\n\nIt is possible to run all the above with helper script:\n\n```bash\n$\u003e chmod +x scripts/run_docker.sh\n$\u003e scripts/run_tests_using_docker_compose.sh\n```\n\n## License\n\nLicensed under the\n[Apache 2.0](https://github.com/google/python-fire/blob/master/LICENSE) License.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freljicd%2Fpython-mongodb-object-document-mapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freljicd%2Fpython-mongodb-object-document-mapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freljicd%2Fpython-mongodb-object-document-mapper/lists"}