Streamlit MongoDB Connector
This repository contains the source code for a MongoDB connector developed for the Streamlit Connections Hackathon.
The goal of this project is to showcase how to leverage the power of Streamlit's new st.connection feature to connect Streamlit applications with MongoDB databases, and use this connection in practical applications.
Installation & Usage
The package can be installed via PyPi.
pip3 install st_mongo_connection
and the following is a simple example to use it
import streamlit as st
from st_mongo_connection import MongoDBConnection
connection = st.connection("mongodb", type=MongoDBConnection)
st.help(connection)
# secrets.toml
[connections.mongodb]
url="mongodb+srv://<username>:<password>@<cluster-name>.<cluster-id>.mongodb.net"
database="database-name"
collection="collection-name"
If you want a real example and a detailed implemetation check out the streamlit app.
Overview
The application is divided into three main sections:
-
Connection Demonstration: Shows how the connection to MongoDB has been implemented, demonstrating how data can be retrieved and manipulated.
-
MongoDB Configuration: Demonstrates how to configure the MongoDB connection, explaining how to set it up via the
secrets.tomlfile or directly through thest.connectioncall. -
StreamY: A prototype for a simple text-based social network, where users can post texts on a wall. This showcases the MongoDB connection's use in a practical application, as it's used to store and retrieve posts.
About me
Hello! I'm Moris, a Computer Science Master's graduate with extensive experience in Streamlit and MongoDB. I've developed the MagicLit framework to serve as the base for my company's management app.
I participated in this hackathon to create an optimal component for connecting MongoDB to Streamlit. I hope this project will contribute to the Streamlit community and assist other developers.
Metadata
Release files for st-mongo-connection 1.0.3
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 | Actions |
|---|---|---|---|---|
| st_mongo_connection-1.0.3.tar.gz | 5.4 kB | Without provenance | Details for st_mongo_connection-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| st_mongo_connection-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for st_mongo_connection-1.0.3-py3-none-any.whl |
Total release size: 10.9 kB
Release files / st_mongo_connection-1.0.3.tar.gz
| Download URL | st_mongo_connection-1.0.3.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e434a98a8eccde2a586383df29a3e5a8116f975cea448e5195a3612efea64ce4
|
|
BLAKE2b-256 checksum How to use checksums |
f77b1f727106f9427f48e42c05fcf366e106b88886bf9c9b76e1c576d9ec9073
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.18
|
Release files / st_mongo_connection-1.0.3-py3-none-any.whl
| Download URL | st_mongo_connection-1.0.3-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
510562c4abe6d10a6b4a79379e00f124afde48efc39ee70fde567f18d6bb99d4
|
|
BLAKE2b-256 checksum How to use checksums |
18be9f58cb2f9d0036e1d6b7f9213189e6965ec4ad04626e4040e199dd1553e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.18
|
Security for st-mongo-connection 1.0.3
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.