THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class FileBasedCache: (source)
Constructor: FileBasedCache(path, filename, monitored_dirs, monitored_files)
Undocumented
| Method | __collect |
Collect monitored files for hashing and deduplicate them. |
| Method | __collect |
Collect deduplicated Python files from monitored directories. |
| Method | __collect |
Add deduplicated monitored files to the result list. |
| Method | __compute |
Compute and return a hash representing the state of monitored sources. |
| Method | __init__ |
Initialize the FileBasedCache instance. |
| Method | clear |
Remove the cache file if it exists. |
| Method | get |
Retrieve cached data if valid. |
| Method | save |
Save the provided data to the cache file if it has changed. |
| Constant | CACHE |
Undocumented |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | __file |
Undocumented |
| Instance Variable | __file |
Undocumented |
| Instance Variable | __hash |
Undocumented |
| Instance Variable | __lasthashcheck |
Undocumented |
| Instance Variable | __monitored |
Undocumented |
| Instance Variable | __monitored |
Undocumented |
| Instance Variable | __path |
Undocumented |
| Instance Variable | __sourceshashcache |
Undocumented |
Path, seen: set[ str], result: list[ tuple[ str, Path]]):
(source)
¶
Collect deduplicated Python files from monitored directories.
| Parameters | |
cachePath | Resolved cache file path to exclude from collection. |
seen:set[str] | Set of already collected POSIX paths used for deduplication. |
result:list[tuple[str, Path]] | Output list updated in place with (posix_path, resolved_path) tuples. |
| Returns | |
None | This method updates result in place. |
Path, seen: set[ str], result: list[ tuple[ str, Path]]):
(source)
¶
Add deduplicated monitored files to the result list.
| Parameters | |
cachePath | Resolved cache file path to exclude from collection. |
seen:set[str] | Set of already collected POSIX paths used for deduplication. |
result:list[tuple[str, Path]] | Output list updated in place with (posix_path, resolved_path) tuples. |
| Returns | |
None | This method updates result in place. |
Compute and return a hash representing the state of monitored sources.
This method generates a SHA-1 hash based on the modification time and size of all monitored files and Python files in monitored directories, excluding the cache file itself. The hash is cached for a short interval to avoid redundant computation.
| Returns | |
str | The computed SHA-1 hash as a hexadecimal string. |
Path, filename: str, monitored_dirs: list[ Path] | None = None, monitored_files: list[ Path] | None = None):
(source)
¶
Initialize the FileBasedCache instance.
| Parameters | |
path:Path | Directory path where the cache file will be stored. |
filename:str | Name of the cache file. |
monitoredlist[Path] or None, optional | List of directories to monitor for changes. |
monitoredlist[Path] or None, optional | List of files to monitor for changes. |
| Returns | |
None | This method does not return a value. |
Remove the cache file if it exists.
| Returns | |
bool | True if the cache file was removed, False if it did not exist. |