yuxianzhi / FS-API

unified interface for file system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

File System Python API

Unified interface for file system, An wrapper to compat some common file system.

We can only support hdfs and file protocol at present.

Standard

Standard to use: ://<absolute_path>

@startuml

actor User
User --> [ file_system ]

note right of [ file_system ]
    open()
    close()
    read()
    readline()
    readlines()
    write()
    writeline()
    writelines()
    copy()
    exists()
    remove()
    listdir()
end note

package file {
     component 本地文件系统函数{
         control pythonos模块
    }
}
package hdfs {
     component hdfs文件系统函数{
         control pythonhdfs模块
    }
}
[ file_system ] -> file
[ file_system ] -> hdfs

local file system

  • standard: file://<absolute_path>

  • example: file:///home/ts/test.txt

hdfs

  • standard: hdfs://[<ip|hostname>:]<absolute_path>

  • example: hdfs://10.147.20.122:50070/user/ts/test.txt

How to use

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

About

unified interface for file system


Languages

Language:Python 100.0%