sphobjinv.fileops¶
File I/O helpers for sphobjinv.
sphobjinv is a toolkit for manipulation and inspection of
Sphinx objects.inv files.
- Author
- Brian Skinn (bskinn@alum.mit.edu)
- File Created
- 5 Nov 2017
- Copyright
- (c) Brian Skinn 2016-2018
- Source Repository
- http://www.github.com/bskinn/sphobjinv
- Documentation
- http://sphobjinv.readthedocs.io
- License
- The MIT License; see LICENSE.txt for full license terms
Members
-
readbytes(path)¶ Read file contents and return as
bytes.Parameters: path – str– Path to file to be opened.Returns: b – bytes– Contents of the indicated file.
-
readjson(path)¶ Create
dictfrom JSON file.No data or schema validation is performed.
Parameters: path – str– Path to JSON file to be read.Returns: d – dict– Deserialized JSON.
-
urlwalk(url)¶ Generate a series of candidate objects.inv URLs.
URLs are based on the seed url passed in. Ensure that the path separator in url is the standard forward slash (‘/’).
Parameters: url – str– Seed URL defining directory structure to walk through.Yields: inv_url – str– Candidate URL for objects.inv location.
-
writebytes(path, contents)¶ Write indicated file contents.
Any existing file at path will be overwritten.
Parameters: