starlib

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: MIT Imports: 13 Imported by: 0

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's 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
encoding/base64 Go Docs base64 de/serialization
encoding/csv Go Docs csv de/serialization
encoding/json Go Docs json de/serialization
geo Go Docs html text processing
html Go Docs html text processing
http Go Docs http client operations
math Go Docs mathematical functions & values
re Go Docs regular expressions
time Go Docs time operations
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.3.2"

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
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 implements a json parser for the starlark programming dialect outline: json json provides functions for working with json data path: encoding/json functions: dumps(obj) string serialize obj to a JSON string params: obj object input object loads(source) object read a source JSON string to a starlark object params: source string input string of json data
Package json implements a json parser for the starlark programming dialect outline: json json provides functions for working with json data path: encoding/json functions: dumps(obj) string serialize obj to a JSON string params: obj object input object loads(source) object read a source JSON string to a starlark object params: source string input string of json data
Package geo defines geographic operations outline: geo geo defines geographic operations in two-dimensional space 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 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 html defines a jquery-like html selection & iteration functions for HTML documents outline: html html defines a jquery-like html selection & iteration functions for HTML documents functions: html(markup) selection parse an html document returing 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 a jquery-like html selection & iteration functions for HTML documents functions: html(markup) selection parse an html document returing 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 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 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 defines mathematical functions, it's intended to be a drop-in subset of python's math module for starlark: https://docs.python.org/3/library/math.html Currently defined functions are as follows: outline: math math defines mathematical functions, it's intended to be a drop-in subset of python's math module for starlark: https://docs.python.org/3/library/math.html functions: ceil(x) Return the ceiling of x, the smallest integer greater than or equal to x.
Package math defines mathematical functions, it's intended to be a drop-in subset of python's math module for starlark: https://docs.python.org/3/library/math.html Currently defined functions are as follows: outline: math math defines mathematical functions, it's intended to be a drop-in subset of python's math module for starlark: https://docs.python.org/3/library/math.html functions: ceil(x) Return the ceiling of x, the smallest integer greater than or equal to x.
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 functions: findall(pattern, text, flags=0) Returns all non-overlapping matches of pattern in string, as a list of strings.
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 functions: findall(pattern, text, flags=0) Returns all non-overlapping matches of pattern in string, as a list of strings.
Package time defines time primitives for starlark, based heavily on the time package from the go standard library.
Package time defines time primitives for starlark, based heavily on the time package from the go standard library.
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 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 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