Auto_connect_mongo
A Python package for connecting to MongoDB and performing basic CRUD operations.
Installation
pip install Auto_connect_mongo
Or, to install from source:
git clone https://github.com/AnandVadgama/my-py-package.git
cd my-py-package
pip install -r requirements.txt
Usage
Connect to MongoDB
from Auto_connect_mongo.mongo_crud import mongo_operation
client_url = "mongodb+srv://<username>:<password>@cluster0.mongodb.net/"
database_name = "my_database"
collection_name = "my_collection"
mongo_op = mongo_operation(client_url, database_name, collection_name)
Insert a Record
record = {"name": "Alice", "age": 30}
mongo_op.insert_record(record, collection_name)
Find Records
query = {"age": {"$gt": 25}}
results = mongo_op.find_record(query, collection_name)
for doc in results:
print(doc)
Update a Record
query = {"name": "Alice"}
update = {"$set": {"age": 31}}
mongo_op.update_record(query, update, collection_name)
Delete a Record
query = {"name": "Alice"}
mongo_op.delete_record(query, collection_name)
Requirements
- Python 3.7+
- MongoDB instance (local or Atlas)
Testing
pip install -r requirements_dev.txt
pytest
For more details, see the source code or open an issue on GitHub.
Metadata
Release files for Auto-connect-mongo 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| auto_connect_mongo-0.0.8.tar.gz | 3.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| auto_connect_mongo-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.8 kB
Release files / auto_connect_mongo-0.0.8.tar.gz
| Download URL | auto_connect_mongo-0.0.8.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f220fb4b7b0c31113cddc712b2bdbbfe70e02db54c62f0a5bd357443800af4aa
|
|
BLAKE2b-256 checksum How to use checksums |
77faec5a3703d641c4a2b42c70717964eec7609f8f40ec19b663f05b26e247e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Release files / auto_connect_mongo-0.0.8-py3-none-any.whl
| Download URL | auto_connect_mongo-0.0.8-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bd87e0be1006efea4966300303175286d477d88c3611531e23b4119c5d5349c5
|
|
BLAKE2b-256 checksum How to use checksums |
755bde3010177f94705c82f1aba36c595ac1fa5177da7f962fea053dd803eaaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Security for Auto-connect-mongo 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.