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

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

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

by octacian » Thu Aug 11, 2016 15:12

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.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

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

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

by Wuzzy » Thu Aug 11, 2016 15:50

How does this differ from datastorage?

https://github.com/minetest-technic/datastorage
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

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

by octacian » Thu Aug 11, 2016 18:06

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.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

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

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

by Wuzzy » Thu Aug 11, 2016 21:33

Would you say your mod is ready enough to be used by other people or is the API still too much in flux?
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

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

by Byakuren » Thu Aug 11, 2016 21:35

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: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

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

by octacian » Thu Aug 11, 2016 22:04

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.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

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

by Byakuren » Thu Aug 11, 2016 23:06

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: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

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

by octacian » Tue Nov 01, 2016 14:35

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.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

User avatar
Milan*
Member
 
Posts: 203
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant

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

by Milan* » Tue Nov 01, 2016 19:00

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

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

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

by octacian » Wed Nov 02, 2016 02:45

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.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

User avatar
Milan*
Member
 
Posts: 203
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant

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

by Milan* » Wed Nov 02, 2016 07:19

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

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

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

by octacian » Thu Nov 03, 2016 18:46

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.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

User avatar
Milan*
Member
 
Posts: 203
Joined: Thu May 28, 2015 06:45
GitHub: tchncs
IRC: Passant
In-game: Milan Passant

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

by Milan* » Fri Nov 04, 2016 07:30

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


Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 56 guests