-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Spelling mistakes * API doc updates * Update index.rst Update API in ToC * Update index.rst Update image typo * Update index.rst Update link typo * Update APIs.rst Update name * Update aryn-sdk.rst Update link
- Loading branch information
Showing
43 changed files
with
190 additions
and
62 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Aryn Partitioning Service APIs | ||
============= | ||
|
||
This is the API reference for the Aryn-SDK, which is used to interact with the Aryn Partitioning Service. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
./APIs/aryn-sdk.rst | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ Aryn SDK | |
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
/APIs/aryn-sdk/partition.rst | ||
./aryn-sdk/partition.rst |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Sycamore APIs | ||
============= | ||
|
||
This is the API reference for Sycamore, and it contains the functions you can use when writing Sycamore scripts to process data. If you are interested in contributing new transforms to the Sycamore project, please visit the Low-Level Transforms section in the API docs. | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
./APIs/config.rst | ||
./APIs/context.rst | ||
./APIs/docset.rst | ||
./APIs/docsetreader.rst | ||
./APIs/docsetwriter.rst | ||
./APIs/document.rst | ||
./APIs/functions.rst | ||
./APIs/node.rst | ||
./APIs/low_level_transforms.rst |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/python3 | ||
|
||
""" | ||
Auto-generate RST files from Python source. | ||
Usage: ./gen | ||
""" | ||
|
||
import os | ||
import sys | ||
import ast | ||
|
||
|
||
srcRoot = "../../../lib/sycamore/sycamore" | ||
docRoot = "." | ||
|
||
|
||
def shouldEmit(node): | ||
if not isinstance(node, ast.ClassDef): | ||
return False | ||
if ast.get_docstring(node): | ||
return True | ||
for base in node.bases: | ||
if base.id == "ABC": | ||
return False # skip abstract base classes | ||
return True | ||
|
||
|
||
def doFile(name, dir, ent): | ||
with open(f"{dir}/{ent}") as fp: | ||
top = ast.parse(fp.read()) | ||
|
||
ary = [] | ||
base = ent[:-3] | ||
for node in top.body: # iterate module-level nodes only | ||
if shouldEmit(node): | ||
ary.append(f"sycamore.{name}.{base}.{node.name}") | ||
|
||
if ary: | ||
with open(f"{docRoot}/{name}/{base}.rst", "w") as fp: | ||
title = base.replace("_", " ").title() | ||
line = "=" * len(title) | ||
fp.write(f"{title}\n{line}\n\n") | ||
for sym in sorted(ary): | ||
fp.write(f".. autoclass:: {sym}\n :members:\n :show-inheritance:\n") | ||
print(f" /APIs/{name}/{base}.rst") | ||
|
||
|
||
def doDir(name): | ||
dir = f"{srcRoot}/{name}" | ||
for ent in sorted(os.listdir(dir)): | ||
if not ent.endswith(".py"): | ||
continue | ||
doFile(name, dir, ent) | ||
|
||
|
||
def main(): | ||
doDir("transforms") | ||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.. _Ref-low_level_Transforms: | ||
|
||
Low-Level Transforms (for Sycamore development) | ||
=========== | ||
|
||
.. note:: | ||
Users of Sycamore won't need to interact with these classes and should instead use the classes in the top-level API docs. These transform classes are primarily of interest to developers looking to extend Sycamore or contribute to the project. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
./low_level_transforms/augment_text.rst | ||
./low_level_transforms/basics.rst | ||
./low_level_transforms/bbox_merge.rst | ||
./low_level_transforms/embed.rst | ||
./low_level_transforms/explode.rst | ||
./low_level_transforms/extract_entity.rst | ||
./low_level_transforms/extract_schema.rst | ||
./low_level_transforms/extract_table.rst | ||
./low_level_transforms/map.rst | ||
./low_level_transforms/mark_misc.rst | ||
./low_level_transforms/merge_elements.rst | ||
./low_level_transforms/partition.rst | ||
./low_level_transforms/query.rst | ||
./low_level_transforms/random_sample.rst | ||
./low_level_transforms/regex_replace.rst | ||
./low_level_transforms/sketcher.rst | ||
./low_level_transforms/split_elements.rst | ||
./low_level_transforms/spread_properties.rst | ||
./low_level_transforms/summarize.rst | ||
./low_level_transforms/summarize_images.rst |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
63 changes: 63 additions & 0 deletions
63
docs/source/sycamore/querying_data/using_aryn_opensearch_stack/APIs/gen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/python3 | ||
|
||
""" | ||
Auto-generate RST files from Python source. | ||
Usage: ./gen | ||
""" | ||
|
||
import os | ||
import sys | ||
import ast | ||
|
||
|
||
srcRoot = "../../../lib/sycamore/sycamore" | ||
docRoot = "." | ||
|
||
|
||
def shouldEmit(node): | ||
if not isinstance(node, ast.ClassDef): | ||
return False | ||
if ast.get_docstring(node): | ||
return True | ||
for base in node.bases: | ||
if base.id == "ABC": | ||
return False # skip abstract base classes | ||
return True | ||
|
||
|
||
def doFile(name, dir, ent): | ||
with open(f"{dir}/{ent}") as fp: | ||
top = ast.parse(fp.read()) | ||
|
||
ary = [] | ||
base = ent[:-3] | ||
for node in top.body: # iterate module-level nodes only | ||
if shouldEmit(node): | ||
ary.append(f"sycamore.{name}.{base}.{node.name}") | ||
|
||
if ary: | ||
with open(f"{docRoot}/{name}/{base}.rst", "w") as fp: | ||
title = base.replace("_", " ").title() | ||
line = "=" * len(title) | ||
fp.write(f"{title}\n{line}\n\n") | ||
for sym in sorted(ary): | ||
fp.write(f".. autoclass:: {sym}\n :members:\n :show-inheritance:\n") | ||
print(f" /APIs/{name}/{base}.rst") | ||
|
||
|
||
def doDir(name): | ||
dir = f"{srcRoot}/{name}" | ||
for ent in sorted(os.listdir(dir)): | ||
if not ent.endswith(".py"): | ||
continue | ||
doFile(name, dir, ent) | ||
|
||
|
||
def main(): | ||
doDir("transforms") | ||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters