mongo-operation is a Python library for simplifying MongoDB operations by providing an easy-to-use interface. This library allows users to perform common MongoDB tasks such as creating a client, database, or collection, as well as inserting records into collections and bulk inserting data from CSV or Excel files.
MongoClient Creation: Easily create a MongoDB client with a given URL. Database and Collection Management: Create databases and collections with ease, and automatically handle re-creating them if they already exist. Insertion Operations: Insert records into MongoDB collections, whether it's a single record or bulk data from CSV or Excel files.
python code
from mongodb_connect.mongo_crud import mongo_operation
Initialize MongoDB connection
client_url = "mongodb://localhost:27017/" database_name = "mydatabase" collection_name = "mycollection"
mongo_op = mongo_operation(client_url, database_name, collection_name)
record = {"name": "John", "age": 30} mongo_op.insert_record(record, collection_name)
datafile = "data.csv" mongo_op.bulk_insert(datafile, collection_name)
Python 3.x pandas pymongo ensure
It makes it easier to install and manage dependencies for development and testing, separate from the dependencies required for production.
requirements.txt is used to specify the dependencies required to run the production code of a Python project, while requirements_dev.txt is used to specify the dependencies required for development and testing purposes.
We use if for the testing in the python package testing against different version of the python
- Install depedencies and packages
- Run commands
- Its a combination of the (virtualenvwrapper and makefile)
- It creates a .tox
it is being used for configuration the python project it is a alternative of the setup.cfg file. its containts configuration related to the build system such as the build tool used package name version author license and dependencies
In summary, setup.cfg is used by setuptools to configure the packaging and installation of a Python projec
types of testing
- Automated testing
- Manual testing
Mode of testing
- Unit testing
- Integration tests
Testing frameworks
- pytest
- unittest
- robotframework
- selenium
- behave
- doctest
- pylint
- flake8(it is best because it containt 3 library pylint pycodestyle mccabe)
- pycodestyle
feel free for contribution