[Mod] Data Access API [0.1][datalib]

Post Reply
User avatar
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]

by octacian » Post

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.
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.

User avatar
Wuzzy
Member
Posts: 4804
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Data Access API [0.1][datalib]

by Wuzzy » Post

How does this differ from datastorage?

https://github.com/minetest-technic/datastorage

User avatar
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]

by octacian » Post

Wuzzy wrote:How does this differ from datastorage?

https://github.com/minetest-technic/datastorage
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.

User avatar
Wuzzy
Member
Posts: 4804
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Data Access API [0.1][datalib]

by Wuzzy » Post

Would you say your mod is ready enough to be used by other people or is the API still too much in flux?

Byakuren
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]

by Byakuren » Post

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.
Every time a mod API is left undocumented, a koala dies.

User avatar
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]

by octacian » Post

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.
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."

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.

Byakuren
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]

by Byakuren » Post

endev15 wrote:However, does that work on Windows? If so, I'll throw that in.
I don't know, sorry.
Every time a mod API is left undocumented, a koala dies.

User avatar
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]

by octacian » Post

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?
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.
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.

User avatar
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]

by Milan* » Post

Your certificate is expired. ...and the git looks removed. ....and the base url redirects to https://actionparty.ca/ ... :/

User avatar
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]

by octacian » Post

Milan* wrote:Your certificate is expired. ...and the git looks removed. ....and the base url redirects to https://actionparty.ca/ ... :/
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.

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.

User avatar
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]

by Milan* » Post

Oh, i am sorry, didn't read all the threadanswers.

User avatar
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]

by octacian » Post

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.
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.

User avatar
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]

by Milan* » Post

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. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests