Skip to main content

The dconnector Python package provides a streamlined interface for connecting to MongoDB databases using the MongoDBConnection class in Streamlit Projects. This class encapsulates common MongoDB operations, such as querying, inserting, updating, and deleting documents, and provides a convenient way to interact with MongoDB collections using pandas DataFrames.

Project description

The dconnector Python package facilitates MongoDB database interactions through the MongoDBConnection class. This class extends streamlit.connections.ExperimentalBaseConnection and integrates with the pymongo library to offer a comprehensive set of functionalities for working with MongoDB collections. Users can establish connections by specifying the MongoDB connection string, database name, and collection name, either through explicit parameters or by relying on stored secrets.

The provided methods cover a wide range of MongoDB operations, including querying documents based on filters, retrieving all documents, finding a single document, and executing custom queries. The package supports caching mechanisms to enhance performance, allowing users to set time-to-live values for cached results.

In addition to query operations, the MongoDBConnection class supports document insertion, either for a single document or multiple documents in a batch. Users can also update and delete documents based on specified queries. The class further provides methods for counting documents, retrieving distinct values for a given field, and paginating through the collection.

To ensure flexibility, the class exposes several optional keyword arguments for each operation, allowing users to customize their MongoDB queries. The pandas library is leveraged to convert query results into easily manipulable DataFrames, simplifying data analysis and manipulation tasks.

This package aims to streamline MongoDB interactions within Python applications, offering an abstraction layer that balances ease of use with robust functionality.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dconnector-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dconnector-0.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file dconnector-0.1.0.tar.gz.

File metadata

  • Download URL: dconnector-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for dconnector-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0996c9d6622332527706f361e178da54bda1b5101f62ee3f7cb5f9b0792ed6c8
MD5 3a86b0e9ab873053f999fad5fda7082e
BLAKE2b-256 fc77722793fb7d04173921d0d7a8a38356e8ebc7e26a4e516219103dbc07dd27

See more details on using hashes here.

File details

Details for the file dconnector-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dconnector-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for dconnector-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2910af50326d974e5a34043baaf3b5328a1413601c2b1ca51b7245e93091bbbb
MD5 fe1cced27867b8cdced3f578c864e623
BLAKE2b-256 3e85f1df0e59e4eb1549f8c23854847ebec0b09c291ac8c257265b42a49a3694

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page