starlib

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 16 Imported by: 9

README

Starlib - Starlark's Missing standard Library.

Qri GoDoc License Codecov CI

Welcome

This is a community-driven project to bring a standard library to the starlark programming dialect. We here at Qri need a standard library, and we thought it might benefit others to structure this library in a reusable way. We are a little biased towards our needs, and will be shaping the library primarily toward's Qri's use case.

Question Answer
"What's starlark?" It's a python-like scripting language open-sourced by Google. Here are the docs
"What's the use-case for this?" We're building it for Qri ('query')
"I want to play with starlib outside of Qri" Checkout the starlark playground
"I have a question" Create an issue
"I found a bug" Create an issue
"I would like to propose a new package" You should think about creating an RFC

Packages

The following is a list of the packages currently in the standard library

Package Go Docs Description
bsoup Go Docs a beautiful-soup-like API for working with HTML
encoding/base64 Go Docs base64 de/serialization
encoding/csv Go Docs csv de/serialization
encoding/json Go Docs alias for go.starlark.net/starlarkjson
encoding/yaml Go Docs yaml de/serialization
geo Go Docs 2d geographic operations
hash Go Docs hash operations (md5/sha1/sha256)
html Go Docs html text processing
http Go Docs http client operations
math Go Docs mathematical functions & values upstreamed into go-starlark
re Go Docs regular expressions
time Go Docs time operations, upstreamed into go-starlark
xlsx Go Docs xlsx file format reading
zipfile Go Docs support for zip archives
This documentation has been adapted from the Cycle.js documentation.

Documentation

Index

Constants

View Source
const Version = "0.5.0"

Version is the current semver for the entire starlib library

Variables

This section is empty.

Functions

func Loader

func Loader(thread *starlark.Thread, module string) (dict starlark.StringDict, err error)

Loader presents the starlib library as a loader

Types

This section is empty.

Directories

Path Synopsis
Package bsoup defines a beautiful-soup-like API for working with HTML documents in starlark outline: bsoup bsoup defines a beautiful-soup-like API for working with HTML documents path: bsoup types: SoupNode methods: find(name, attrs, recursive, string, **kwargs) retrieve the first occurance of an element that matches arguments passed to find.
Package bsoup defines a beautiful-soup-like API for working with HTML documents in starlark outline: bsoup bsoup defines a beautiful-soup-like API for working with HTML documents path: bsoup types: SoupNode methods: find(name, attrs, recursive, string, **kwargs) retrieve the first occurance of an element that matches arguments passed to find.
encoding
base64
Package base64 defines base64 encoding & decoding functions outline: base64 base64 defines base64 encoding & decoding functions, often used to represent binary as text.
Package base64 defines base64 encoding & decoding functions outline: base64 base64 defines base64 encoding & decoding functions, often used to represent binary as text.
csv
Package csv reads comma-separated values files outline: csv csv reads comma-separated values files path: encoding/csv functions: read_all(source, comma=",", comment="", lazy_quotes=False, trim_leading_space=False, fields_per_record=0, skip=0) [][]string read all rows from a source string, returning a list of string lists params: source string input string of csv data comma string comma is the field delimiter, defaults to "," (a comma).
Package csv reads comma-separated values files outline: csv csv reads comma-separated values files path: encoding/csv functions: read_all(source, comma=",", comment="", lazy_quotes=False, trim_leading_space=False, fields_per_record=0, skip=0) [][]string read all rows from a source string, returning a list of string lists params: source string input string of csv data comma string comma is the field delimiter, defaults to "," (a comma).
json
Package json defines utilities for converting Starlark values to/from JSON strings.
Package json defines utilities for converting Starlark values to/from JSON strings.
yaml
Package yaml implements a yaml parser for the starlark programming dialect outline: yaml yaml provides functions for working with yaml data path: encoding/yaml functions: dumps(obj) string serialize obj to a yaml string params: obj object input object loads(source) object read a source yaml string to a starlark object params: source string input string of yaml data
Package yaml implements a yaml parser for the starlark programming dialect outline: yaml yaml provides functions for working with yaml data path: encoding/yaml functions: dumps(obj) string serialize obj to a yaml string params: obj object input object loads(source) object read a source yaml string to a starlark object params: source string input string of yaml data
Package geo defines geographic operations outline: geo geo defines geographic operations in two-dimensional space path: geo functions: Point(x,y) Point Point constructor, takes an x(longitude) and y(latitude) value and returns a Point object params: x float x-dimension value (longitude if using geodesic space) y float y-dimension value (latitude if using geodesic space) Line(points) Line Line constructor.
Package geo defines geographic operations outline: geo geo defines geographic operations in two-dimensional space path: geo functions: Point(x,y) Point Point constructor, takes an x(longitude) and y(latitude) value and returns a Point object params: x float x-dimension value (longitude if using geodesic space) y float y-dimension value (latitude if using geodesic space) Line(points) Line Line constructor.
Package hash defines hash primitives for starlark.
Package hash defines hash primitives for starlark.
Package html defines a jquery-like html selection & iteration functions for HTML documents outline: html html defines jquery-like html selection & iteration functions for HTML documents path: html functions: html(markup) selection parse an html document returning a selection at the root of the document params: markup string html text to build a document from types: selection an HTML document for querying methods: attr(name) string gets the specified attribute's value for the first element in the Selection.
Package html defines a jquery-like html selection & iteration functions for HTML documents outline: html html defines jquery-like html selection & iteration functions for HTML documents path: html functions: html(markup) selection parse an html document returning a selection at the root of the document params: markup string html text to build a document from types: selection an HTML document for querying methods: attr(name) string gets the specified attribute's value for the first element in the Selection.
Package http defines a module for doing http operations in starlark outline: http http defines an HTTP client implementation path: http functions: get(url,params={},headers={},auth=()) response perform an HTTP GET request, returning a response params: url string url to request headers dict optional.
Package http defines a module for doing http operations in starlark outline: http http defines an HTTP client implementation path: http functions: get(url,params={},headers={},auth=()) response perform an HTTP GET request, returning a response params: url string url to request headers dict optional.
Package math is a Starlark module of math-related functions and constants.
Package math is a Starlark module of math-related functions and constants.
Package re defines regular expression functions, it's intended to be a drop-in subset of python's re module for starlark: https://docs.python.org/3/library/re.html TODO (b5): compile search, fullmatch, findall, finditer, subn, escape outline: re re defines regular expression functions, it's intended to be a drop-in subset of python's re module for starlark: https://docs.python.org/3/library/re.html path: re functions: compile(pattern) Pattern Compile a regular expression pattern into a regular expression object, which can be used for matching using its match(), search() and other methods.
Package re defines regular expression functions, it's intended to be a drop-in subset of python's re module for starlark: https://docs.python.org/3/library/re.html TODO (b5): compile search, fullmatch, findall, finditer, subn, escape outline: re re defines regular expression functions, it's intended to be a drop-in subset of python's re module for starlark: https://docs.python.org/3/library/re.html path: re functions: compile(pattern) Pattern Compile a regular expression pattern into a regular expression object, which can be used for matching using its match(), search() and other methods.
Package time provides time-related constants and functions.
Package time provides time-related constants and functions.
replacecr
Package replacecr defines a wrapper for replacing solo carriage return characters (\r) with carriage-return + line feed (\r\n)
Package replacecr defines a wrapper for replacing solo carriage return characters (\r) with carriage-return + line feed (\r\n)
Package xlsx implements excel file readers in starlark outline: xlsx xlsx implements excel file readers in starlark.
Package xlsx implements excel file readers in starlark outline: xlsx xlsx implements excel file readers in starlark.
Package zipfile reads & parses zip archives outline: zipfile zipfile reads & parses zip archives path: zipfile functions: ZipFile(data) opens an archive for reading types: ZipFile a zip archive object methods: namelist() list return a list of files in the archive open(filename string) ZipInfo open a file for reading params: filename string name of the file in the archive to open ZipInfo methods: read() string read the file, returning it's string representation Package zipfile defines zipfileimatical functions, it's intended to be a drop-in subset of python's zipfile module for starlark: https://docs.python.org/3/library/zipfile.html
Package zipfile reads & parses zip archives outline: zipfile zipfile reads & parses zip archives path: zipfile functions: ZipFile(data) opens an archive for reading types: ZipFile a zip archive object methods: namelist() list return a list of files in the archive open(filename string) ZipInfo open a file for reading params: filename string name of the file in the archive to open ZipInfo methods: read() string read the file, returning it's string representation Package zipfile defines zipfileimatical functions, it's intended to be a drop-in subset of python's zipfile module for starlark: https://docs.python.org/3/library/zipfile.html

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL