Skip to content

cosysun/FastDFSClient_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastDFS Client for Python

Server 版本:6.01

How to Compile

编译环境:Ubuntu 18.04,以下步骤仅供参考:

  1. 安装libfastcommonfastdfs环境;

  2. 安装python3-dev依赖(提供Python.h文件);

  3. 编译生成FDFSPythonClient.so文件。

一种可能的编译步骤:

readonly LIBFASTCOMMON_VERSION=1.0.41
readonly FASTDFS_VERSION=6.01

readonly LIBFASTCOMMON_DIR_NAME="libfastcommon-${LIBFASTCOMMON_VERSION}"
readonly FASTDFS_DIR_NAME="fastdfs-${FASTDFS_VERSION}"
readonly FASTDFS_CLIENT_DIR_NAME="FastDFSClient_Python"

## install requirements programmes
sudo apt install wget tar make gcc-4.8 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 40
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 40

# install libfastcommon
cd /usr/local/src/
sudo wget "https://github.com/happyfish100/libfastcommon/archive/V${LIBFASTCOMMON_VERSION}.tar.gz"
sudo tar xf "V${LIBFASTCOMMON_VERSION}.tar.gz"
cd "${LIBFASTCOMMON_DIR_NAME}"
sudo ./make.sh && sudo ./make.sh install

# install fastdfs
cd ../
sudo wget "https://github.com/happyfish100/fastdfs/archive/V${FASTDFS_VERSION}.tar.gz"
sudo tar xf "V${FASTDFS_VERSION}.tar.gz"
cd "${FASTDFS_DIR_NAME}"
sudo ./make.sh && sudo ./make.sh install

# install FastDFS Python Client
sudo apt install python3-dev g++-4.8 -y
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 40

cd ../
sudo git clone https://github.com/cosysun/FastDFSClient_Python.git --depth 1
cd FastDFSClient_Python/python_client
sudo make install

详细说明请看:《FastDFS客户端(Python版)指南》《接口说明文档》

Revision History

  • 2019.10.31 ver 4.1.0
    • 适配了fastdfs 6.01版本
    • 升级了Python接口,无需将file_id分解为group_namefile_name
  • 2019.9.18 ver 3.1.0

    • 增加了get_file_info接口
  • 2019.7.20 ver 3.0.1

    • 修复了拼写错误:destorydestroy
  • 2019.7.19 ver 3.0.0

    • 移除了对jsoncpp的依赖
    • 更新了list_groupslist_one_grouplist_servers方法。
  • 2019.7.3 ver 2.2.2

    • 完善了错误日志输出信息
  • 2019.7.1 ver 2.2.1

    • 兼容了Python 2.7
  • 2019.6.28 ver 2.2.0

    • 增加了upload_appender接口
    • 增加了append_file接口
    • 修改了其他接口名,如slave_upload接口修改为upload_slave
  • 2019.6.27 ver 2.1.0

    • 升级了fdfs_init方法,支持日志输出和关键字可选传参
  • 2019.6.14 ver 2.0.0

    • 移除了对Python 2的支持
    • 移除了对jsoncpp自行编译的依赖
    • 完善了对Python 3.6的编译依赖
  • 2018.3.18 ver 1.2.0

    • 增加了对python3.6的支持
  • 2015.4.13 ver 1.1.0

    • 增加了slave_upload接口
  • 2015.2.28 ver 1.0.0

    • 初始版本