# jasminum
an implementation of the data analytics programming language jasmine powered by [Polars](https://pola.rs/)
## Installation
```
pip install jasminum
```
## Start a jasminum Process
`jasminum`
## Data Type
### Scalar
| name | examples |
| --------- | ------------------------------------ |
| Null | 0n, null |
| BOOLEAN | 1b, 0b, true, false |
| INT | 42 |
| DATE | YYYY-MM-DD |
| TIME | HH:mm:ss.sss |
| DATETIME | YYYY-MM-DD[T]HH:mm:ss.sss |
| TIMESTAMP | YYYY-MM-DD[D]HH:mm:ss.sssssssss |
| DURATION | 00000[D]HH:mm:ss.sss,1ns,1s,1m,1h,1D |
| FLOAT | 4.2, inf, -inf |
| STRING | "string" |
| CAT | `cat, 'cat' |
`datetime` and `timestamp` are with timezone information. To convert a timezone
- `` t ~tz `Asia/Hong_Kong ``
- `` tz(t, `Asia/Hong_Kong) ``
### List(Mixed Data Types)
```
l[1, null, `cat]
```
### Series
| name | data type |
| --------- | -------------- |
| bool | Boolean |
| f32 | Float32 |
| f64 | Float64 |
| i8 | Int8 |
| i16 | Int16 |
| i32 | Int32 |
| i64 | Int64 |
| u8 | UInt8 |
| u16 | UInt16 |
| u32 | UInt32 |
| u64 | UInt64 |
| date | Date |
| datetime | Datetime("ms") |
| timestamp | Datetime("ns") |
| duration | Duration |
| time | Time |
| string | String |
| cat | Categorical |
| list | List |
| unknown | Unknown |
```
// empty series
`i8$[]
// non-empty series
// i64
1 0n -1
// i8
[0i8, 1, 2]
// u8
0n 1u8 3
// bool
1b 0b 1b 0n
[true, null, false]
// cats
`a`b`c
['c','d',null]
```
### Dataframe
a collection of series
```
// empty series
df[series1= `i32$[], series2= `f32$[]]
// non-empty series
df[series1 = `i32$[ , , ], series2 = `f32$[null, 2.0, 3.0]]
df[series1 = [0i32, , ], series2 = [null, 2.0, 3.0]]
```
### Matrix (nyi)
a 2d float array
```
// empty matrix
x[[], [], []]
// non-empty matrix
x[[1, 2], [2, 3], [4, null]]
```
### Dictionary
```
// empty map
{}
// non-empty map
{a:1, b:2, c:3}
dict(`a`b`c, 1 2 3)
```
### Variable Name
- Starts with alphabets, the var name can include alphabets, number and "\_"
- Starts with CJK character, the var name can include CJK character, alphabets, number and "\_"
### Control Flow
```
if(condition) {
statement1;
statement2;
}
while(condition) {
statement1;
statement2;
}
```
### Error Handling
```
try {
statement1;
statement2;
} catch (err) {
statement1;
statement2;
}
```
### Function
```
fn(param1, param2, ...){
statement1;
statement2;
return statement3;
raise "err";
}
```
### Function Call
```
fn(arg1, arg2, ...)
```
### Functional Call with Parted Args
fn2 is a function requires 2 arguments
```
fn2(arg1)
fn2(, arg2)
```
## Expression
### SQL
```
[select | update | delete] series1, series2, ...
[
by series1, series2, ...
| dyn unit, series1, series2, ...
| rolling unit, series1, series2, ...
]
from table
[ where condition1, condition2, ...]
[ sort {series1, -series2, ...} ]
[ take number ]
// functional query
// select
sel(dataframe, exprs, exprs, exprs)
// update
upd(dataframe, exprs, exprs, exprs)
// delete, no group by parameter
del(dataframe, exprs, exprs)
```
### Assignment
```
var1 = exp1
```
### Unary Operation
```
var1 var2
var1(var2)
```
### Binary Operation
```
var1 ~fn0 var2
fn0(var1, var2)
```
### Iteration
#### Each
```
var1 ~each series1
var1 ~each list1
var1 ~each dataframe1
// apply each for 1st param
f2(var1) ~each var2
// apply each for 2nd param
f2(,var2) ~each var1
```
Raw data
{
"_id": null,
"home_page": null,
"name": "jasminum",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "jasmine, jasminum, polars, dataframe, arrow",
"author": "the Jasmine authors",
"author_email": null,
"download_url": null,
"platform": null,
"description": "# jasminum\n\nan implementation of the data analytics programming language jasmine powered by [Polars](https://pola.rs/)\n\n## Installation\n\n```\npip install jasminum\n```\n\n## Start a jasminum Process\n\n`jasminum`\n\n## Data Type\n\n### Scalar\n\n| name | examples |\n| --------- | ------------------------------------ |\n| Null | 0n, null |\n| BOOLEAN | 1b, 0b, true, false |\n| INT | 42 |\n| DATE | YYYY-MM-DD |\n| TIME | HH:mm:ss.sss |\n| DATETIME | YYYY-MM-DD[T]HH:mm:ss.sss |\n| TIMESTAMP | YYYY-MM-DD[D]HH:mm:ss.sssssssss |\n| DURATION | 00000[D]HH:mm:ss.sss,1ns,1s,1m,1h,1D |\n| FLOAT | 4.2, inf, -inf |\n| STRING | \"string\" |\n| CAT | `cat, 'cat' |\n\n`datetime` and `timestamp` are with timezone information. To convert a timezone\n\n- `` t ~tz `Asia/Hong_Kong ``\n- `` tz(t, `Asia/Hong_Kong) ``\n\n### List(Mixed Data Types)\n\n```\nl[1, null, `cat]\n```\n\n### Series\n\n| name | data type |\n| --------- | -------------- |\n| bool | Boolean |\n| f32 | Float32 |\n| f64 | Float64 |\n| i8 | Int8 |\n| i16 | Int16 |\n| i32 | Int32 |\n| i64 | Int64 |\n| u8 | UInt8 |\n| u16 | UInt16 |\n| u32 | UInt32 |\n| u64 | UInt64 |\n| date | Date |\n| datetime | Datetime(\"ms\") |\n| timestamp | Datetime(\"ns\") |\n| duration | Duration |\n| time | Time |\n| string | String |\n| cat | Categorical |\n| list | List |\n| unknown | Unknown |\n\n```\n// empty series\n`i8$[]\n\n// non-empty series\n// i64\n1 0n -1\n\n// i8\n[0i8, 1, 2]\n\n// u8\n0n 1u8 3\n\n// bool\n1b 0b 1b 0n\n[true, null, false]\n\n// cats\n`a`b`c\n['c','d',null]\n```\n\n### Dataframe\n\na collection of series\n\n```\n// empty series\ndf[series1= `i32$[], series2= `f32$[]]\n\n\n// non-empty series\ndf[series1 = `i32$[ , , ], series2 = `f32$[null, 2.0, 3.0]]\ndf[series1 = [0i32, , ], series2 = [null, 2.0, 3.0]]\n```\n\n### Matrix (nyi)\n\na 2d float array\n\n```\n// empty matrix\nx[[], [], []]\n\n// non-empty matrix\nx[[1, 2], [2, 3], [4, null]]\n```\n\n### Dictionary\n\n```\n// empty map\n{}\n\n// non-empty map\n{a:1, b:2, c:3}\ndict(`a`b`c, 1 2 3)\n```\n\n### Variable Name\n\n- Starts with alphabets, the var name can include alphabets, number and \"\\_\"\n- Starts with CJK character, the var name can include CJK character, alphabets, number and \"\\_\"\n\n### Control Flow\n\n```\nif(condition) {\n statement1;\n statement2;\n}\n\nwhile(condition) {\n statement1;\n statement2;\n}\n```\n\n### Error Handling\n\n```\ntry {\n statement1;\n statement2;\n} catch (err) {\n statement1;\n statement2;\n}\n\n```\n\n### Function\n\n```\nfn(param1, param2, ...){\n statement1;\n statement2;\n return statement3;\n raise \"err\";\n}\n```\n\n### Function Call\n\n```\nfn(arg1, arg2, ...)\n```\n\n### Functional Call with Parted Args\n\nfn2 is a function requires 2 arguments\n\n```\nfn2(arg1)\nfn2(, arg2)\n```\n\n## Expression\n\n### SQL\n\n```\n[select | update | delete] series1, series2, ...\n [\n by series1, series2, ...\n | dyn unit, series1, series2, ...\n | rolling unit, series1, series2, ...\n ]\n from table\n [ where condition1, condition2, ...]\n [ sort {series1, -series2, ...} ]\n [ take number ]\n\n// functional query\n// select\nsel(dataframe, exprs, exprs, exprs)\n// update\nupd(dataframe, exprs, exprs, exprs)\n// delete, no group by parameter\ndel(dataframe, exprs, exprs)\n```\n\n### Assignment\n\n```\nvar1 = exp1\n```\n\n### Unary Operation\n\n```\nvar1 var2\nvar1(var2)\n```\n\n### Binary Operation\n\n```\nvar1 ~fn0 var2\nfn0(var1, var2)\n```\n\n### Iteration\n\n#### Each\n\n```\nvar1 ~each series1\nvar1 ~each list1\nvar1 ~each dataframe1\n\n// apply each for 1st param\nf2(var1) ~each var2\n// apply each for 2nd param\nf2(,var2) ~each var1\n```\n\n",
"bugtrack_url": null,
"license": null,
"summary": "an implementation of the data analytics programming language jasmine",
"version": "0.3.2",
"project_urls": {
"Repository": "https://github.com/hinmeru/jasmine"
},
"split_keywords": [
"jasmine",
" jasminum",
" polars",
" dataframe",
" arrow"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f347243e1ab5cc92af421105aa7a4be35b4ff1d50b28652d95d9ce0cf41017c4",
"md5": "fe646db8c51c8bfee154275c4da2b7cb",
"sha256": "923b5949e737383c80cf491af1331eadd7c19d14595083f5b51d78e5e534de43"
},
"downloads": -1,
"filename": "jasminum-0.3.2-cp311-cp311-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "fe646db8c51c8bfee154275c4da2b7cb",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11",
"size": 5235777,
"upload_time": "2024-12-19T13:18:01",
"upload_time_iso_8601": "2024-12-19T13:18:01.077533Z",
"url": "https://files.pythonhosted.org/packages/f3/47/243e1ab5cc92af421105aa7a4be35b4ff1d50b28652d95d9ce0cf41017c4/jasminum-0.3.2-cp311-cp311-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "58fa58ea825275ca52856ad45dd77f54645050e0bb79ec2f48a201066a3d87d2",
"md5": "ee606c377a5ac4889c707a82cb7fd5d0",
"sha256": "1b85390db993bd5f9db2ba064c55087706a9d2debd5c1923471d5e7981b1f2c5"
},
"downloads": -1,
"filename": "jasminum-0.3.2-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "ee606c377a5ac4889c707a82cb7fd5d0",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11",
"size": 5694340,
"upload_time": "2024-12-19T13:18:03",
"upload_time_iso_8601": "2024-12-19T13:18:03.195874Z",
"url": "https://files.pythonhosted.org/packages/58/fa/58ea825275ca52856ad45dd77f54645050e0bb79ec2f48a201066a3d87d2/jasminum-0.3.2-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1cf207ff69cb7d1703e1d9ac0943d383b6032faff28cc0e2fe1c40ea4d70cfa2",
"md5": "8e59a794b4003ee725cd9f321ce00dd7",
"sha256": "9c924e8a2b8ae7b092490970c0b6838f9adaf848483c08b41d5e8423e62fd515"
},
"downloads": -1,
"filename": "jasminum-0.3.2-cp312-cp312-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "8e59a794b4003ee725cd9f321ce00dd7",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.11",
"size": 5232460,
"upload_time": "2024-12-19T13:18:06",
"upload_time_iso_8601": "2024-12-19T13:18:06.468469Z",
"url": "https://files.pythonhosted.org/packages/1c/f2/07ff69cb7d1703e1d9ac0943d383b6032faff28cc0e2fe1c40ea4d70cfa2/jasminum-0.3.2-cp312-cp312-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "21d315518273f08220f6d776eb2ae1e1f78434e425ced254cbfccf536dc91be4",
"md5": "88aa36020d5134d320bc07bc3d4d2588",
"sha256": "a91f7e04133471c758409c0d10e7c22110b7965d27a3223ee58e8d231d9f48f2"
},
"downloads": -1,
"filename": "jasminum-0.3.2-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "88aa36020d5134d320bc07bc3d4d2588",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.11",
"size": 5690816,
"upload_time": "2024-12-19T13:18:08",
"upload_time_iso_8601": "2024-12-19T13:18:08.574981Z",
"url": "https://files.pythonhosted.org/packages/21/d3/15518273f08220f6d776eb2ae1e1f78434e425ced254cbfccf536dc91be4/jasminum-0.3.2-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e4bf939f3a9592743f16bdc8d20132163c603cbc46e3a7f55fd001983d8e6025",
"md5": "3169e90e102759d288353e6233d5ed2b",
"sha256": "76aa374732cce5c102aa8c59fba6fb7de2b4a53c7921630632c8dbd8bd628f27"
},
"downloads": -1,
"filename": "jasminum-0.3.2-cp313-cp313-manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "3169e90e102759d288353e6233d5ed2b",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.11",
"size": 5232914,
"upload_time": "2024-12-19T13:18:11",
"upload_time_iso_8601": "2024-12-19T13:18:11.903129Z",
"url": "https://files.pythonhosted.org/packages/e4/bf/939f3a9592743f16bdc8d20132163c603cbc46e3a7f55fd001983d8e6025/jasminum-0.3.2-cp313-cp313-manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e2b4bb9eb3ced759821f9f9c4b4e323404d884ac704de4d97603d09edc6cd434",
"md5": "ad20e83322c2ca1e8dd6c6be0ad9d538",
"sha256": "20ed6921af1f9f1a5760f04a0886169c3b77be11e94f47fa867a4daf105454f1"
},
"downloads": -1,
"filename": "jasminum-0.3.2-cp313-cp313-win_amd64.whl",
"has_sig": false,
"md5_digest": "ad20e83322c2ca1e8dd6c6be0ad9d538",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.11",
"size": 5690690,
"upload_time": "2024-12-19T13:18:14",
"upload_time_iso_8601": "2024-12-19T13:18:14.903768Z",
"url": "https://files.pythonhosted.org/packages/e2/b4/bb9eb3ced759821f9f9c4b4e323404d884ac704de4d97603d09edc6cd434/jasminum-0.3.2-cp313-cp313-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-19 13:18:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hinmeru",
"github_project": "jasmine",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "jasminum"
}