fastapi-mongo-setup 0.3.1__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fastapi_mongo_setup-0.3.2/PKG-INFO +82 -0
- fastapi_mongo_setup-0.3.2/README.md +68 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/pyproject.toml +6 -2
- fastapi_mongo_setup-0.3.2/src/fastapi_mongo_setup.egg-info/PKG-INFO +82 -0
- fastapi_mongo_setup-0.3.1/PKG-INFO +0 -35
- fastapi_mongo_setup-0.3.1/README.md +0 -23
- fastapi_mongo_setup-0.3.1/src/fastapi_mongo_setup.egg-info/PKG-INFO +0 -35
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/setup.cfg +0 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/fastapi_mongo_setup.egg-info/SOURCES.txt +0 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/fastapi_mongo_setup.egg-info/dependency_links.txt +0 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/fastapi_mongo_setup.egg-info/entry_points.txt +0 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/fastapi_mongo_setup.egg-info/requires.txt +0 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/fastapi_mongo_setup.egg-info/top_level.txt +0 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/mongo_setup/__init__.py +0 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/mongo_setup/cli.py +0 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/tasks/router.py +0 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/tasks/schemas.py +0 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/tasks/service.py +0 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/utils/db.py +0 -0
- {fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/utils/helpers.py +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fastapi-mongo-setup
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: A CLI tool to auto-generate MongoDB connection boilerplates for FastAPI projects.
|
|
5
|
+
Author-email: Souvik <wbjee.souvik@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/Souvik6222/fastapi-mongo-setup
|
|
7
|
+
Project-URL: Issues, https://github.com/Souvik6222/fastapi-mongo-setup/issues
|
|
8
|
+
Requires-Python: >=3.8
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: motor
|
|
11
|
+
Requires-Dist: python-dotenv
|
|
12
|
+
Requires-Dist: fastapi
|
|
13
|
+
Requires-Dist: pydantic-settings
|
|
14
|
+
|
|
15
|
+
# fastapi-mongo-setup 🚀
|
|
16
|
+
|
|
17
|
+
[](https://badge.fury.io/py/fastapi-mongo-setup)
|
|
18
|
+
[](https://pypi.python.org/pypi/fastapi-mongo-setup)
|
|
19
|
+
[](https://opensource.org/licenses/MIT)
|
|
20
|
+
|
|
21
|
+
**Stop writing MongoDB boilerplate for FastAPI!**
|
|
22
|
+
`fastapi-mongo-setup` is a fast, lightweight Python CLI tool that instantly scaffolds a professional, industry-standard FastAPI + MongoDB project structure. It generates async DB connections, Pydantic settings, and a fully functional CRUD router in one command.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## ⚡ Installation
|
|
27
|
+
|
|
28
|
+
Install globally or within your virtual environment:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install fastapi-mongo-setup
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 🛠️ Usage
|
|
35
|
+
|
|
36
|
+
Navigate to the root of your empty (or existing) FastAPI project and run:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
mongo-setup
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### What does this command do?
|
|
43
|
+
Instantly, it generates the following modular architecture:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
fastapi-project/
|
|
47
|
+
├── .env # Auto-populated with MONGODB_URL and DATABASE_NAME
|
|
48
|
+
├── requirements.txt # Dependencies (fastapi, motor, pydantic-settings, etc)
|
|
49
|
+
├── main.py # FastAPI entry point with MongoDB Lifespan logic
|
|
50
|
+
└── src/
|
|
51
|
+
├── config.py # Configuration loader using Pydantic Settings
|
|
52
|
+
├── utils/ # Database core
|
|
53
|
+
│ ├── db.py # Asynchronous Motor connection manager
|
|
54
|
+
│ └── helpers.py # MongoDB ObjectId Serialization helpers
|
|
55
|
+
└── tasks/ # Complete pre-built API module
|
|
56
|
+
├── router.py # GET/POST/DELETE endpoints
|
|
57
|
+
├── schemas.py # Pydantic validation models
|
|
58
|
+
└── service.py # Database CRUD logic
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 🚀 Running Your Generated Project
|
|
62
|
+
|
|
63
|
+
Once the files are created, just install the dependencies and start the built-in demo server!
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# 1. Install required packages
|
|
67
|
+
pip install -r requirements.txt
|
|
68
|
+
|
|
69
|
+
# 2. Run the server
|
|
70
|
+
python main.py
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Go to `http://localhost:8000/docs` to see your automatically generated Swagger UI with a fully functional `Tasks` API connected to your MongoDB!
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 🏗 Why this exists?
|
|
78
|
+
|
|
79
|
+
Setting up `Motor` (the async MongoDB driver) with FastAPI usually requires copy-pasting code to handle connections, lifespans, and fixing `ObjectId` serialization errors. This minimalist tool does all of that for you, providing a clean abstraction layer and a modular structure designed for scaling.
|
|
80
|
+
|
|
81
|
+
## 🤝 Contributing
|
|
82
|
+
Found a bug or want to request a feature? Feel free to open an issue or submit a pull request!
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# fastapi-mongo-setup 🚀
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/py/fastapi-mongo-setup)
|
|
4
|
+
[](https://pypi.python.org/pypi/fastapi-mongo-setup)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
**Stop writing MongoDB boilerplate for FastAPI!**
|
|
8
|
+
`fastapi-mongo-setup` is a fast, lightweight Python CLI tool that instantly scaffolds a professional, industry-standard FastAPI + MongoDB project structure. It generates async DB connections, Pydantic settings, and a fully functional CRUD router in one command.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## ⚡ Installation
|
|
13
|
+
|
|
14
|
+
Install globally or within your virtual environment:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install fastapi-mongo-setup
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 🛠️ Usage
|
|
21
|
+
|
|
22
|
+
Navigate to the root of your empty (or existing) FastAPI project and run:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
mongo-setup
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### What does this command do?
|
|
29
|
+
Instantly, it generates the following modular architecture:
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
fastapi-project/
|
|
33
|
+
├── .env # Auto-populated with MONGODB_URL and DATABASE_NAME
|
|
34
|
+
├── requirements.txt # Dependencies (fastapi, motor, pydantic-settings, etc)
|
|
35
|
+
├── main.py # FastAPI entry point with MongoDB Lifespan logic
|
|
36
|
+
└── src/
|
|
37
|
+
├── config.py # Configuration loader using Pydantic Settings
|
|
38
|
+
├── utils/ # Database core
|
|
39
|
+
│ ├── db.py # Asynchronous Motor connection manager
|
|
40
|
+
│ └── helpers.py # MongoDB ObjectId Serialization helpers
|
|
41
|
+
└── tasks/ # Complete pre-built API module
|
|
42
|
+
├── router.py # GET/POST/DELETE endpoints
|
|
43
|
+
├── schemas.py # Pydantic validation models
|
|
44
|
+
└── service.py # Database CRUD logic
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 🚀 Running Your Generated Project
|
|
48
|
+
|
|
49
|
+
Once the files are created, just install the dependencies and start the built-in demo server!
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# 1. Install required packages
|
|
53
|
+
pip install -r requirements.txt
|
|
54
|
+
|
|
55
|
+
# 2. Run the server
|
|
56
|
+
python main.py
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Go to `http://localhost:8000/docs` to see your automatically generated Swagger UI with a fully functional `Tasks` API connected to your MongoDB!
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 🏗 Why this exists?
|
|
64
|
+
|
|
65
|
+
Setting up `Motor` (the async MongoDB driver) with FastAPI usually requires copy-pasting code to handle connections, lifespans, and fixing `ObjectId` serialization errors. This minimalist tool does all of that for you, providing a clean abstraction layer and a modular structure designed for scaling.
|
|
66
|
+
|
|
67
|
+
## 🤝 Contributing
|
|
68
|
+
Found a bug or want to request a feature? Feel free to open an issue or submit a pull request!
|
|
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "fastapi-mongo-setup"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.2"
|
|
8
8
|
description = "A CLI tool to auto-generate MongoDB connection boilerplates for FastAPI projects."
|
|
9
9
|
authors = [
|
|
10
|
-
{name = "
|
|
10
|
+
{name = "Souvik", email = "wbjee.souvik@gmail.com"},
|
|
11
11
|
]
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.8"
|
|
@@ -18,6 +18,10 @@ dependencies = [
|
|
|
18
18
|
"pydantic-settings"
|
|
19
19
|
]
|
|
20
20
|
|
|
21
|
+
[project.urls]
|
|
22
|
+
Homepage = "https://github.com/Souvik6222/fastapi-mongo-setup"
|
|
23
|
+
Issues = "https://github.com/Souvik6222/fastapi-mongo-setup/issues"
|
|
24
|
+
|
|
21
25
|
[project.scripts]
|
|
22
26
|
mongo-setup = "mongo_setup.cli:init"
|
|
23
27
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fastapi-mongo-setup
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: A CLI tool to auto-generate MongoDB connection boilerplates for FastAPI projects.
|
|
5
|
+
Author-email: Souvik <wbjee.souvik@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/Souvik6222/fastapi-mongo-setup
|
|
7
|
+
Project-URL: Issues, https://github.com/Souvik6222/fastapi-mongo-setup/issues
|
|
8
|
+
Requires-Python: >=3.8
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: motor
|
|
11
|
+
Requires-Dist: python-dotenv
|
|
12
|
+
Requires-Dist: fastapi
|
|
13
|
+
Requires-Dist: pydantic-settings
|
|
14
|
+
|
|
15
|
+
# fastapi-mongo-setup 🚀
|
|
16
|
+
|
|
17
|
+
[](https://badge.fury.io/py/fastapi-mongo-setup)
|
|
18
|
+
[](https://pypi.python.org/pypi/fastapi-mongo-setup)
|
|
19
|
+
[](https://opensource.org/licenses/MIT)
|
|
20
|
+
|
|
21
|
+
**Stop writing MongoDB boilerplate for FastAPI!**
|
|
22
|
+
`fastapi-mongo-setup` is a fast, lightweight Python CLI tool that instantly scaffolds a professional, industry-standard FastAPI + MongoDB project structure. It generates async DB connections, Pydantic settings, and a fully functional CRUD router in one command.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## ⚡ Installation
|
|
27
|
+
|
|
28
|
+
Install globally or within your virtual environment:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install fastapi-mongo-setup
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 🛠️ Usage
|
|
35
|
+
|
|
36
|
+
Navigate to the root of your empty (or existing) FastAPI project and run:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
mongo-setup
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### What does this command do?
|
|
43
|
+
Instantly, it generates the following modular architecture:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
fastapi-project/
|
|
47
|
+
├── .env # Auto-populated with MONGODB_URL and DATABASE_NAME
|
|
48
|
+
├── requirements.txt # Dependencies (fastapi, motor, pydantic-settings, etc)
|
|
49
|
+
├── main.py # FastAPI entry point with MongoDB Lifespan logic
|
|
50
|
+
└── src/
|
|
51
|
+
├── config.py # Configuration loader using Pydantic Settings
|
|
52
|
+
├── utils/ # Database core
|
|
53
|
+
│ ├── db.py # Asynchronous Motor connection manager
|
|
54
|
+
│ └── helpers.py # MongoDB ObjectId Serialization helpers
|
|
55
|
+
└── tasks/ # Complete pre-built API module
|
|
56
|
+
├── router.py # GET/POST/DELETE endpoints
|
|
57
|
+
├── schemas.py # Pydantic validation models
|
|
58
|
+
└── service.py # Database CRUD logic
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 🚀 Running Your Generated Project
|
|
62
|
+
|
|
63
|
+
Once the files are created, just install the dependencies and start the built-in demo server!
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# 1. Install required packages
|
|
67
|
+
pip install -r requirements.txt
|
|
68
|
+
|
|
69
|
+
# 2. Run the server
|
|
70
|
+
python main.py
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Go to `http://localhost:8000/docs` to see your automatically generated Swagger UI with a fully functional `Tasks` API connected to your MongoDB!
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 🏗 Why this exists?
|
|
78
|
+
|
|
79
|
+
Setting up `Motor` (the async MongoDB driver) with FastAPI usually requires copy-pasting code to handle connections, lifespans, and fixing `ObjectId` serialization errors. This minimalist tool does all of that for you, providing a clean abstraction layer and a modular structure designed for scaling.
|
|
80
|
+
|
|
81
|
+
## 🤝 Contributing
|
|
82
|
+
Found a bug or want to request a feature? Feel free to open an issue or submit a pull request!
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: fastapi-mongo-setup
|
|
3
|
-
Version: 0.3.1
|
|
4
|
-
Summary: A CLI tool to auto-generate MongoDB connection boilerplates for FastAPI projects.
|
|
5
|
-
Author-email: Developer Name <developer@example.com>
|
|
6
|
-
Requires-Python: >=3.8
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: motor
|
|
9
|
-
Requires-Dist: python-dotenv
|
|
10
|
-
Requires-Dist: fastapi
|
|
11
|
-
Requires-Dist: pydantic-settings
|
|
12
|
-
|
|
13
|
-
# fastapi-mongo-setup
|
|
14
|
-
|
|
15
|
-
A Python CLI package that automatically creates a MongoDB connection structure for FastAPI projects.
|
|
16
|
-
|
|
17
|
-
## Installation
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
pip install fastapi-mongo-setup
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
Navigate to the root of your FastAPI project and run:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
mongo-setup
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
This command will:
|
|
32
|
-
- Check if the `src/utils` directory exists (creates it if it doesn't).
|
|
33
|
-
- Generate a `src/utils/db.py` file containing an asynchronous `Database` class using `motor`. This includes `connect_to_mongodb` and `close_mongodb_connection` methods.
|
|
34
|
-
- Generate a `src/utils/helpers.py` file with a `serialize_doc` function to convert MongoDB `ObjectId` types to plain strings.
|
|
35
|
-
- Automatically append `MONGODB_URL` and `DATABASE_NAME` variables to your `.env` file.
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# fastapi-mongo-setup
|
|
2
|
-
|
|
3
|
-
A Python CLI package that automatically creates a MongoDB connection structure for FastAPI projects.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pip install fastapi-mongo-setup
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
Navigate to the root of your FastAPI project and run:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
mongo-setup
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
This command will:
|
|
20
|
-
- Check if the `src/utils` directory exists (creates it if it doesn't).
|
|
21
|
-
- Generate a `src/utils/db.py` file containing an asynchronous `Database` class using `motor`. This includes `connect_to_mongodb` and `close_mongodb_connection` methods.
|
|
22
|
-
- Generate a `src/utils/helpers.py` file with a `serialize_doc` function to convert MongoDB `ObjectId` types to plain strings.
|
|
23
|
-
- Automatically append `MONGODB_URL` and `DATABASE_NAME` variables to your `.env` file.
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: fastapi-mongo-setup
|
|
3
|
-
Version: 0.3.1
|
|
4
|
-
Summary: A CLI tool to auto-generate MongoDB connection boilerplates for FastAPI projects.
|
|
5
|
-
Author-email: Developer Name <developer@example.com>
|
|
6
|
-
Requires-Python: >=3.8
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
Requires-Dist: motor
|
|
9
|
-
Requires-Dist: python-dotenv
|
|
10
|
-
Requires-Dist: fastapi
|
|
11
|
-
Requires-Dist: pydantic-settings
|
|
12
|
-
|
|
13
|
-
# fastapi-mongo-setup
|
|
14
|
-
|
|
15
|
-
A Python CLI package that automatically creates a MongoDB connection structure for FastAPI projects.
|
|
16
|
-
|
|
17
|
-
## Installation
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
pip install fastapi-mongo-setup
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
Navigate to the root of your FastAPI project and run:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
mongo-setup
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
This command will:
|
|
32
|
-
- Check if the `src/utils` directory exists (creates it if it doesn't).
|
|
33
|
-
- Generate a `src/utils/db.py` file containing an asynchronous `Database` class using `motor`. This includes `connect_to_mongodb` and `close_mongodb_connection` methods.
|
|
34
|
-
- Generate a `src/utils/helpers.py` file with a `serialize_doc` function to convert MongoDB `ObjectId` types to plain strings.
|
|
35
|
-
- Automatically append `MONGODB_URL` and `DATABASE_NAME` variables to your `.env` file.
|
|
File without changes
|
{fastapi_mongo_setup-0.3.1 → fastapi_mongo_setup-0.3.2}/src/fastapi_mongo_setup.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|