Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit bff465a

Browse files
committed
Docs for pymongo.uri_parser.
1 parent eacb277 commit bff465a

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

doc/api/pymongo/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ Deprecated sub-modules (moved to the :mod:`bson` package):
4242
son
4343
timestamp
4444
tz_util
45+
uri_parser

doc/api/pymongo/uri_parser.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
:mod:`uri_parser` -- Tools to parse and validate a MongoDB URI
2+
==============================================================
3+
4+
.. automodule:: pymongo.uri_parser
5+
:synopsis: Tools to parse and validate a MongoDB URI.
6+
:members:

pymongo/uri_parser.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,16 @@ def split_hosts(hosts, default_port=DEFAULT_PORT):
209209
def parse_uri(uri, default_port=DEFAULT_PORT):
210210
"""Parse and validate a MongoDB URI.
211211
212-
Returns a dict of the form:
213-
214-
{
215-
'nodelist': <list of (host, port) tuples>,
216-
'username': <username> or None,
217-
'password': <password> or None,
218-
'database': <database name> or None,
219-
'collection': <collection name> or None,
220-
'options': <dict of MongoDB URI options>
221-
}
212+
Returns a dict of the form::
213+
214+
{
215+
'nodelist': <list of (host, port) tuples>,
216+
'username': <username> or None,
217+
'password': <password> or None,
218+
'database': <database name> or None,
219+
'collection': <collection name> or None,
220+
'options': <dict of MongoDB URI options>
221+
}
222222
223223
:Parameters:
224224
- `uri`: The MongoDB URI to parse.

0 commit comments

Comments
 (0)