Skip to main content

read, write, scan in json

Project description

Filez

Get Started

import filez
filez.ID = "MYPROJECTID" # http://magma-mc.net/projects.php/
filez.DEVELOPER =  False # Prints To Console

Fwrite

thejson = {"hello": "World!"}
thejson2 = {"hello": "there!"}

filez.fwrite('testfile.json', json.dumps(thejson))

filez.fwrite('testfile2.json', json.dumps(thejson2))

Fread

print(filez.fread('testfile.json')) 
# prints {"hello": "World!"}
print(filez.fread('testfile2.json')) 
# prints {"hello": "there!"}

Scan

print(filez.scan('/')) 
# prints ['testfile.json', 'testfile2.json']

print(filez.scan('/', True)) 
# prints {'testfile.json': '{"hello": "World!"}', 'testfile2.json': '{"hello": "there!"}'}

Send

thejson = {
    'HelloWorld': 'Hi!',
	'HelloThere': 'Hello!'
}

filez.fwrite('testfile3.json', json.dumps(thejson))

print(filez.fread('testfile3.json'))
# prints {'HelloWorld': 'Hi!', 'HelloThere': 'Hello!'}

filez.send('testfile3.json', 'Bonjour', 'HelloWorld')

print(filez.fread('testfile3.json'))
# prints {'HelloWorld': 'Bonjour!', 'HelloThere': 'Hello!'}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

filez_MagmaMc-1.0.2.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

filez_MagmaMc-1.0.2-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page