[Mod] Data Access API [0.1][datalib]
- octacian
- Member
- Posts: 597
- Joined: Mon Dec 21, 2015 22:18
- GitHub: octacian
- IRC: octacian
- In-game: octacian
- Location: Canada
[Mod] Data Access API [0.1][datalib]
Data Access API/Library [datalib]
Version 0.1
Licence: MIT (see license.txt)
datalib is an API that makes data interaction simple. Functions include writing and appending to files, writing and reading tables, and more. This mod is still work in progress, and new functionality will be added from time to time, so read the updating instructions below to make sure you always have the latest version.
API
See API.md, also found through the GitHub wiki
Downloads
Version 0.1
Master (most up to date, but often unstable)
Installation and Updates
Unzip the archive, rename the folder to datalib and install just like any other mod.
Version 0.1
Licence: MIT (see license.txt)
datalib is an API that makes data interaction simple. Functions include writing and appending to files, writing and reading tables, and more. This mod is still work in progress, and new functionality will be added from time to time, so read the updating instructions below to make sure you always have the latest version.
API
See API.md, also found through the GitHub wiki
Downloads
Version 0.1
Master (most up to date, but often unstable)
Installation and Updates
Unzip the archive, rename the folder to datalib and install just like any other mod.
Last edited by octacian on Tue Nov 29, 2016 01:49, edited 3 times in total.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.
I'm currently inactive in the Minetest community! So if I don't respond, that's why.
- octacian
- Member
- Posts: 597
- Joined: Mon Dec 21, 2015 22:18
- GitHub: octacian
- IRC: octacian
- In-game: octacian
- Location: Canada
Re: [Mod] Data Access API [0.1][datalib]
A lot (I think). I actually got the idea from datastorage, just I wanted to do it in a more straightforward, simple, and documented way. I think that datalib give the mod developer a lot more control over where and how their data is stored. You could honestly store or access data anywhere using the resources that datalib offers, whereas datastorage seems more limiting. From my understanding, datastorage puts all the data in a type of table, which creates a lot of limitations. However, though datalib automatically creates a directory in the world folder, developers are free to create their own directories or files with datalib.mkdir and datalib.create. To me, this gives a lot more flexibility. It doesn't only allow storing things in the world directory, but you could easily access resources inside the mod directory as well. Overall, I find it to be much more flexible in what you can do. Yes, datastorage still has it's uses, but I find that the flexibility I have in datalib makes it much easier to work with.
Mods Using datalib:
Here are two mods that use datalib, both are written by me, but the point is to see how it can be used, not to show that people actually use it (no one does other than me, as far as I know).
ServerTools (WIP, but functional) - genesis.lua, filter.lua
digicompute (WIP, not functional) - api.lua
PS: I've won every round of Hungry Games I've been in for the past month, except for when I voluntarily quit because I started to feel bad for everyone else.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.
I'm currently inactive in the Minetest community! So if I don't respond, that's why.
- Wuzzy
- Member
- Posts: 4918
- Joined: Mon Sep 24, 2012 15:01
- GitHub: Wuzzy2
- IRC: Wuzzy
- In-game: Wuzzy
- Contact:
Re: [Mod] Data Access API [0.1][datalib]
Would you say your mod is ready enough to be used by other people or is the API still too much in flux?
-
- Member
- Posts: 818
- Joined: Tue Apr 14, 2015 01:59
- GitHub: raymoo
- IRC: Hijiri
- In-game: Raymoo + Clownpiece
Re: [Mod] Data Access API [0.1][datalib]
When is minetest.mkdir unavailable?
EDIT: You should also use mkdir -p instead of just mkdir in your os call, so it will create parent directories.
EDIT: You should also use mkdir -p instead of just mkdir in your os call, so it will create parent directories.
Every time a mod API is left undocumented, a koala dies.
- octacian
- Member
- Posts: 597
- Joined: Mon Dec 21, 2015 22:18
- GitHub: octacian
- IRC: octacian
- In-game: octacian
- Location: Canada
Re: [Mod] Data Access API [0.1][datalib]
I don't know if it is ever unavailable. I figured that section out from datastorage (take a look, it's nearly the same). So, though it might not ever be unavailable, I would guess it's something along the lines of "better be safe than sorry."Byakuren wrote:When is minetest.mkdir unavailable?
EDIT: You should also use mkdir -p instead of just mkdir in your os call, so it will create parent directories.
Thanks, I hadn't though about mkdir -p. However, does that work on Windows? If so, I'll throw that in.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.
I'm currently inactive in the Minetest community! So if I don't respond, that's why.
-
- Member
- Posts: 818
- Joined: Tue Apr 14, 2015 01:59
- GitHub: raymoo
- IRC: Hijiri
- In-game: Raymoo + Clownpiece
Re: [Mod] Data Access API [0.1][datalib]
I don't know, sorry.endev15 wrote:However, does that work on Windows? If so, I'll throw that in.
Every time a mod API is left undocumented, a koala dies.
- octacian
- Member
- Posts: 597
- Joined: Mon Dec 21, 2015 22:18
- GitHub: octacian
- IRC: octacian
- In-game: octacian
- Location: Canada
Re: [Mod] Data Access API [0.1][datalib]
How did I never notice your question? The mod itself is stable, it's in Mod Releases. However, I'm adjusting the API and adding a few new things, so I wouldn't recommend using it until v0.2. Any changes past that will probably keep backwards compatibility, if needed, but will most likely be new features. And yeah, IK the D/L / Git link is down. I'm working on switching from Gogs to GitLab, and it'll be up tomorrow.Wuzzy wrote:Would you say your mod is ready enough to be used by other people or is the API still too much in flux?
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.
I'm currently inactive in the Minetest community! So if I don't respond, that's why.
- Milan*
- Member
- Posts: 255
- Joined: Thu May 28, 2015 06:45
- GitHub: tchncs
- IRC: Passant
- In-game: Milan Passant
- Location: Germany
- Contact:
Re: [Mod] Data Access API [0.1][datalib]
Your certificate is expired. ...and the git looks removed. ....and the base url redirects to https://actionparty.ca/ ... :/
- octacian
- Member
- Posts: 597
- Joined: Mon Dec 21, 2015 22:18
- GitHub: octacian
- IRC: octacian
- In-game: octacian
- Location: Canada
Re: [Mod] Data Access API [0.1][datalib]
As I said, it is currently down (sorry). I'm switching to GitLab ATM. I'll make the old thing available though, until I'm sure gitlab is going and everything's working.Milan* wrote:Your certificate is expired. ...and the git looks removed. ....and the base url redirects to https://actionparty.ca/ ... :/
IK the certificate has expired, I'm working on that.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.
I'm currently inactive in the Minetest community! So if I don't respond, that's why.
- Milan*
- Member
- Posts: 255
- Joined: Thu May 28, 2015 06:45
- GitHub: tchncs
- IRC: Passant
- In-game: Milan Passant
- Location: Germany
- Contact:
Re: [Mod] Data Access API [0.1][datalib]
Oh, i am sorry, didn't read all the threadanswers.
- octacian
- Member
- Posts: 597
- Joined: Mon Dec 21, 2015 22:18
- GitHub: octacian
- IRC: octacian
- In-game: octacian
- Location: Canada
Re: [Mod] Data Access API [0.1][datalib]
Certificates renewed, and git service back up. I might just stick with Gogs for now, if I can talk one of the devs into adding the ability to attach files to released :D
GitLab is pretty complex anyways, if I can get it going though, I might. Right now it says emails sent (log does too), but I never get them.
Anyways, it's all back up right here.
GitLab is pretty complex anyways, if I can get it going though, I might. Right now it says emails sent (log does too), but I never get them.
Anyways, it's all back up right here.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
I'm currently inactive in the Minetest community! So if I don't respond, that's why.
I'm currently inactive in the Minetest community! So if I don't respond, that's why.
- Milan*
- Member
- Posts: 255
- Joined: Thu May 28, 2015 06:45
- GitHub: tchncs
- IRC: Passant
- In-game: Milan Passant
- Location: Germany
- Contact:
Re: [Mod] Data Access API [0.1][datalib]
Interesting, looks like i forgot to edit my gitlab mailsettings completly in the past, but everything is working just fine. :o :D
Thanks for bringing your repo back online. :)
Thanks for bringing your repo back online. :)