BREAKING CHANGE: The module name has been renamed from `MicroPie` to `micropie` to align with Python packaging conventions and improve Pythonic consistency.

Commit d8983f0 · patx · 2025-06-29T14:20:03-04:00

Changeset
d8983f097377615599605b0a6845e78b71f4ab08
Parents
f965784db214579ef6e14fd44888a19cf2432bd9

View source at this commit

BREAKING CHANGE: The module name has been renamed from `MicroPie` to `micropie` to align with Python packaging conventions and improve Pythonic consistency.

This affects all import statements:
  - Before: from MicroPie import App
  - Now:    from micropie import App

All future examples and documentation will reflect this change.

Comments

No comments yet.

Log in to comment

Diff

diff --git a/README.md b/README.md
index 7a8b164..297d16f 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,10 @@
 - **Example Applications**: [github.com/patx/micropie/tree/main/examples](https://github.com/patx/micropie/tree/main/examples)
 - **Introduction Lightning Talk**: [Introduction to MicroPie on YouTube](https://www.youtube.com/watch?v=BzkscTLy1So)
 
+### Latest Release Notes
+View the latest release notes [here](https://github.com/patx/micropie/blob/main/docs/release_notes.md). It is useful to check release notes each time a new version of MicroPie is published. Any breaking changes (rare, but do happen) also appear here.
+
+
 ## **Installing MicroPie**
 
 ### **Installation**
@@ -69,7 +73,7 @@ pip install uvicorn
 
 Save the following as `app.py`:
 ```python
-from MicroPie import App
+from micropie import App
 
 class MyApp(App):
     async def index(self):
@@ -150,7 +154,20 @@ MicroPie includes built-in support for WebSocket connections. WebSocket routes a
 - Access query parameters, path parameters, and session data in WebSocket handlers, consistent with HTTP requests.
 - Manage WebSocket connections using the WebSocket class, which provides methods like `accept`, `receive_text`, `send_text`, and `close`.
 
-See the [websockets example](https://github.com/patx/micropie/tree/main/examples/websockets) to see how to use Websockets with MicroPie.
+Check out a basic example:
+```python                                
+from micropie import App
+
+class Root(App):
+
+    async def ws_echo(self, ws):
+        await ws.accept()
+        while True:
+            msg = await ws.receive_text()
+            await ws.send_text(f"Echo: {msg}")
+
+app = Root()
+```
 
 #### Use Socket.IO for Advanced Real-Time Features
 If you want more advanced real-time features like automatic reconnection, broadcasting, or fallbacks (e.g., polling), you can integrate Socket.IO with your MicroPie app using Uvicorn as the server. See [examples/socketio](https://github.com/patx/micropie/tree/main/examples/socketio) for integration instructions and examples.
@@ -213,7 +230,7 @@ You also can use the `SessionBackend` class to create your own session backend.
 ### **Middleware**
 MicroPie allows you to create plug-able middleware to hook into the request life cycle. Take a look a trivial example using `HttpMiddleware` to send the console messages before and after the request is processed. Check out [examples/middleware](https://github.com/patx/micropie/tree/main/examples/middleware) to see more.
 ```python
-from MicroPie import App, HttpMiddleware
+from micropie import App, HttpMiddleware
 
 class MiddlewareExample(HttpMiddleware):
     async def before_request(self, request):
diff --git a/docs/README.md b/docs/README.md
index 2a90fff..d4dea29 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,6 +1,6 @@
 [![Logo](https://patx.github.io/micropie/logo.png)](https://patx.github.io/micropie)
 
-MicroPie is an ultra-micro ASGI Python web framework that gets out of your way, 
+micropie is an ultra-micro ASGI Python web framework that gets out of your way, 
 letting you build fast and dynamic web apps with ease. Inspired by CherryPy and
 licensed under the BSD three-clause license.
 
diff --git a/docs/index.html b/docs/index.html
index 5e71d83..957ca20 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -112,7 +112,7 @@
 
         <h2>MicroPie is Fun</h2>
         <pre><code>
-<span class="c2">from</span> MicroPie <span class="c2">import</span> App
+<span class="c2">from</span> micropie <span class="c2">import</span> App
 
 <span class="c2">class</span> MyApp(<span class="c9">App</span>):
 
diff --git a/docs/release_notes.md b/docs/release_notes.md
new file mode 100644
index 0000000..fab6e4d
--- /dev/null
+++ b/docs/release_notes.md
@@ -0,0 +1,8 @@
+[![Logo](https://patx.github.io/micropie/logo.png)](https://patx.github.io/micropie)
+
+## Releases Notes
+
+- **[0.14](https://github.com/patx/micropie/releases/tag/v0.14)** - Change import to `micropie` instead of `MicroPie` **BREAKING CHANGE**
+- **[0.13](https://github.com/patx/micropie/releases/tag/v0.13)** - Introduce built-in WebSocket support
+
+All releases since 0.13 will be listed here. For older releases see [tags on Github](https://github.com/patx/micropie/tags)
diff --git a/examples/api/pastes.py b/examples/api/pastes.py
index eebf477..1b0d708 100644
--- a/examples/api/pastes.py
+++ b/examples/api/pastes.py
@@ -1,4 +1,4 @@
-from MicroPie import App
+from micropie import App
 from pickledb import AsyncPickleDB
 import orjson
 from uuid import uuid4
diff --git a/examples/api/simple.py b/examples/api/simple.py
index 8332523..e16e478 100644
--- a/examples/api/simple.py
+++ b/examples/api/simple.py
@@ -1,4 +1,4 @@
-from MicroPie import App
+from micropie import App
 
 
 class Root(App):
diff --git a/examples/auth/app.py b/examples/auth/app.py
index 5b830e2..1023a5e 100644
--- a/examples/auth/app.py
+++ b/examples/auth/app.py
@@ -1,4 +1,4 @@
-from MicroPie import App
+from micropie import App
 import requests
 import os
 
diff --git a/examples/explicit_routing/micropie_routing.py b/examples/explicit_routing/micropie_routing.py
index 33d9c62..947ddcf 100644
--- a/examples/explicit_routing/micropie_routing.py
+++ b/examples/explicit_routing/micropie_routing.py
@@ -1,6 +1,6 @@
 import re
 from typing import Dict, List, Optional, Tuple, Any, Callable, Type, Union
-from MicroPie import App, HttpMiddleware, WebSocketMiddleware, Request, WebSocketRequest
+from micropie import App, HttpMiddleware, WebSocketMiddleware, Request, WebSocketRequest
 
 class RouteError(Exception):
     """Custom exception for route-related errors."""
diff --git a/examples/explicit_routing/ws.py b/examples/explicit_routing/ws.py
index 496849a..6e2e162 100644
--- a/examples/explicit_routing/ws.py
+++ b/examples/explicit_routing/ws.py
@@ -1,5 +1,5 @@
 from micropie_routing import ExplicitApp, route, ws_route
-from MicroPie import WebSocket, ConnectionClosed
+from micropie import WebSocket, ConnectionClosed
 
 class MyApp(ExplicitApp):
     @route("/api/users/{user_id:int}", method=["GET"])
diff --git a/examples/file_uploads/app.py b/examples/file_uploads/app.py
index 523f3d2..0a15d19 100644
--- a/examples/file_uploads/app.py
+++ b/examples/file_uploads/app.py
@@ -1,6 +1,6 @@
 import os          # Used for file path handling and directory creation
 import aiofiles    # Asynchronous file I/O operations
-from MicroPie import App  # Import the base App class from MicroPie
+from micropie import App  # Import the base App class from MicroPie
 
 # Ensure the "uploads" directory exists; create it if it doesn't
 os.makedirs("uploads", exist_ok=True)
diff --git a/examples/headers/app.py b/examples/headers/app.py
index 775a884..2fa0456 100644
--- a/examples/headers/app.py
+++ b/examples/headers/app.py
@@ -1,4 +1,4 @@
-from MicroPie import App
+from micropie import App
 
 
 class Root(App):
diff --git a/examples/hello_world/app.py b/examples/hello_world/app.py
index 4287fc9..a598eb7 100644
--- a/examples/hello_world/app.py
+++ b/examples/hello_world/app.py
@@ -1,4 +1,4 @@
-from MicroPie import App
+from micropie import App
 
 
 class Root(App):
diff --git a/examples/json/app.py b/examples/json/app.py
index 79e6816..8cd19cf 100644
--- a/examples/json/app.py
+++ b/examples/json/app.py
@@ -1,4 +1,4 @@
-from MicroPie import App
+from micropie import App
 
 
 class Root(App):
diff --git a/examples/middleware/csrf.py b/examples/middleware/csrf.py
index c2aebf8..ef0f350 100644
--- a/examples/middleware/csrf.py
+++ b/examples/middleware/csrf.py
@@ -2,7 +2,7 @@ from typing import Optional, Dict, List, Tuple, Any
 from html import escape
 import uuid
 from itsdangerous import URLSafeTimedSerializer, BadSignature
-from MicroPie import App, HttpMiddleware, Request
+from micropie import App, HttpMiddleware, Request
 
 
 class CSRFMiddleware(HttpMiddleware):
diff --git a/examples/middleware/rate_limit.py b/examples/middleware/rate_limit.py
index 258e133..f1957d9 100644
--- a/examples/middleware/rate_limit.py
+++ b/examples/middleware/rate_limit.py
@@ -1,6 +1,6 @@
 import time
 
-from MicroPie import App, HttpMiddleware
+from micropie import App, HttpMiddleware
 
 
 class RateLimitMiddleware(HttpMiddleware):
diff --git a/examples/middleware/router.py b/examples/middleware/router.py
index 9f458c8..1e0d903 100644
--- a/examples/middleware/router.py
+++ b/examples/middleware/router.py
@@ -7,7 +7,7 @@ https://github.com/patx/micropie/tree/main/examples/rest
 
 import re
 from typing import Dict, List, Optional, Tuple, Any
-from MicroPie import App, HttpMiddleware, Request
+from micropie import App, HttpMiddleware, Request
 
 class ExplicitRouter(HttpMiddleware):
     def __init__(self):
diff --git a/examples/middleware/sessions.py b/examples/middleware/sessions.py
index 8030d86..47518cc 100644
--- a/examples/middleware/sessions.py
+++ b/examples/middleware/sessions.py
@@ -3,7 +3,7 @@ import os
 import uuid
 from typing import Optional, Dict, List, Tuple, Any
 from itsdangerous import URLSafeTimedSerializer, BadSignature
-from MicroPie import App, HttpMiddleware, Request, SESSION_TIMEOUT
+from micropie import App, HttpMiddleware, Request, SESSION_TIMEOUT
 
 
 class SignedSessionMiddleware(HttpMiddleware):
diff --git a/examples/middleware/upload.py b/examples/middleware/upload.py
index dddb263..f6e9e58 100644
--- a/examples/middleware/upload.py
+++ b/examples/middleware/upload.py
@@ -3,7 +3,7 @@ This file demonstrates how to use a middleware to check file upload sizes
 before the request body is processed by the multipart parser.
 """
 
-from MicroPie import App, HttpMiddleware
+from micropie import App, HttpMiddleware
 
 MAX_UPLOAD_SIZE = 100 * 1024 * 1024  # 100MB
 
diff --git a/examples/pastebin/app.py b/examples/pastebin/app.py
index e9f0513..e0946de 100644
--- a/examples/pastebin/app.py
+++ b/examples/pastebin/app.py
@@ -1,6 +1,6 @@
 from uuid import uuid4
 import asyncio
-from MicroPie import App
+from micropie import App
 from markupsafe import escape
 from pickledb import AsyncPickleDB
 
diff --git a/examples/sessions/in_memory.py b/examples/sessions/in_memory.py
index ba0bb75..fb82ff5 100644
--- a/examples/sessions/in_memory.py
+++ b/examples/sessions/in_memory.py
@@ -1,4 +1,4 @@
-from MicroPie import App
+from micropie import App
 
 class MyApp(App):
     async def index(self):
diff --git a/examples/sessions/motor_backend.py b/examples/sessions/motor_backend.py
index 20c3f5b..ff93d35 100644
--- a/examples/sessions/motor_backend.py
+++ b/examples/sessions/motor_backend.py
@@ -5,7 +5,7 @@ with MicroPie.
 This application increments a visit counter stored in a MongoDB collection for sessions.
 """
 
-from MicroPie import App, SessionBackend
+from micropie import App, SessionBackend
 import motor.motor_asyncio
 import uuid
 from datetime import datetime, timedelta
diff --git a/examples/socketio/basic/chatroom.py b/examples/socketio/basic/chatroom.py
index 0503c22..53f247d 100644
--- a/examples/socketio/basic/chatroom.py
+++ b/examples/socketio/basic/chatroom.py
@@ -1,5 +1,5 @@
 import socketio
-from MicroPie import App
+from micropie import App
 from kenobi import KenobiDB
 from datetime import datetime
 import asyncio
diff --git a/examples/socketio/basic/webcam.py b/examples/socketio/basic/webcam.py
index 15ff524..45d11cd 100644
--- a/examples/socketio/basic/webcam.py
+++ b/examples/socketio/basic/webcam.py
@@ -1,5 +1,5 @@
 import socketio
-from MicroPie import App
+from micropie import App
 
 # Create the Socket.IO server
 sio = socketio.AsyncServer(async_mode="asgi")
diff --git a/examples/socketio/chatroom/app.py b/examples/socketio/chatroom/app.py
index 67ba3d5..2808209 100644
--- a/examples/socketio/chatroom/app.py
+++ b/examples/socketio/chatroom/app.py
@@ -1,5 +1,5 @@
 import socketio
-from MicroPie import App
+from micropie import App
 from kenobi import KenobiDB
 from datetime import datetime
 import asyncio
diff --git a/examples/socketio/webtrc/app.py b/examples/socketio/webtrc/app.py
index ce18974..bb9624d 100644
--- a/examples/socketio/webtrc/app.py
+++ b/examples/socketio/webtrc/app.py
@@ -1,5 +1,5 @@
 import socketio
-from MicroPie import App
+from micropie import App
 
 # 1) Create the Async Socket.IO server and wrap with an ASGI app.
 sio = socketio.AsyncServer(async_mode="asgi")
diff --git a/examples/static_content/basic.py b/examples/static_content/basic.py
index da04a2e..e578c47 100644
--- a/examples/static_content/basic.py
+++ b/examples/static_content/basic.py
@@ -1,4 +1,4 @@
-from MicroPie import App
+from micropie import App
 import os
 import aiofiles
 import mimetypes
diff --git a/examples/static_content/servestatic.py b/examples/static_content/servestatic.py
index 516f171..0600329 100644
--- a/examples/static_content/servestatic.py
+++ b/examples/static_content/servestatic.py
@@ -1,5 +1,5 @@
 from servestatic import ServeStaticASGI
-from MicroPie import App
+from micropie import App
 
 class Root(App):
     async def index(self):
diff --git a/examples/streaming/sse/app.py b/examples/streaming/sse/app.py
index bc2eec1..c3f99d0 100644
--- a/examples/streaming/sse/app.py
+++ b/examples/streaming/sse/app.py
@@ -1,6 +1,6 @@
 import asyncio
 import random
-from MicroPie import App
+from micropie import App
 
 
 class MyApp(App):
diff --git a/examples/streaming/text.py b/examples/streaming/text.py
index 28779af..0c2d970 100644
--- a/examples/streaming/text.py
+++ b/examples/streaming/text.py
@@ -1,6 +1,6 @@
 import time
 import asyncio
-from MicroPie import App
+from micropie import App
 
 class Root(App):
 
diff --git a/examples/streaming/video.py b/examples/streaming/video.py
index 1038de2..10134aa 100644
--- a/examples/streaming/video.py
+++ b/examples/streaming/video.py
@@ -1,5 +1,5 @@
 import os
-from MicroPie import App
+from micropie import App
 
 VIDEO_PATH = "video.mp4"
 
diff --git a/examples/twutr/app.py b/examples/twutr/app.py
index 624c0c4..cc12d40 100644
--- a/examples/twutr/app.py
+++ b/examples/twutr/app.py
@@ -9,7 +9,7 @@ from datetime import datetime, timedelta
 from typing import List, Tuple, Optional, Dict, Any
 
 from markupsafe import escape, Markup
-from MicroPie import App, SessionBackend
+from micropie import App, SessionBackend
 
 import motor.motor_asyncio
 from motor.motor_asyncio import AsyncIOMotorCollection
diff --git a/examples/websockets/app.py b/examples/websockets/app.py
index 5a6a94c..26c038f 100644
--- a/examples/websockets/app.py
+++ b/examples/websockets/app.py
@@ -1,4 +1,4 @@
-from MicroPie import App, ConnectionClosed
+from micropie import App, ConnectionClosed
 
 class MyApp(App):
     async def chat(self):
diff --git a/MicroPie.py b/micropie.py
similarity index 100%
rename from MicroPie.py
rename to micropie.py
diff --git a/pyproject.toml b/pyproject.toml
index 88fa6b0..8f3142e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
 
 [project]
 name = "MicroPie"
-version = "0.13"
+version = "0.14"
 description = "An ultra micro ASGI web framework"
 keywords = ["micropie", "asgi", "microframework", "http"]
 readme = "docs/README.md"
diff --git a/tests.py b/tests.py
index acb9b75..e781fd6 100644
--- a/tests.py
+++ b/tests.py
@@ -3,7 +3,7 @@ import unittest
 import uuid
 from urllib.parse import parse_qs
 from unittest.mock import AsyncMock
-from MicroPie import App, InMemorySessionBackend, Request, SESSION_TIMEOUT
+from micropie import App, InMemorySessionBackend, Request, SESSION_TIMEOUT
 
 class TestMicroPie(unittest.TestCase):
     def setUp(self):