Skip to main content

Browse python objects as if they were files on disk

Project description

Coverage Travis CI Latest Version https://img.shields.io/pypi/wheel/pyos.svg https://img.shields.io/pypi/pyversions/pyos.svg https://img.shields.io/pypi/l/pyos.svg

A fresh way to interact with your python objects as though they were files on your filesystem.

Installation

As easy as:

  1. Install MongoDB

    Ubuntu:

sudo apt install mongodb
  1. Install pyos:

pip install pyos

Usage example

> ipython

In [1]: from pyos.pyos import *
In [2]: ls()

[4]:
import mincepy
import urllib.request
import json

ids = []
with urllib.request.urlopen('https://raw.githubusercontent.com/ozlerhakan/mongodb-json-files/master/datasets/restaurant.json') as url:
    for line, _ in zip(url, range(399)):
        data = json.loads(line.decode())
        data.pop('_id')
        ids.append(mincepy.Dict(data).save())

Supported by

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