0%

WireGuard连接方式的配置文件

下载下来的源文件上这样

1
2
3
4
5
6
7
8
9
10
11
12
13
14
'''
#
# Use this configuration with WireGuard client
#
[Interface]
Address = 10.14.0.2/16
PrivateKey = <insert_your_private_key_here>
DNS = 162.252.172.57, 149.154.159.92
[Peer]
PublicKey = OoFY46j/w4uQFyFu/OQ/h3x+ymJ1DJ4UR1fwGNxOxk0=
AllowedIPs = 0.0.0.0/0
Endpoint = 103.176.152.200:51820
'''
# 下载的文件需要修改PrivateKey = my_key
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#_python3@windows _#
#_date:2023-12-17_#
#_修改wireguard应用的配置文件_#
#_encoding = utf-8_#

import os, re


def modify_wireguard_config():
'''
修改VPN_WireGuard连接方式的配置文件。
读取源文件,同时创建新文件
遍历源文件的行,用re.sub(old_word,new_word,str) ,同时逐行写入新文件。
删除源文件,更名新文件名为源文件名
'''
fd = r"C:\Users\xiaoyx\Downloads"
files = [f"{fd}\{i}" for i in os.listdir(fd) if re.search(r'.conf$', i)]
w1 = '<insert_your_private_key_here>'
w2 = 'mKTo/XWQemHxEDJxfDaNvcFwB4R42WQDtV7ZURUitWg='
for file in files:
with open(file, 'r',
encoding='utf-8') as file1, open(f'{file}.bak',
'w',
encoding='utf-8') as file2:
for line in file1:
file2.write(re.sub(w1, w2, line))
os.remove(file)
os.rename(f'{file}.bak', file)


if __name__ == '__main__':
modify_wireguard_config()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#_python3@linux _#
#_date:2023-12-17_#
#_encoding = utf-8_#
#_修改wireguard应用的配置文件_#
#-----------------------------------------------

import os, re, stat


def writing_wg0_conf(base):
ext = '.conf'
filename = base + ext
downfold = '/home/xiaoyx/下载'
downfile = os.path.join(downfold, filename)
dct = {}
with open(downfile, 'r', encoding='utf-8') as file:
rows = file.readlines()
for row in rows:
if '=' in row:
ls = row.split(' = ', 1)
dct.update({ls[0]: re.sub('\n', '', ls[1])})
rows1 = ['[Interface]\n', 'ListenPort = 49852\n']
rows2 = ['[Peer]\n', 'PersistentKeepalive = 25\n']
wd1 = '<insert_your_private_key_here>'
wd2 = 'mKTo/XWQemHxEDJxfDaNvcFwB4R42WQDtV7ZURUitWg='
for k, v in dct.items():
str = k + ' = ' + v + '\n'
if k in ['Address', 'PrivateKey', 'DNS']:
str = re.sub(wd1, wd2, str)
rows1.append(str)
else:
rows2.append(str)
rows = rows1 + rows2
with open(r'/etc/wireguard/wg0.conf', 'w', encoding='utf-8') as f:
f.writelines(rows)

if __name__ == "__main__":
base = input('输⼊下载的配置⽂件名,如 uk-man')
writing_wg0_conf(base)


Manjaro_kde 的安装与配置

安装

制作安装启动盘

  1. 制作 ventoy 启动盘
  2. 下载最新的 mnjaro-kde 安装包 .iso 格式
  3. 将 manjaro*.iso 拷贝到启动盘

开始安装

  1. 启动 Pc,按 F12 ,选择 U 盘启动
  2. 选择 manjaro-kde,设置安装界面的语言和安装位置
  3. 设置区域和时间,设置用户名和密码到安装完毕

系统基本配置

更换成镜像源

  1. sudo pacman-mirrors -i -c China -m rank
  2. 弹出对话框后选择一个最快的源,并确认。
  3. sudo nano /etc/pacman.conf # 修改 pacman.conf
  4. 末尾添加内容
1
2
3
4
5
6
7
8
9
10
11
12
[archlinuxcn]
SigLevel = Optional TrustAll
#中科大源
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch


#清华源
#Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/

$arch
# 阿里源
#Server = https://mirrors.aliyun.com/manjaro/$arch
  1. 安装 archlinuxcn 签名钥匙
1
2
sudo pacman -Syy
sudo pacman -S archlinuxcn-keyring
  1. 更新库
1
sudo pacman -Syy

更换 pip 的库源

1
2
3
4
5
6
7
8
9
10
11
12
13
14
sudo mkdir ~/.pip
sudo nano ~/.pip/pip.conf

# 新建配置文件内容:
[global]
#阿里云
#index-url = https://mirrors.aliyun.com/pypi/simple/

#中国科技大学
#index-url = https://pypi.mirrors.ustc.edu.cn/simple/

#清华大学
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/

更新系统及已经安装的 APP

1
sudo pacman -Syyu

安装中文输入法 fcitx5 框架 fcitx5-lua

  1. 安装
1
2
3
4
5
6
# 全家桶 fcitx5-im,包含了fcitx5,fcits5-qt,fcitx5-gtk,fcitx5-configtool
sudo pacman -S fcitx5-im
sudo pacman -S fcitx5-chinese-addons
sudo pacman -S fcitx5-material-color
sudo pacman -S kcm-fcitx5
sudo pacman -S fcitx5-lua
  1. 配置
1
2
3
4
5
6
7
8
9
10
11
sudo naao /etc/environment

# -----添加内容-----
GTK_IM_MODULE DEFAULT=fcitx
QT_IM_MODULE DEFAULT=fcitx
XMODIFIERS DEFAULT=@im=fcitx
INPUT_METHOD DEFAULT=fcitx
SDL_IM_MODULE DEFAULT=fcitx

#----重启 Pc-----
sudo reboot
  1. 外观配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
sudo chmod 777 ~/.config/fcitx5/conf/classicui.conf
nano ~/.config/fcitx5/conf/classicui.conf


# -----添加以下内容到文末-----

# 垂直候选列表
Vertical Candidate List=False
# 按屏幕 DPI 使用
PerScreenDPI=True
# Font (设置成你喜欢的字体)
Font="思源黑体 CN Medium 13"
# 主题
Theme=Material-Color-DeepPurple

安装中文字体

1
2
3
4
5
6
# 同时安装多个字体
sudo pacman -S wqy-bitmapfont wqy-microhei wqy-zenhei wqy-microhei-lite

# 可安装更多选用字体
sudo pacman -S adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts noto-fonts-cjk noto-fonts noto-fonts-emoji

安装常用的软件

yay 安装工具

1
sudo pacman -S yay

microsoft-edge

1
yay -S microsoft-edge-stable-bin

安装后运行并登入同步数据即可正常使用

卸载系统自带的浏览器

1
sudo pacman -R firefox

vscode

  1. 官网下载 tar.gz 格式的文件 https://code.visualstudio.com/Downloads
  2. 解压缩
1
tar -zxvf code-stable*
  1. 移动到/opt/ 目录
1
sudo mv VSCde-linux-x64 /opt
  1. 增加执行权
1
sudo chomd +x /opt/VSCode-linux-x64/bin/code
  1. 添加快捷方式
  • 创建文件
1
sudo nano /usr/share/applications/vscode.desktop
  • 添加内容:
1
2
3
4
5
6
7
8
9
10
[Desktop Entry]
Name=Visual Studio Code
Comment=Multi-platform code editor for linux
Exec=/opt/VSCode-linux-x64/bin/code
Icon=/usr/share/icons/code.webp
Type=Application
StartupNotify=true
Categories=TextEditor;Development;Utility;
MimeType=text/plain;

复制图标

1
2
3
sudo cp /opt/VSCode-linux-x64/resources/app/resources/linux/code.webp /usr/share/icons/


  1. 运行程序,启用同步
  2. 查看当前系统的 python pyhon -V
  3. 基本可以正常使用 vscode 了。可能中间会出现 ipykernel 安装报错,报错代码如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ sudo pip3 install ipkernel
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
python-xyz', where xyz is the package you are trying to
install.

If you wish to install a non-Arch-packaged Python package,
create a virtual environment using 'python -m venv path/to/venv'.
Then use path/to/venv/bin/python and path/to/venv/bin/pip.

If you wish to install a non-Arch packaged Python application,
it may be easiest to use 'pipx install xyz', which will manage a
virtual environment for you. Make sure you have python-pipx
installed via pacman.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
  1. 解决办法粗暴
1
2
3
sudo mv /usr/lib/python3.x/EXTERNALLY-MANAGED /usr/lib/python3.x/EXTERNALLY-MANAGED.bk
# 将上述代码的3.x替换成python版本号

代理工具 wiregual-tools

  1. 安装 wireguard 工具
1
yay -S wireguard-tools
  1. 修改配置文件坐在目录的权限
1
sudo chmod 777 /etc/wireguard
  1. 创建配置文件
1
sudo nano /etc/wireuard/wg0.conf

配置文件内容:

1
2
3
4
5
6
7
8
9
10
11
Interface]
ListenPort = 49852
Address = 10.14.0.2/16
PrivateKey = mKTo/XWQemHxEDJxfDaNvcFwB4R42WQDtV7ZURUitWg=
DNS = 162.252.172.57, 149.154.159.92
[Peer]
PersistentKeepalive = 25
PublicKey = iBJRXLZwXuWWrOZE1ZrAXEKMgV/z0WjG0Tks5rnWLBI=
AllowedIPs = 0.0.0.0/0
Endpoint = 23.230.212.231:51820
# 以上内容不是固定不变的,
  1. 运行代理
1
sudo wg-quick up wg0
  1. 查看运行状况
1
sudo wg
  1. 关闭代理
1
sudo wg-quick down wg0

安装网易云音乐

1
yay -S netease-cloud-music

安装 deepin 微信

1
yay -S deepin-wine-wechat

安装 deepin 腾讯 QQ

1
yay -S deepin-wine-qq

KDE 桌面美化

  1. 安装
1
sudo pacman -S qt5-base qt5-svg qt5-declarative qt5-quickcontrols
  1. 安装 osc-url

1
2
3
sudo pacman -U ~/下载/ocs-url-3.1.0-1-x86_64.pkg.tar

# 有了osc-url后,点击主题的 install 按钮后,会跳出是否打开 xdg-open,选择打开并安装主题就 OK 了。
  1. 下载主题

高效工具的安装配置

oh my zsh

manjaro KDE 自带了 zsh,所以可以直接安装 oh my zsh

  1. 下载 需要代理
1
2
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

  1. 更改 shell 为 zsh
1
2
3
chsh -s /usr/bin/zsh
zsh

  1. 下载插件
1
2
3
4
5
6
# 自动补全
sudo git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
# 语法高亮
sudo git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
# zsh-vi-mod
sudo git clone https://github.com/jeffreytse/zsh-vi-mode $ZSH_CUSTOM/plugins/zsh-vi-mode
  1. 修改配置
1
2
3
4
5
6
7
8
9
10
#打开 ~/.zshrc 找到 plugins 将它改成下面这样:
plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
zsh-vi-mode
colored-man-pages
)
#修改主题
ZSH_THEME="bira"
  1. 安装 autojump,终端目录跳转神器
1
2
3
4
5
sudo git clone https://github.com/wting/autojump
cd autojump
./install.py
cd ..
sudo rm -rf autojump
  1. 修改配置
1
2
3
4
5
6
7
sudo nano ~/.zshrc
# 在文末添加
[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh
# 配置成功。想在终端跳转到之前的目录时,可直接按 j 和目录名的前缀即可完成跳转

# 更新配置启用
source ~/.zshrc

安装并配置 vim

  1. 安装
1
sudo pacman -Sy vim
  1. 安装插件环境
1
2
3
4
git clone https://github.com/chxuan/vimplus.git ~/.vimplus
cd ~/.vimplus
./install.sh

  1. 安装插件管理器
1
2
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  1. 修改配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
vim ~/.vimrc

# 在 call plug#begin() 和 call plug#end()之间插入以下内容
# 按下 i 键进行 插入 操作,将如下内容粘贴到里面(最好上下留有空行,方便浏览)

Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
"vim 启动的时候 提供一些辅助功能 ,如 显示最近打开的文件,以及一个好看的图标
Plug 'mhinz/vim-startify'
"在vim打开文件的时候 侧边展示目前等 ,该插件是必装插件 如果你用 vim作为ide的话
Plug 'mhinz/vim-startify'
Plug 'scrooloose/nerdtree'
"这个插件 是 快速搜索文件的 也是必须安装的,比 ctrlp 速度要快
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
"添加一些分割线 比如你写python的时候 格式对齐 就可以通过这个分割线来 让你很直观的看到
Plugin 'Yggdroot/indentLine'
"自动格式化管理插件, 可根据不同文件类型使用不同的格式化工具
Plug 'Chiel92/vim-autoformat'
"Markdown预览
Plug 'iamcco/markdown-preview.nvim', {'do': 'cd app & yarn install'}
“YCM 先安装,然后手工编译出库文件 ycm_core.so (以及依赖的 libclang.so) 才可使用. 假设使用 vim-plug 下载的 YouCompleteMe 源码保存在目录 ~/.vim/plugged/YouCompleteMe, 在该目录下执行
Plug 'ycm-core/YouCompleteMe'`


Plugin 'tpope/vim-fugitive'
Plugin 'git://git.wincent.com/command-t.git'
Plugin 'mzlogin/vim-markdown-toc'
Plugin 'zxqfl/tabnine-vim'

1
2
3
4
5
6
7
8
9
10
11
12
13
14

6. 安装机器学习语法提示神器

```bash
cd ~/.vim/plugged/YouCompleteMe
git submodule update --init --recursive
python3 ./install.py -all

# 安装 YouCompleteMe
cd ~/.vim/plugged/YouCompleteMe
./install.sh


# 如果安装完有乱码,那就把终端的字体设置为 DroidSansMono Nerd Font Book

配置 BBR

与传统的拥塞控制算法相比,BBR 具有几个显着的优势,使其成为增强 Manjaro Linux 系统网络性能的绝佳选择。一些主要好处包括:

  1. 提高吞吐量:BBR 有效地利用了可用带宽,从而显著提高了整体数据传输速率。
  2. 减少延迟:使用 BBR,延迟和数据包丢失被最小化,从而带来响应更灵敏和无缝的浏览体验。
  3. 增强的连接稳定性:BBR 可动态适应网络条件的波动,即使在网络拥塞的情况下也能保持稳定的连接。
  4. 在多个网络流之间实现更好的公平性:BBR 确保带宽在不同用户和应用程序之间公平分配,促进平衡的网络环境。

通过在 Manjaro Linux 系统上启用 BBR,您可以利用这些优势并优化您的互联网体验。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 创建并编辑配置文件
sudo nano /etc/sysctl.d/80-bbr.conf

#添加以下内容
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

#应用更改.此命令重新加载 sysctl 配置,激活 BBR 拥塞控制算法。
sudo sysctl --system

#若要验证 BBR 是否处于活动状态,请运行:
sudo sysctl net.ipv4.tcp_congestion_control

# 输出显示如下则表示已经激活
net.ipv4.tcp_congestion_control = bbr

locate 命令

1
2
3
4
5
6
7
8
9
#安装
sudo pacman -S locate

# 使用前要更新数据库
sudo updatedb

# 使用方法:
locate [选项][参数]

Manjaro 系统的常用命令

pacman

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# 安装软件
sudo pacman -S package-name

# 先刷新软件库再安装软件
sudo pacman -Sy package-name

# 安装本地包,支持pkg.tar.gz 或 pkg.tar.xz
sudo pacman -U local_package_name

# 卸载软件,保留其全部已经安装的依赖关系
sudo pacman -R package-name

# 卸载软件及其全部已经安装的依赖关系
sudo pacman -R package-name

# 搜索软件含关键字的包
sudo pacman -Ss string

# 清理软件包缓存,未安装的包文件
sudo pacman -Sc

# 清理所有的缓存文件
sudo pacman -Scc

# 刷新软件库
sudo pacman -Syy

# 升级软件包
sudo pacman -Syu

# 升级系统
sudo pacman -Syyu

# 查看已经安装的软件
sudo pacman -Qs

# 清除系统中无用的包
sudo pacman -R
# 或者
pacman -Qdtq

# 从 AUR 安装软件包 yay 安装命令不需要加 sudo
yay -S package

# yay删除包
yay -Rns package

# 升级所有已安装的包
yay -Syu

# 打印系统统计信息
yay -Ps

# 检查安装的版本
yay -Qi package

wget 命令

1
2
3
4
5
6
7
8
# 下载到当前目录
wget url

# 指定下载目录 大写参数 -P
wget -P 目录 url

# 指定下载目录以及重命名下载文件
wget -o 目录/filename url

pwd / cd / ls

1
2
3
4
5
6
7
8
9
10
11
12
13
# 列出目录的内容(默认情况下是当前目录),包括文件和其他嵌套目录
ls
ls /usr

# 当前目录
pwd

# 更改目录
cd /home
cd ~/下载 # 切换到当前用户的下载目录 = cd /home/user_name/下载/
cd #切换到当前用户根目录 = cd /homw/user_name/
cd .. # 切换到上一级目录
cd ./ # 切换到当前目录

cp / rm /mv

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 复制。复制1.txt 到同目录下的 2.txt
cp 1.txt 2.txt

# 递归复制。复制整个目录,在Linux中,文件夹以正斜杠 (/)结尾。
cp -r fold/ new_fold/

# 复制fold目录下的所有文件到当前目录
cp fold/* .
```export NODEJS_HOME=/usr/local/lib/node/nodejs
export PATH=$NODEJS_HOME/bin:$PATH

### rm
```bash
# 删除文件
rm 1.txt

# 删除空目录
rm -r fold/tar -tf /opt/abc.tar.gz

# 删除非空目录
rm -rf fold/

mv

1
2
3
4
5
6
7
8
# 移动文件
mv 1.txt new_fold/

# 重命名文件
mv 1.txt 2.txt

# 重命名目录
mv fold fold1

tar

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 参数 c:打包(创建新的归档文件)
# 参数 z:使用gzip压缩归档文件
# 参数 j:使用bzip2压缩归档文件
# 参数 v:显示操作信息
# 参数 f:指定归档文件名
# 参数 x:解包(从归档文件中提取文件)
# 参数 C:切换到指定目录
# 参数 t:列出归档文件
# 参数 g:处理GNU格式的归档

## 压缩但不打包 tar cf 归档名 文件名或目录名
tar -cf 1.tar 1.txt

## 查看归档文件
tar -tf 1.tar

## 压缩文件成为新文件.将1.txt压缩成2.tar.gz
tar -czvf 2.tar.gz 1.txt


## 列出压缩文件的内容
tar -tzvg 1.tar.gz

## 解压
tar -xzvf 1.tar.gz

mkdir

1
2
3
4
5
# 新建目录
mkdir newfold/

# 新建多级目录
mkdir -p level1/level2/

Linux 系统其他常用命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 清空回收站
sudo rm -fr $HOME/.local/share/Trash/files/

# 比较文件差异,并排输出
diff -y -w 1.txt 2.txt

# 更改权限 +r 读权限 +w 写权限 +x 执行权限
chmod +rwx file

# htop 进程查看
htop

# 查看预览文件
cat 1.txt

# 查找文件里符合条件的字符串或正则表达式。
grep string 1.txt

# 在文件夹 dir 中递归查找所有文件中匹配正则表达式 "pattern" 的行,并打印匹配行所在的文件名和行号:
grep -r -n pattern dir/

# 在当前目录中,查找后缀有 file 字样的文件中包含 test 字符串的文件,并打印出该字符串的行
grep test *file

# 查看系统信息
neofetch

# 显示系统当前内存的使用情况
free

# 查看占用资源最多的进程,默认cpu占用
top

Pdf 文档编辑

  1. 普通的 pdf 内文本编辑直接使用 libreoffice-draw
  2. 查看用 Okular。可以复制文字
  3. 编辑神器 pdftk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# 安装,安装好的版本是server版 具有pro版的全部功能。

sudo pacman -S pdftk

# 使用方法:

# 合并pdf文件。将1.pdf,2.pdf 合并成 new.pdf
pdftk 1.pdf 2.pdf cat output new.pdf

# 合并目录下的所有pdf文件
pdftk *.pdf cat output new.pdf

# 提取1-10页为一个新文件
pdftk input.pdf cat 1-10 output new.pdf

# 提取版连续的页面成为新文件。提取第1-3页,第5页,第7-10页
pdftk input.pdf cat 1-3 5 7-10 output new.pdf

#去除第15-20页
pdftk input.pdf cat 1-14 21-end output new.pdf

# 拆分pdf的每一页一个新文件
pdftk input.pdf burst output new_%d.pdf

# 将所有页面旋转180度
pdftk input.pdf cat 1-endsouth output new.pdf

# 将第3页顺时针旋转90度
pdftk input.pdf cat 1-2 3east 4-end output new.pdf

# 解压pdf页面流,然后可以在文本编辑器中编辑pdf
pdftk input.pdf outout doc.unc.pdf uncompress

# 压缩pdf
pdftk input.pdf output mydoc.clear.pdf compress

# 修复破损的pdf
pdftk input.pdf output new.pdf

# 修改pdf目录。分3步完成
1. 提取目录信息
pdftk input.pdf dump_date output toc.txt

2. 用文本编辑器修改
...

3. 把修改后的信息加载回pdf中
pdftk input.pdf update_info toc.txt output new.pdf

# 获取pdf文件的元数据和书签信息
pdftk input.pdf dump_data output toc.txt

# 加密 密码为 foopass
pdftk input.pdf input_pw foopass output new.pdf

# 128位加密,保留全部权限 密码为 foopass
pdftk input.pdf output new.pdf owner_pw foopass

安装和配置 WINE

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -----安装wine-----
sudo pacman -S wine

# -----修改配置文件-----
sudo vim ~/.wine/drive_c/windows/win.ini

# 添加的内容如下:
[Desktop]
menufontsize=13
messagefontsize=13
statusfontsize=13
IconTitleSize=13

#------注册表编辑-----

# 制作注册表文件
sudo vim regedit01

# 添加内容到regedit01
REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]
"Lucida Sans Unicode"="wqy-microhei.ttc"
"Microsoft Sans Serif"="wqy-microhei.ttc"
"Microsoft YaHei"="wqy-microhei.ttc"
"微软雅黑"="wqy-microhei.ttc"
"MS Sans Serif"="wqy-microhei.ttc"
"Tahoma"="wqy-microhei.ttc"
"Tahoma Bold"="wqy-microhei.ttc"
"SimSun"="wqy-microhei.ttc"
"Arial"="wqy-microhei.ttc"
"Arial Black"="wqy-microhei.ttc"
"宋体"="wqy-microhei.ttc"
"新細明體"="wqy-microhei.ttc"

# wine打开注册表
wine regedit

# 导入注册表文件
在弹出的窗口中,选择导入注册文件,并选择刚创建的注册表文件

# -----修改wine启动器界面-----

# 输入命令
winecfg

# 选择显示菜单
修改屏幕分辨率 96 dpi

安装 libreoffice 系列软件的中文语言包

1
sudo pacman -S libreoffice-still-zh-cn

配置 Hexo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
######以下办法失败######以下办法失败######以下办法失败##########
# -----安装 Nodejs----
yay -Sy nodejs
# 测试是否安装成功
node -v # v21.4.0
npm -v # 10.2.5
# -----安装 hexo-cli-----
# 测试 git 是否成功安装
git --version # gie version 2.43.0
# 安装 hexo-cli ,在走代理的情况下可以成功安装
npm install hexo-cli -g
###此时出现严重问题,报错 npm ERR! code EACCES.....在网上找了n种办法均告失败,通过更改部分运行目录后成功,但是重启后丢失了sudo命令的使用权。导致系统重装。

##------ 今天2023-12-17计划用新方法来安装-----------------------
#首先准备安装nodejs,从nodejs官网下载安装包--->解压缩到指定目录下---->配置
# 下载到 ~/下载
wget -P ~/下载 https://nodejs.org/dist/v20.10.0/node-v20.10.0-linux-x64.tar.xz

# 解压缩
cd ~/下载
tar -xzvf node-v20.10.0-linux-x64.tar.xz

# 创建新目录 /usr/local/lib/node
sudo mkdir /usr/local/lib/node

# 移动解压缩后的文件夹node-v20.10.0-linux 到/usr/local/lib/node下并重命名为nodejs
sudo mv ~/下载/node-v20.10.0-linux-x64 /usr/local/lib/node/nodejs

# 设置环境变量
sudo vim /etc/profile
# 添加内容
export NODEJS_HOME=/usr/local/lib/node/nodejs
export PATH=$NODEJS_HOME/bin:$PATH

# 测试是否成功
cd
node -v # 10.2.3
npm -v # v20.10.0
以上输出表示安装成功了!

# 安装hexo,依然报错,从网上继续查找原因和解决办法,主要是全局应用没有使用权限的问题。找到最终的解决办法:改变两个目录的所有者
sudo chown -R xiaoyx ~/.npm/
sudo coown -R xiaoyx /usr/local/lib/node/
npm install hexo-cli -g

# 检测是否安装成功
hexo --version

# 至此完全搞定个人博客搭建在linux下的应用。这个操作因为npm权限的问题耗费了整整两天的时间。

启用github博客

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 因为安装的是双系统,之前已经创建了博客,所以在MANJARO下直接使用原来的博客目录。

# 挂载windows下的D盘,并切换到博客目录下:
cd /run/media/xiaoyx/Data/BLOG/yxhsiao/source/_posts
hexo g
hexo d

# 运行hexo d 后报错身份验证错误,解决办法。
git config --global user.name "yxhsiao"
git config --global user.email "yxhsiao@gmail.com"

# 接着将原来win下的c:\\user\\xiaoyx\\.ssh 文件目录全部复制到 ~/
sudo cp /run/media/xiaoyx/Windows-SSD/Users/xiaoyx/.shh ~/

# 更改该目录的权限
sudo chmod -R 700 ~/.ssh/ 2 ↵

# 再次运行成功推送
hexo clean && hexo g && hexo d


Deepin 系统

安装

  1. Ventoy 制作可启动 U 盘
  2. 将 deepin V20.9 的镜像文件 ISO 格式的拷贝到 U 盘根目录下,可以同时拷贝多个系统安装的镜像文件到根目录下。
  3. 设置电脑的开机顺序优先 U 盘启动
  4. 进入安装程序

配置

输入法配置,系统自带的输入法框架已经足够。

  • 只需要将双拼方案选择小鹤双拼,
  • 保留五笔和地球拼音。

更新商店

  • sudo apt-get update

软件的安装与卸载

  • dpkg -l 查看已经安装的软件
  • sudo apt-get autoremove name 卸载命令,name 是耀卸载的软件名称
  • sudo apt-get clean 清理下载文件的存档
  • sudo apt-get autoclean 清理过时的软件包

应用商店安装必要的软件

  • 浏览器 EDGE,登录并同步.卸载系统自带的浏览器 sudo apt purge org.deepin.browser
  • 邮件客户端 Foxmail。下载系统自带的邮箱
  • 微信
  • QQ
  • 喜马拉雅
  • 网易云音乐
  • Vscode 满足编程和 MarkDown

重点讲解python的安装

  • 因为系统中已经包含了python2.7 和 python3.7
  • 如果直接使用系统自带的python3.7,需要设置两个的优先级别
    1
    2
    3
    4
    5
    # 分别设置级别伟1和2,数字越大代表优先级越高
    sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1

    sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2

  • 安装pip `sudo apt install python3-pip
  • 更新pip sudo pip3 install --upgrade pip
  • 设置pip软件源 `pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
  • 安装包:pip3 install 包名称
  • 查看已经安装的包 pip3 list
  • 查看可以更新的包pip3 install --upgrade 包名称
  • 安装指定版本 pip install --upgrade 包名称==版本号

deepin 系统下wireguard Vpn的配置

  1. 安装 wireguard-tools
  • 下载 https://storage.deepin.org/thread/202209290945162120_wireguard-tools_1.0.20210914+r466+g7f3cd52-1_amd64.zip
  • 解压缩
  • 直接双击安装 deb 包
  1. 配置

    • 更改文件夹的权限伟可读写。chmod -R 777 ./etc/wireguard
    • 创建并编辑配置文件
    • sudo deepin-editor /etc/wireguard/wg0.conf
    • sudo gedit /etc/wireguard/wg0.conf
    • 添加配置文件内容:
1
2
3
4
5
6
7
8
9
10
11
12
13
# 第1,2,4,7,8行的内容是固定的。其中第4行时自己注册的Vpn的密钥
# 其他行的参数内容来自VPN节点数据。此处是从注册网站下载的数据
# `https://my.shark-china.com/******`
[Interface]
ListenPort = 49815
Address = 10.14.0.2/16
PrivateKey = mKTo/XWQemHxEDJxfDaNvcFwB4R42WQDtV7ZURUitWg=
DNS = 162.252.172.57, 149.154.159.92
[Peer]
PersistentKeepalive = 25
PublicKey = iBJRXLZwXuWWrOZE1ZrAXEKMgV/z0WjG0Tks5rnWLBI=
AllowedIPs = 0.0.0.0/0
Endpoint = 23.230.212.223:51820
  1. 命令行启动运行

    • 打开代理 sudo wg-quick up wg0
    • 关闭代理 sudo wg-quick down wg0
  2. 自动从下载的配置文件添加到虚拟网卡配置信息中

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# *_2023-12-03_*
# *_python3.7_*

import os,re,stat

filename = input('输入下载的配置文件名')
filename =filename + '.conf'
downfold = '/home/xiaoyx/Downloads'
downfile = os.path.join(downfold,filename)
dct = {}
with open(downfile, 'r', encoding='utf-8') as file:
rows = file.readlines()
for row in rows:
if '=' in row:
ls = row.split(' = ',1)
dct.update({ls[0]:re.sub('\n','',ls[1])})
rows1 = ['[Interface]\n','ListenPort = 49852\n']
rows2 = ['[Peer]\n','PersistentKeepalive = 25\n']
wd1 = '<insert_your_private_key_here>'
wd2 = 'mKTo/XWQemHxEDJxfDaNvcFwB4R42WQDtV7ZURUitWg='
for k,v in dct.items():
str = k + ' = ' + v + '\n'
if k in ['Address', 'PrivateKey','DNS']:
str = re.sub(wd1,wd2,str)
rows1.append(str)
else:
rows2.append(str)
rows = rows1 + rows2
with open('/etc/wireguard/wg0.conf','w',encoding='utf-8') as f:
f.writelines(rows)

丝锥的画法

螺纹的尺寸

  • 普通60度三角形螺纹的尺寸
    • 螺纹的基本尺寸螺距: Pitch (P)
    • 三角形的高度: H = sin(60) * P
    • 牙底去除 1/4 * H
    • 牙顶去除 1/8 * H

建模步骤

  1. 旋转生成实体。画出切削锥部分和水孔

    • 标注尺寸外形,
  2. 螺旋扫描生成螺纹

    • 关键是螺纹的尺寸
  3. 开排屑槽

    • 直槽或螺旋槽
    • 留足够的排屑长度
  4. 尾部四方头

    • 标准执行
    • JIS 或 DIN
  5. 出图

1
2
from datetime import date,timedelta,datetime,time
import time

datetime 时间格式及转化

  1. 获取方式 datetime 模块
  2. 转化成字符串 x.strftime(format)
    • x : 要转化的datetime时间
    • format : 转换成的字符串格式 如:%Y%m%d ,%Y-%m-%d ,%Y/%m/%d
  3. 转化成时间戳
    • 需要导入 time 模块
    • time.mktime(x.timetuple())
      • time.mktime 转换成时间戳的函数
      • x : 要转化的datetime时间
      • timetuple()datetime 转换成时间元组
1
2
3
4
5
dt1 = date.today()
dt2 = datetime.now()

dt1
dt2

Output:

datetime.date(2023, 11, 21)

datetime.datetime(2023, 11, 21, 14, 46, 43, 68528)

datetime to str

1
2
3
4
5
dt1.strftime("%Y%m%d")
dt1.strftime("%Y-%m-%d")
dt1.strftime("%Y/%m/%d")

dt2.strftime("%Y-%m-%d")

Output:

'20231121'

'2023-11-21'

'2023/11/21'

'2023-11-21'

datetime to timestamp

1
2
3
4
5
dt = datetime.now()
dt.timetuple()
st = time.mktime(dt.timetuple())
st

Output:

time.struct_time(tm_year=2023, tm_mon=11, tm_mday=21, tm_hour=14, tm_min=46, tm_sec=43, tm_wday=1, tm_yday=325, tm_isdst=-1)

1700549203.0

timestamp to datetime

1
2
3
4
5
6
dt = datetime.now()
dt
st = time.mktime(dt.timetuple())
st
date.fromtimestamp(st)

Output:

datetime.datetime(2023, 11, 21, 14, 46, 43, 117266)

1700549203.0

datetime.date(2023, 11, 21)

str 字符串格式的时间及转化

1
2
3
str1 = '20231111'
str2 = '2023-11-11'
str3 = '2023/11/11'

str to datetime

  • datetime.strptime 方法
1
2
3
datetime.strptime(str1,'%Y%m%d')
datetime.strptime(str2,'%Y-%m-%d')
datetime.strptime(str3,'%Y/%m/%d')

Output:
datetime.datetime(2023, 11, 11, 0, 0)

datetime.datetime(2023, 11, 11, 0, 0)

datetime.datetime(2023, 11, 11, 0, 0)
  • dateutil 模块的 parser.parse(string) 方法
1
2
3
4
from dateutil import parser
parser.parse(str1)
parser.parse(str2)
parser.parse(str3)

Output:

datetime.datetime(2023, 11, 11, 0, 0)

datetime.datetime(2023, 11, 11, 0, 0)

datetime.datetime(2023, 11, 11, 0, 0)
  • pandas模块的 pd.to_datetime(str1)方法
1
2
3
4
import pandas as pd
pd.to_datetime(str1)
pd.to_datetime(str2)
pd.to_datetime(str3)

Output:

Timestamp('2023-11-11 00:00:00')

Timestamp('2023-11-11 00:00:00')

Timestamp('2023-11-11 00:00:00')

timestamp 时间戳时间的转换

自1970年1月1日(00:00:00 GMT)以来的秒数

  1. 生成方法
    • time模块
    • time.time() 生成当前时间的时间戳
    • 时间戳的数据类型是浮点数
  2. 转换成str 格式的时间
    • 分两步操作,先将时间戳转换成时间元组,然后转换
      • time.localtime(a) a : 要转换的时间戳
    • time.strftime(“%Y-%m-%d”,time.localtime(a))
      • a : 要转换的时间戳
  3. 转换成datetime
    • 转换成日期和时间 datetime.fromtimestamp(a)
      • a : 要转换的时间戳
    • 转换成日期 date.fromtimestamp(int(a))
      • 先将时间戳的浮点数转换成整型 int(a)
      • a : 要转换的时间戳
1
2
3
4
a = time.time()
a
type(a)

Output:

1700549203.5535545

float

timestamp to str

  • time.strftime("%Y-%m-%d",time.localtime(a))
1
2
3
4
b = time.localtime(a)
b
type(b)

Output:

time.struct_time(tm_year=2023, tm_mon=11, tm_mday=21, tm_hour=14, tm_min=46, tm_sec=43, tm_wday=1, tm_yday=325, tm_isdst=0)

time.struct_time
1
2
3
c = time.strftime("%Y-%m-%d",b)
c
type(c)

Output:

'2023-11-21'

str

timestamp to datetime

  1. 转换成datetime
    • datetime.fromtimestamp(a)
  2. 转换成date
    • date.fromtimestamp(int(a))
1
2
datetime.fromtimestamp(a)
date.fromtimestamp(int(a))

Output:

datetime.datetime(2023, 11, 21, 14, 46, 43, 553555)

datetime.date(2023, 11, 21)

通达信数据的下载和解析

1
2
3
4
5
6
from pytdx.hq import TdxHq_API
from pytdx.hq import TDXParams
from pytdx.exhq import TdxExHq_API

# 设置接口
api = TdxHq_API(multithread=True, heartbeat=True, auto_retry=True)

数据获取接口一般返回list结构,如果需要转化为pandas Dataframe接口,可以使用 api.to_df 进行转化

K线数据

只包含 O,C,H,L,V,A字段
api.get_security_bars(category,market,code,strat,cont)

  1. category , k线种类。0,5分钟k线,1,15分钟,2,30分钟 3,60分钟 4,日K, 5, 周K ,6, 月K, 7, 1分钟,8,1分钟 9, 日K, 10, 季K线 11, 年K线
  2. market,市场代码 0,深圳,1,上海
  3. code, 股票代码 如,’600004’
  4. start, 指定的范围开始位置;
  5. count, 用户要请求的 K 线数目,最大值为 800
  6. api.to_df() 将下载的数据(列表文件)转换成df
1
2
3
4
# 返回DataFrame 使用api.to_df()
with api.connect('119.147.212.81', 7709):
data = api.to_df(api.get_security_bars(9, 0, '000409', 0, 5))
data
open close high low vol amount year month day hour minute datetime
0 10.31 10.25 10.33 10.22 770043.0 7.890071e+08 2023 11 13 15 0 2023-11-13 15:00
1 10.24 10.27 10.33 10.23 596858.0 6.133777e+08 2023 11 14 15 0 2023-11-14 15:00
2 10.37 10.37 10.45 10.34 1109140.0 1.152155e+09 2023 11 15 15 0 2023-11-15 15:00
3 10.38 10.24 10.39 10.23 922621.0 9.483951e+08 2023 11 16 15 0 2023-11-16 15:00
4 10.22 10.15 10.25 10.12 903362.0 9.176167e+08 2023 11 17 15 0 2023-11-17 15:00
1
2
3
4
5
# 下载日K线数据
with api.connect('119.147.212.81', 7709):
data = api.get_k_data('000409', '2018-06-01', '2023-11-10')

data.tail()
open close high low vol amount date code
date
2023-11-06 10.51 10.69 10.69 10.51 1007062.0 1.069207e+09 2023-11-06 000001
2023-11-07 10.66 10.60 10.66 10.58 640866.0 6.798156e+08 2023-11-07 000001
2023-11-08 10.58 10.50 10.60 10.45 877818.0 9.236220e+08 2023-11-08 000001
2023-11-09 10.46 10.49 10.52 10.43 639136.0 6.696390e+08 2023-11-09 000001
2023-11-10 10.45 10.30 10.47 10.29 1045044.0 1.080650e+09 2023-11-10 000001

行情数据

  1. 有45个字段的数据
1
2
3
4
# 获取某支股票的行情数据
with api.connect('119.147.212.81', 7709):
data = api.to_df(api.get_security_quotes(1,'600963'))
data
market code active1 price last_close open high low servertime reversed_bytes0 ... ask5 bid_vol5 ask_vol5 reversed_bytes4 reversed_bytes5 reversed_bytes6 reversed_bytes7 reversed_bytes8 reversed_bytes9 active2
0 1 600963 1847 6.77 6.69 6.79 6.79 6.61 14:59:57.926 14999424 ... 6.81 171 572 (1750,) 0 0 0 0 0.3 1847

1 rows × 45 columns

1
2
3
4
5
# 获取多支股票的行情数据
with api.connect('119.147.212.81', 7709):
data = api.to_df(api.get_security_quotes(
[(0, '000409'), (1, '600963'), (1, '600004')]))
data
market code active1 price last_close open high low servertime reversed_bytes0 ... ask5 bid_vol5 ask_vol5 reversed_bytes4 reversed_bytes5 reversed_bytes6 reversed_bytes7 reversed_bytes8 reversed_bytes9 active2
0 0 000001 4439 10.15 10.24 10.22 10.25 10.12 14:59:57.430 14999286 ... 10.20 15222 4953 (1110,) 0 0 0 0 -0.09 4439
1 1 600963 1847 6.77 6.69 6.79 6.79 6.61 14:59:57.926 14999424 ... 6.81 171 572 (1750,) 0 0 0 0 0.30 1847
2 1 600004 2350 10.91 10.86 10.86 10.95 10.83 14:59:57.156 14999210 ... 10.95 185 2493 (5014,) 0 0 0 0 0.00 2350

3 rows × 45 columns

分时行情

api.get_minute_time_data(market,code)

  1. market,市场代码
  2. code,股票代码
1
2
3
with api.connect('119.147.212.81', 7709):
df = api.to_df(api.get_minute_time_data(1, '600963'))
df.tail()
price vol
235 639.58 0
236 639.78 0
237 639.90 0
238 640.00 0
239 640.03 0

分笔成交

参数,市场代码, 股票代码,起始位置, 数量 如, 0,000409,0,10

1
2
3
with api.connect('119.147.212.81', 7709):
data = api.to_df(api.get_transaction_data(1, '600963', 0, 10))
data.tail()
time price vol num buyorsell
5 14:56 6.76 1 1 1
6 14:56 6.77 29 3 0
7 14:56 6.76 1 1 1
8 14:56 6.77 17 1 0
9 15:00 6.77 2417 37 2

公司信息目录

参数:市场代码,股票代码 如, (0,000409) 或 (1,600963)

1
2
3
4
with api.connect('119.147.212.81', 7709):
data = api.to_df(api.get_company_info_category(1, '600963'))

data.sample(5)
name filename start length
14 龙虎榜单 600963.txt 945899 9017
13 高层治理 600963.txt 906142 30429
10 经营分析 600963.txt 782425 37837
1 公司概况 600963.txt 20531 12912
6 业内点评 600963.txt 208113 50851

除权除息信息

参数,市场代码, 股票代码, 如, 0,000409 或 1,600963

1
2
data = api.to_df(api.get_xdxr_info(1, '600963'))
data.tail()
year month day category name fenhong peigujia songzhuangu peigu suogu panqianliutong panhouliutong qianzongguben houzongguben fenshu xingquanjia
38 2022 9 22 5 股本变化 NaN NaN NaN NaN None 176505.31250 176505.31250 180445.3125 180421.312500 None None
39 2023 5 23 1 除权除息 1.38 0.0 0.0 0.0 None NaN NaN NaN NaN None None
40 2023 7 14 5 股本变化 NaN NaN NaN NaN None 176505.31250 177847.21875 180421.3125 180421.312500 None None
41 2023 7 27 5 股本变化 NaN NaN NaN NaN None 177847.21875 177847.21875 180421.3125 180309.312500 None None
42 2023 9 25 5 股本变化 NaN NaN NaN NaN None 177847.21875 177847.21875 180309.3125 180301.015625 None None

财务信息

参数,市场代码, 股票代码, 如, 0,000409 或 1,600963

1
api.to_df(api.get_finance_info(1, '600963'))
market code liutongguben province industry updated_date ipo_date zongguben guojiagu faqirenfarengu ... touzishouyu jingyingxianjinliu zongxianjinliu cunhuo lirunzonghe shuihoulirun jinglirun weifenpeilirun meigujingzichan baoliu2
0 1 600963 1.778472e+09 21 38 20231028 20040525 1.803010e+09 12220000.0 4.739506e+09 ... -3.037000e+06 1.463644e+09 -1.850998e+09 5.497939e+10 8.248120e+08 1.192211e+09 1.160851e+09 1.484426e+10 5.043 9.0

1 rows × 37 columns

股票列表

参数,市场代码, 起始位置 如, 0,0 或 1,100

1
2
3
4
with api.connect('119.147.212.81', 7709):
data = api.to_df(api.get_security_list(0, 100))

data.sample(5)
code volunit decimal_point name pre_close
976 002193 100 2 如意集团 6.880000
10 399320 100 2 国证服务 1946.814453
804 002014 100 2 永新股份 104.015000
488 000679 100 2 大连友谊 5.600000
257 399976 100 2 CS新能车 3085.466553

行情服务器列表

1
2
3
4
5
from pytdx.config.hosts import hq_hosts

data = api.to_df(hq_hosts)
data.columns = ['name','ip','port']
data.sample(5)
name ip port
83 国信 58.210.106.91 7709
48 安信 123.126.133.21 7709
81 国信 182.131.3.252 7709
35 华泰证券(南京联通) 122.192.35.44 7709
53 广发 123.138.29.108 7709

Reader接口

读取本地通达信的日K线数据和财务数据

  1. 通过下面的接口,我们可以解析通达信的日K线文件,
  2. 该文件可以通过读取通达信的软件本地目录导出的数据获取,也可以从通达信的官网上下载, 如果您安装了通达信的终端,可以在安装目录下找到 vipdoc 子目录。
  3. \vipdoc\sz\lday\ 下是深圳的日k线数据
  4. \c,\new_tdx\vipdoc\sh\lday` 下是上海的日k线数据
  5. 该目录下每个股票为一个文件,如 sz000001.day 为深圳的日k行情

读取本地日K数据

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

from pytdx.reader import TdxDailyBarReader, TdxFileNotFoundException
import re,os
reader = TdxDailyBarReader()


def getfullcode(code):
if code.startswith('6',0,1):
code = 'sh' + code
elif code.startswith('0',0,1) or code.startswith('3',0,1):
code = 'sz' + code
return code


def get_filepath(code):
"""
根据6位数字的股票代码获取完整的日k线数据路径
"""
code = getfullcode(code)
fd1 = r'D:\new_tdx\vipdoc'
fd2 = f"{re.match(r'[a-z]+',code).group()}\lday\{code}.day"
return os.path.join(fd1,fd2)

if __name__ == '__main__':
code ='600963'
reader.get_df(get_filepath(code))
open high low close amount volume
date
2015-09-02 6.29 7.08 6.10 6.27 364928032.0 558797.19
2015-09-07 6.53 6.84 6.44 6.64 324548288.0 490112.77
2015-09-08 6.66 7.30 6.41 7.30 433349024.0 622271.62
2015-09-09 7.30 7.66 7.19 7.48 512872192.0 689203.11
2015-09-10 7.22 7.86 7.15 7.67 595483392.0 788354.76
... ... ... ... ... ... ...
2023-11-13 6.81 6.95 6.76 6.92 127803392.0 186437.74
2023-11-14 6.92 7.00 6.75 6.80 137608928.0 200814.71
2023-11-15 6.81 6.89 6.75 6.86 80819168.0 118405.00
2023-11-16 6.86 6.87 6.68 6.69 74718832.0 110673.82
2023-11-17 6.79 6.79 6.61 6.77 78754760.0 117399.27

1995 rows × 6 columns

读取分钟K线数据

1
2
3
4
5
6
from pytdx.reader import TdxLCMinBarReader, TdxFileNotFoundException

reader = TdxLCMinBarReader()

df = reader.get_df(r"D:\Software\TDXW\vipdoc\sz\minline\sz000017.lc1")
df.tail(10)
open high low close amount volume
date
2022-04-29 14:51:00 2.79 2.80 2.79 2.80 23724.0 8500
2022-04-29 14:52:00 2.80 2.80 2.79 2.79 19289.0 6900
2022-04-29 14:53:00 2.79 2.79 2.79 2.79 11997.0 4300
2022-04-29 14:54:00 2.79 2.79 2.79 2.79 34875.0 12500
2022-04-29 14:55:00 2.79 2.79 2.79 2.79 20943.0 7500
2022-04-29 14:56:00 2.79 2.79 2.79 2.79 289088.0 103600
2022-04-29 14:57:00 2.79 2.79 2.78 2.79 25098.0 9000
2022-04-29 14:58:00 2.79 2.79 2.79 2.79 0.0 0
2022-04-29 14:59:00 2.79 2.79 2.79 2.79 0.0 0
2022-04-29 15:00:00 2.79 2.79 2.79 2.79 71145.0 25500

获取历史专业财务数据列表

1
2
3
4
5
6
7
8
from pytdx.crawler.history_financial_crawler import HistoryFinancialListCrawler
import pandas as pd

crawler = HistoryFinancialListCrawler()

# crawler.fetch_and_parse()
df = api.to_df(crawler.fetch_and_parse())
df.head()
filename hash filesize
0 gpcw20231231.zip 12a3ed6b45f8c2a8a8bab60dc8bd8b68 165
1 gpcw20230930.zip e4c674eff21df9ac9f488fa2daf078ac 4929988
2 gpcw20230630.zip bb3fe81aeef245eb70f82728e913adf2 5330174
3 gpcw20230331.zip 1bb4b322a909a7d6369f9351a45065d4 4715993
4 gpcw20221231.zip 5d722a6bfdeaa44b96eeddc08d4c69e2 5363770

获取历史专业财务数据内容

数据列对应的数据内容

https://github.com/yutiansut/QUANTAXIS/blob/master/QUANTAXIS/QAData/financial_mean.py

下载财务数据

1
2
3
4
5
6
7
8
9
10
from pytdx.crawler.base_crawler import demo_reporthook
from pytdx.crawler.history_financial_crawler import HistoryFinancialCrawler

datacrawler = HistoryFinancialCrawler()
pd.set_option('display.max_columns', None)
result = datacrawler.fetch_and_parse(
reporthook=demo_reporthook,
filename='gpcw20230930.zip',
path_to_download="C:/Users/xiaoyx/Desktop/20221231.zip")
df = pd.DataFrame(data=result)
Downloaded 4800000, Total is 0
Downloaded 4830000, Total is 0
Downloaded 4860000, Total is 0
Downloaded 4890000, Total is 0
Downloaded 4920000, Total is 0
Downloaded 4929988, Total is 0

读取本地财务数据

1
2
3
4
5
6
7
8
9
10
11
from pytdx.reader import HistoryFinancialReader

import os
import re
import numpy as np
import pandas as pd

file = r"C:\Users\xiaoyx\Desktop\20221231.zip"

df = HistoryFinancialReader().get_df(file)
df.sample(6)
report_date col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 col66 col67 col68 col69 col70 col71 col72 col73 col74 col75 col76 col77 col78 col79 col80 col81 col82 col83 col84 col85 col86 col87 col88 col89 col90 col91 col92 col93 col94 col95 col96 col97 col98 col99 col100 col101 col102 col103 col104 col105 col106 col107 col108 col109 col110 col111 col112 col113 col114 col115 col116 col117 col118 col119 col120 col121 col122 col123 col124 col125 col126 col127 col128 col129 col130 col131 col132 col133 col134 col135 col136 col137 col138 col139 col140 col141 col142 col143 col144 col145 col146 col147 col148 col149 col150 col151 col152 col153 col154 col155 col156 col157 col158 col159 col160 col161 col162 col163 col164 col165 col166 col167 col168 col169 col170 col171 col172 col173 col174 col175 col176 col177 col178 col179 col180 col181 col182 col183 col184 col185 col186 col187 col188 col189 col190 col191 col192 col193 col194 col195 col196 col197 col198 col199 col200 col201 col202 col203 col204 col205 col206 col207 col208 col209 col210 col211 col212 col213 col214 col215 col216 col217 col218 col219 col220 col221 col222 col223 col224 col225 col226 col227 col228 col229 col230 col231 col232 col233 col234 col235 col236 col237 col238 col239 col240 col241 col242 col243 col244 col245 col246 col247 col248 col249 col250 col251 col252 col253 col254 col255 col256 col257 col258 col259 col260 col261 col262 col263 col264 col265 col266 col267 col268 col269 col270 col271 col272 col273 col274 col275 col276 col277 col278 col279 col280 col281 col282 col283 col284 col285 col286 col287 col288 col289 col290 col291 col292 col293 col294 col295 col296 col297 col298 col299 col300 col301 col302 col303 col304 col305 col306 col307 col308 col309 col310 col311 col312 col313 col314 col315 col316 col317 col318 col319 col320 col321 col322 col323 col324 col325 col326 col327 col328 col329 col330 col331 col332 col333 col334 col335 col336 col337 col338 col339 col340 col341 col342 col343 col344 col345 col346 col347 col348 col349 col350 col351 col352 col353 col354 col355 col356 col357 col358 col359 col360 col361 col362 col363 col364 col365 col366 col367 col368 col369 col370 col371 col372 col373 col374 col375 col376 col377 col378 col379 col380 col381 col382 col383 col384 col385 col386 col387 col388 col389 col390 col391 col392 col393 col394 col395 col396 col397 col398 col399 col400 col401 col402 col403 col404 col405 col406 col407 col408 col409 col410 col411 col412 col413 col414 col415 col416 col417 col418 col419 col420 col421 col422 col423 col424 col425 col426 col427 col428 col429 col430 col431 col432 col433 col434 col435 col436 col437 col438 col439 col440 col441 col442 col443 col444 col445 col446 col447 col448 col449 col450 col451 col452 col453 col454 col455 col456 col457 col458 col459 col460 col461 col462 col463 col464 col465 col466 col467 col468 col469 col470 col471 col472 col473 col474 col475 col476 col477 col478 col479 col480 col481 col482 col483 col484 col485 col486 col487 col488 col489 col490 col491 col492 col493 col494 col495 col496 col497 col498 col499 col500 col501 col502 col503 col504 col505 col506 col507 col508 col509 col510 col511 col512 col513 col514 col515 col516 col517 col518 col519 col520 col521 col522 col523 col524 col525 col526 col527 col528 col529 col530 col531 col532 col533 col534 col535 col536 col537 col538 col539 col540 col541 col542 col543 col544 col545 col546 col547 col548 col549 col550 col551 col552 col553 col554 col555 col556 col557 col558 col559 col560 col561 col562 col563 col564 col565 col566 col567 col568 col569 col570 col571 col572 col573 col574 col575 col576 col577 col578 col579 col580 col581
code
600682 20230930 0.3000 0.278087 4.6420 13.0164 6.6826 2.271 0.415 4.630121e+09 1.002700e+09 0.000000e+00 1.195215e+09 7.512159e+08 1.857957e+08 0.0 0.0 0.000000 4.706605e+08 0.0 0.000000e+00 6.092402e+07 8.296633e+09 0.0 0.0 0.0 4.404336e+08 2.699830e+08 3.485394e+09 8.004548e+07 0.0 0.0 0.000 0.0 2.985422e+09 212849760.0 6.133222e+09 3.567898e+08 2.921734e+08 1.154735e+09 1.754378e+10 2.584041e+10 6.255064e+08 0.0 1.307099e+06 8.733311e+08 19882220.0 3.513663e+08 1.503381e+08 23541500.0 0.000000e+00 5.787508e+08 0.0 6.984910e+07 1.525017e+07 5.920261e+09 1.752322e+08 0.000000e+00 2.455312e+07 0.0 1.564626e+07 3.756345e+08 0.0 1.082256e+09 7.002517e+09 1.346132e+09 8.995633e+09 4.944873e+08 6.961242e+07 6.248680e+09 1.316071e+09 0.0 0.0 1.883790e+10 2.584041e+10 4.756623e+09 2.614440e+09 4.772700e+07 4.165529e+08 8.871559e+08 0.0 -4.889040e+07 0.0 4.000000e+06 2.656829e+07 2.398540e+06 0.0 6.655628e+08 0.0 4.697453e+06 1.552838e+06 0.0 0.0 6.687074e+08 1.679882e+08 0.0 5.007192e+08 3.978431e+08 1.028762e+08 6.164624e+09 4.418316e+06 4.346931e+08 6.603735e+09 2.675032e+09 2.045450e+09 2.812682e+08 1.043509e+09 6.045259e+09 5.584766e+08 6.544644e+08 2.940166e+07 3.477951e+05 0.0 0.000000e+00 6.842139e+08 2.476945e+08 7.721153e+08 175967536.0 4.365974e+08 1.632375e+09 -9.481609e+08 490000.0 3.723488e+08 1.755655e+08 5.484042e+08 3.814226e+08 6.558093e+07 4.594481e+07 4.929484e+08 5.545588e+07 5.323436e+07 0.0 -2.809940e+08 4.872457e+09 4.591463e+09 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.401 1.322 78.208000 -12.680000 15.455000 84.544998 0.0 83.332001 1.37 269.019989 115.889999 7.980000 0.0 3.978000 6.897000 2.070 0.186 1.467000 68.0 39.0 0.578 467.0 1449.0 0.276 2.000000 -35.200001 3.335 16.181999 2.479 -27.030001 -26.580000 -33.980000 -33.980000 0.0 12.780000 13.99 1.003 54.964001 2.271 1.954 10.53 1.558 8.364 45.040001 26.379999 18.650999 -1.028 3.743419e+08 6.198170e+08 0.0 0.0 27.100000 32.106998 55.806999 5.673000 13.488000 547.028992 95.139999 2103.770020 -217.300003 0.4149 138.830002 87.320000 129.600006 11.740000 0.0 -0.2087 9.433000 7.975000 111.535004 2.161 1.518624e+09 1.335802e+08 7.611078e+07 6.864730e+07 1.442560e+08 -6.922262e+08 2.386204e+07 -5.368022e+08 1.346132e+09 1.165060e+09 0.0 0.0 38388.0 4.844827e+08 6.753679e+08 8.561068e+08 9.0 6.408691e+08 0.0 0.0 1.0 51186704.0 0.0 0.0 1.0 72400.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 6.753679e+08 3.037438e+08 6.449254e+08 181071952.0 0.0 1.897318e+08 6.904510e+08 1.752182e+10 0.0 0.0 7.0 5.896099e+08 6.458102e+08 0.0 0.0 0.0 0.0 2.31 0.0510 6.523959e+05 0.00000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 8.746382e+08 1.195215e+09 1.648885e+07 5.044243e+08 0.0 2.851086e+06 1.367939e+05 5.007192e+08 0.0 2.000848e+08 2.555375e+07 -103434088.0 1.141160e+09 5.073455e+04 48000.890625 6.257397e+04 0.0600 1.518624e+05 0.0 231031.0 0.0 -5.228109e+04 0.0 0.0 6.523959e+05 0.0 0.04 0.04 8.601923e+04 10038.440430 0.0 0.000000e+00 12.790000 8.675910e+04 2.05 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 208.050003 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 10224.549805 0.0 0.0 0.0 0.0 173104.687500 0.000000 3.234679e+05 0.000000 0.0 0.000000e+00 4.016857e+04 37245.589844 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.30 4.756623e+05 0.0 59139.019531 9906.080078 0.000000 0.0 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 4.117070e+05 -775.650024 21.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 0.000000 0.0 49.000000 0.000000 0.0 0.0 0.0
000560 20230930 -0.0288 -0.031137 0.8411 4.3538 2.3173 -0.662 1.207 4.288510e+09 4.240566e+08 0.000000e+00 7.446013e+08 1.370966e+09 1.519374e+09 0.0 0.0 0.000000 4.543698e+08 0.0 4.029593e+09 2.928789e+08 1.312461e+10 0.0 0.0 220127568.0 9.199743e+07 2.459725e+09 2.760344e+08 6.182286e+08 0.0 0.0 0.000 0.0 1.106356e+09 133157400.0 4.811546e+09 5.652424e+08 7.045942e+08 0.000000e+00 2.116892e+10 3.429353e+10 1.432090e+09 0.0 6.767445e+07 3.363652e+08 716537088.0 3.163994e+08 1.048320e+09 0.0 4.333900e+05 1.564968e+09 0.0 8.928536e+09 4.522798e+07 1.515695e+10 1.229722e+09 0.000000e+00 5.013586e+05 0.0 0.000000e+00 6.924360e+08 0.0 8.782193e+09 2.393914e+10 2.355501e+09 5.458309e+09 1.312927e+08 0.000000e+00 1.981110e+09 9.902939e+07 0.0 0.0 1.035439e+10 3.429353e+10 9.072627e+09 8.124000e+09 4.556824e+07 5.810499e+08 8.517304e+08 0.0 4.846083e+08 0.0 1.435826e+06 9.745524e+06 2.167848e+06 0.0 -3.005406e+07 0.0 1.157217e+07 1.825002e+07 0.0 0.0 -3.673191e+07 2.144442e+07 0.0 -5.817633e+07 -6.793062e+07 9.754287e+06 9.756909e+09 7.167870e+04 4.270924e+09 1.402790e+10 2.318453e+09 3.811269e+09 6.389743e+08 4.416803e+09 1.118550e+10 2.842405e+09 1.103587e+09 2.485092e+06 6.492929e+09 0.0 0.000000e+00 7.599001e+09 2.280212e+08 1.128305e+09 0.0 0.000000e+00 1.356326e+09 6.242676e+09 0.0 2.102467e+09 2.699772e+08 2.372445e+09 1.854525e+09 1.413322e+08 8.948291e+09 1.094415e+10 -8.571703e+09 0.000000e+00 0.0 5.133777e+08 3.419924e+09 3.933302e+09 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.866 0.836 28.294001 0.920000 36.685001 63.314999 0.0 551.916016 3.31 43.250000 19.070000 11.870000 0.0 11.042000 16.858999 -3.148 0.271 32.192001 24.0 16.0 0.706 382.0 996.0 0.883 2.110000 68.980003 -0.411 -4.029000 5.069 -14.576000 88.550003 66.230003 66.230003 0.0 -0.580000 -0.33 0.502 89.543999 -0.662 1.881 -0.64 -0.203 -0.749 10.460000 21.134001 9.388000 5.341 -7.334213e+07 4.478764e+08 0.0 0.0 69.809998 38.271000 32.674999 3.462000 0.805000 172.587006 46.799999 88.809998 61.930000 1.2067 154.619995 0.000000 107.540001 31.330000 0.0 0.2179 18.753000 11.873000 -4885.845215 8.288 2.808173e+09 2.990384e+06 -1.912006e+07 -1.542973e+07 7.725438e+08 2.109322e+09 -2.834257e+09 4.760849e+07 2.355501e+09 2.249034e+09 0.0 0.0 48299.0 4.110287e+08 1.012821e+09 1.110321e+09 10.0 9.814859e+08 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1165200.0 0.0 0.0 2.0 59148800.0 0.0 0.0 0.0 0.0 1.012821e+09 4.110287e+08 1.446218e+09 106466512.0 0.0 -9.278351e+05 -5.910416e+07 1.025536e+10 0.0 0.0 7.0 9.211719e+08 -1.149020e+08 0.0 0.0 0.0 0.0 -0.66 -0.0066 1.186092e+06 0.00000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 4.040396e+08 7.446013e+08 3.298318e+06 3.291475e+08 0.0 -1.595095e+05 9.915436e+08 -5.817633e+07 0.0 5.803176e+06 6.496371e+08 192195184.0 3.828859e+09 -1.548984e+04 -17411.759766 6.562710e+04 -0.0081 2.808172e+05 0.0 231031.0 0.0 8.390025e+05 0.0 0.0 1.186092e+06 0.0 -0.52 -0.41 -5.478970e+03 -974.940002 0.0 0.000000e+00 48.700001 2.540188e+05 -0.31 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 2196.929932 0.000000 7.008282e+04 0.000000 0.0 2.558000e+01 1.015994e+06 685623.437500 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.03 9.072627e+05 0.0 -6885.850098 975.429993 0.000000 0.0 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.009276e+06 -1215.890015 -32.750000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 0.000000 0.0 0.000000 970.200012 0.0 0.0 0.0
600019 20230930 0.3800 0.329437 3.9397 8.9184 2.2585 4.206 0.595 3.701556e+10 8.511914e+06 7.642702e+09 1.623558e+10 8.071640e+09 1.143739e+09 0.0 0.0 193829.984375 4.589386e+10 0.0 3.777046e+08 2.529115e+10 1.564926e+11 0.0 0.0 236212880.0 3.206167e+10 5.062044e+08 1.496865e+11 1.296584e+10 0.0 0.0 0.000 0.0 1.171897e+10 0.0 5.408097e+08 2.113207e+09 3.217283e+09 1.507966e+09 2.218214e+11 3.783139e+11 5.031663e+09 0.0 8.039347e+09 5.521381e+10 0.0 2.752532e+09 1.636294e+09 0.0 2.463235e+09 5.759834e+09 0.0 1.032952e+10 3.092903e+09 1.161105e+11 3.290351e+10 5.000000e+08 1.662402e+09 0.0 0.000000e+00 1.275575e+09 0.0 4.429832e+10 1.604088e+11 2.226220e+10 5.027811e+10 4.106404e+10 2.295696e+09 8.770589e+10 1.936184e+10 0.0 0.0 2.179052e+11 3.783139e+11 2.550165e+11 2.392988e+11 9.126952e+08 1.304523e+09 2.998376e+09 0.0 6.688735e+08 0.0 1.570999e+08 3.142859e+09 1.798209e+09 0.0 1.244069e+10 0.0 1.156602e+08 6.517343e+08 0.0 0.0 1.190461e+10 2.235816e+09 0.0 9.668798e+09 8.350419e+09 1.318379e+09 2.848425e+11 6.799663e+08 1.256106e+09 2.876144e+11 2.463488e+11 1.112547e+10 5.802110e+09 7.484516e+08 2.743589e+11 1.325544e+10 3.733958e+10 1.955903e+09 7.884238e+08 0.0 1.044830e+10 5.053220e+10 1.544874e+10 2.948478e+10 0.0 6.460067e+09 5.139359e+10 -8.613842e+08 732439360.0 2.335236e+10 7.583261e+07 2.716063e+10 1.945447e+10 4.185510e+09 1.059571e+09 2.469955e+10 2.461082e+09 5.251585e+07 0.0 1.490765e+10 2.178389e+10 3.669153e+10 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.348 0.953 31.879999 18.799999 27.615999 72.384003 0.0 86.110001 1.74 135.839996 116.389999 8.260000 0.0 15.979000 5.208000 7.155 0.657 1.712000 17.0 52.0 1.539 175.0 411.0 1.297 -8.530000 -11.760000 2.014 0.963000 -5.006 -21.410999 -8.220000 -15.550000 -15.570000 0.0 3.940000 4.88 0.358 93.836998 4.206 10.021 3.79 2.151 3.274 6.160000 1.950000 1.176000 0.262 7.334000e+09 1.257349e+10 0.0 0.0 42.400002 41.366001 23.653000 29.327000 39.567001 262.109985 77.010002 367.670013 839.049988 0.5954 112.779999 170.440002 111.699997 5.200000 0.0 0.6739 11.416000 8.264000 137.095001 3.504 8.516201e+10 5.537000e+09 3.798045e+09 3.622551e+09 7.017456e+09 -2.717071e+09 -3.829885e+09 4.120052e+08 2.226220e+10 2.185792e+10 0.0 0.0 268905.0 9.627882e+09 1.674490e+10 1.674490e+10 60.0 1.689323e+10 0.0 0.0 0.0 0.0 0.0 0.0 52.0 318619072.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.674490e+10 9.627882e+09 8.062351e+09 404281248.0 0.0 -1.719380e+06 9.667079e+09 1.985433e+11 0.0 0.0 5.0 1.465805e+10 1.271041e+10 0.0 0.0 2.0 856719168.0 4.23 0.1627 3.445427e+07 93694.03125 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 6.325315e+10 2.387828e+10 1.438229e+09 -5.048967e+08 0.0 4.459038e+08 2.332350e+08 9.668798e+09 0.0 2.253242e+09 1.063454e+09 244047216.0 3.411368e+10 1.107351e+06 907700.000000 1.503983e+06 0.1800 8.516201e+06 0.0 231025.0 0.0 -1.107255e+06 0.0 0.0 3.452431e+07 0.0 -0.66 -0.35 1.449058e+06 443874.156250 1.0 1.059850e+09 36.950001 7.810004e+06 2.89 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3366.139893 0.0 0.0 0.0 1501.969971 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 113957.523438 0.0 0.0 0.0 0.0 103268.031250 52602.628906 2.425457e+06 228472.437500 0.0 1.251237e+06 5.707990e+05 537903.062500 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.38 2.553842e+07 0.0 833310.250000 133397.625000 36463.628906 0.0 300.859985 16794.490234 269.869995 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.476072e+07 -17112.710938 85574.117188 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 27916.890625 0.0 0.0 43994.160156 0.0 0.0 15920.549805 0.0 57799.929688 92856.937500 0.0 0.0 0.0
002237 20230930 0.3600 0.396538 3.5036 7.5607 2.6299 4.521 0.083 4.259851e+09 0.000000e+00 0.000000e+00 7.005266e+06 5.930657e+07 1.159206e+09 0.0 0.0 0.000000 9.103542e+09 0.0 0.000000e+00 2.602975e+08 1.501243e+10 0.0 0.0 5600000.0 3.582441e+08 5.151628e+05 3.638859e+09 7.525972e+08 0.0 0.0 1560595.375 0.0 7.307743e+08 0.0 0.000000e+00 9.434822e+05 5.495366e+07 3.785682e+08 6.050189e+09 2.106262e+10 3.878655e+09 0.0 9.418755e+06 1.368426e+09 6460163.0 9.820207e+07 5.257467e+07 0.0 0.000000e+00 1.426965e+08 0.0 6.740717e+08 1.625753e+07 6.396910e+09 1.216380e+09 3.689615e+09 5.446279e+08 0.0 5.321665e+07 1.027603e+08 0.0 5.679625e+09 1.207653e+10 1.148014e+09 3.019148e+09 4.596447e+08 0.000000e+00 4.022160e+09 -8.965058e+07 0.0 0.0 8.986083e+09 2.106262e+10 5.069455e+10 4.929637e+10 1.361165e+08 3.603511e+07 3.791108e+08 0.0 1.585426e+08 0.0 6.853746e+07 -8.345404e+07 4.062093e+07 0.0 4.613684e+08 0.0 2.806092e+06 9.392503e+06 0.0 0.0 4.547819e+08 6.203864e+07 0.0 3.927433e+08 4.102655e+08 -1.752217e+07 5.417916e+10 4.524709e+08 1.166998e+08 5.474833e+10 5.283126e+10 5.443501e+08 1.028282e+09 2.491267e+08 5.465302e+10 9.530815e+07 0.000000e+00 4.777713e+07 6.366520e+06 0.0 4.011716e+07 9.426082e+07 8.359184e+08 0.000000e+00 0.0 2.628880e+08 1.098806e+09 -1.004546e+09 0.0 8.545382e+09 1.049893e+09 9.595274e+09 7.221909e+09 2.103403e+08 8.612387e+08 8.293488e+09 1.301787e+09 4.395327e+07 0.0 4.365025e+08 2.701049e+09 3.137552e+09 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.347 0.924 66.592003 3.870000 47.029999 52.970001 0.0 144.716995 2.34 74.410004 65.410004 0.790000 0.0 5612.451172 5.445000 6.940 2.477 13.499000 0.0 50.0 3.444 78.0 109.0 5.847 46.779999 1.380000 9.810 -6.017000 5.977 -223.516006 -9.070000 36.279999 36.279999 0.0 0.790000 0.91 0.269 97.241997 4.521 -24.013 0.77 2.004 0.809 2.760000 1.132000 0.748000 0.313 4.552318e+08 6.133245e+08 0.0 0.0 57.340000 71.275002 28.375000 60.639999 17.275999 112.628998 48.880001 94.660004 150.940002 0.0830 108.000000 18.170000 106.870003 0.190000 0.0 0.3802 1.490000 0.789000 24.267000 0.452 1.846685e+10 1.396591e+08 1.184814e+08 1.622638e+08 -3.872057e+07 -7.636061e+08 -2.103362e+09 -2.910732e+09 1.148014e+09 9.104000e+08 0.0 0.0 45049.0 5.106434e+08 4.422539e+08 6.798683e+08 14.0 4.085938e+08 0.0 0.0 0.0 0.0 1.0 8714299.0 9.0 38270528.0 1.0 7751781.0 0.0 0.0 0.0 0.0 0.0 0.0 4.422539e+08 2.730290e+08 5.340940e+08 237614400.0 0.0 -1.022476e+06 3.917208e+08 9.075735e+09 0.0 0.0 2.0 3.407037e+08 4.685511e+08 0.0 0.0 0.0 0.0 4.77 0.1413 6.620393e+06 0.00000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.377845e+09 7.005266e+06 6.025082e+07 6.340218e+06 395884512.0 8.917231e+06 8.686739e+06 3.927433e+08 0.0 1.637948e+08 2.288166e+08 42542088.0 6.293558e+07 5.046902e+04 74664.312500 -1.401569e+05 0.1100 1.846686e+06 0.0 231021.0 0.0 -1.662736e+05 0.0 0.0 6.620393e+06 0.0 -2.55 -1.40 5.783720e+04 11202.169922 1.0 1.315354e+07 78.599998 1.799042e+06 2.30 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2454.239990 0.0 0.0 0.0 15434.759766 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2457.550049 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 4610.830078 0.000000 1.255719e+04 0.000000 0.0 8.872600e+02 8.146530e+03 1277.420044 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.34 5.069454e+06 0.0 40925.558594 -1753.479980 0.000000 0.0 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 5.016996e+06 250.279999 -6840.299805 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 0.000000 0.0 0.000000 0.000000 0.0 0.0 0.0
301182 20230930 -0.3407 -0.402078 0.9219 9.7372 7.6155 -3.499 0.726 1.393095e+08 0.000000e+00 1.015183e+07 1.602085e+08 1.192244e+06 2.165928e+06 0.0 0.0 0.000000 1.365268e+08 0.0 0.000000e+00 1.731894e+08 6.341394e+08 0.0 0.0 0.0 0.000000e+00 2.895364e+06 3.051872e+08 3.374067e+06 0.0 0.0 0.000 0.0 2.041869e+07 0.0 2.084306e+07 5.827906e+07 3.104805e+07 1.032842e+08 5.615780e+08 1.195718e+09 0.000000e+00 0.0 9.965274e+07 7.018332e+07 0.0 1.420772e+07 1.755054e+06 0.0 0.000000e+00 1.595892e+07 0.0 0.000000e+00 2.634903e+06 2.045678e+08 0.000000e+00 0.000000e+00 0.000000e+00 0.0 0.000000e+00 2.449583e+07 0.0 4.273326e+07 2.473011e+08 9.582170e+07 7.297293e+08 1.914118e+07 0.000000e+00 8.834161e+07 1.538017e+07 0.0 0.0 9.484164e+08 1.195718e+09 3.740993e+08 3.467357e+08 2.648032e+06 1.093119e+07 2.968851e+07 0.0 -7.480847e+05 0.0 0.000000e+00 3.834345e+06 0.000000e+00 0.0 -4.145429e+07 0.0 1.866150e+05 3.033520e+04 0.0 0.0 -4.129801e+07 -6.814750e+06 0.0 -3.448326e+07 -3.264911e+07 -1.834148e+06 4.743115e+08 6.203142e+05 1.165565e+07 4.865875e+08 2.330881e+08 1.078232e+08 1.711922e+07 5.898907e+07 4.170196e+08 6.956785e+07 0.000000e+00 0.000000e+00 0.000000e+00 0.0 6.387371e+08 6.387371e+08 1.201614e+08 0.000000e+00 30330536.0 6.059873e+08 7.564792e+08 -1.177421e+08 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 9.765503e+06 2.117923e+06 1.188343e+07 -1.188343e+07 1.033330e+06 0.0 -5.902435e+07 1.692015e+08 1.101772e+08 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.100 2.433 68.098999 56.200001 17.280001 82.720001 0.0 27.731001 1.26 383.510010 179.740005 28.129999 0.0 2.350000 2.594000 0.707 0.318 1.325000 115.0 104.0 0.531 509.0 849.0 0.392 1.160000 -201.559998 -4.310 17.541000 3.437 -17.572001 -214.639999 -302.540009 -302.540009 0.0 -8.860000 -11.08 0.708 92.684998 -3.499 0.000 -9.22 -2.777 -8.727 7.310000 10.658000 7.936000 -0.200 -3.852784e+07 -4.204609e+07 0.0 0.0 20.680000 53.034000 21.968000 21.528999 25.523001 478.709015 90.349998 951.719971 -1120.859985 0.7260 130.070007 0.000000 126.790001 18.600000 0.0 -0.6160 34.007000 28.131001 -201.744003 5.818 1.386184e+08 -1.736750e+07 -1.262557e+07 -1.383436e+07 3.282330e+07 -3.671768e+07 -1.436750e+06 -5.528404e+06 9.582170e+07 3.597170e+07 0.0 0.0 10257.0 3.875000e+07 1.271451e+07 7.052460e+07 7.0 1.001671e+07 2.0 914173.0 1.0 404240.0 0.0 0.0 1.0 3400.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.271451e+07 5.085000e+06 2.727680e+07 59850000.0 0.0 2.500780e+03 -3.448076e+07 9.330363e+08 0.0 0.0 3.0 8.694900e+06 -3.433190e+07 0.0 0.0 0.0 0.0 -3.42 -0.1444 5.088301e+04 0.00000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.698361e+08 1.703603e+08 5.442596e+06 2.500780e+03 0.0 3.462998e+06 0.000000e+00 -3.448326e+07 0.0 2.976095e+07 1.111736e+06 1334661.5 4.635555e+07 -3.249780e+03 -4047.189941 -1.390810e+03 -0.1317 1.386184e+04 0.0 231027.0 0.0 -4.608941e+03 0.0 0.0 5.088301e+04 0.0 0.46 0.46 -4.925920e+03 -1469.160034 0.0 0.000000e+00 40.299999 1.283707e+04 -3.15 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 0.000000 0.000000 1.751000e+01 89.169998 0.0 1.050360e+03 1.624840e+03 1279.479980 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -0.34 3.740993e+04 0.0 -3264.659912 -183.410004 0.000000 0.0 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 4.190163e+04 -22.920000 -360.540009 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 0.000000 0.0 0.000000 0.000000 0.0 0.0 0.0
872925 20230930 0.2000 0.177145 0.9698 3.7965 1.8162 5.146 0.289 4.882582e+07 4.304176e+07 0.000000e+00 2.115504e+07 4.032697e+06 2.754396e+06 0.0 0.0 0.000000 4.084662e+07 0.0 0.000000e+00 3.411436e+06 1.640678e+08 0.0 0.0 0.0 8.056759e+06 1.230938e+08 1.099604e+08 1.308182e+06 0.0 0.0 0.000 0.0 1.044344e+07 0.0 1.729289e+05 7.566346e+05 1.221549e+06 0.000000e+00 2.573893e+08 4.214571e+08 0.000000e+00 0.0 0.000000e+00 2.807178e+07 0.0 3.842250e+06 1.379389e+05 0.0 0.000000e+00 5.832351e+06 0.0 1.101373e+06 1.192099e+04 4.467866e+07 0.000000e+00 0.000000e+00 1.280000e+06 0.0 9.404205e+04 2.418759e+06 0.0 5.208494e+06 4.988715e+07 9.807164e+07 1.781224e+08 1.562120e+07 1.459986e+07 9.511315e+07 -7.585306e+05 0.0 0.0 3.715700e+08 4.214571e+08 1.410670e+08 7.067010e+07 8.437971e+05 2.163731e+07 1.232034e+07 0.0 -6.195348e+05 0.0 4.157279e+04 7.991949e+04 -2.192524e+05 0.0 2.111209e+07 0.0 1.168094e+05 5.065196e+05 0.0 0.0 2.072238e+07 9.316106e+05 0.0 1.979077e+07 1.916124e+07 6.295297e+05 1.496174e+08 1.352130e+07 6.674636e+06 1.698134e+08 7.181382e+07 3.645994e+07 4.502368e+06 2.866092e+07 1.414370e+08 2.837634e+07 2.765173e+08 4.005782e+05 0.000000e+00 0.0 0.000000e+00 2.769179e+08 2.717120e+07 2.438449e+08 0.0 0.000000e+00 2.710161e+08 5.901786e+06 3380000.0 0.000000e+00 0.000000e+00 3.380000e+06 0.000000e+00 9.771818e+06 1.341476e+06 1.111329e+07 -7.733294e+06 1.484917e+05 0.0 2.669332e+07 2.213250e+07 4.882582e+07 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.672 2.758 109.281998 -32.450001 10.441000 89.558998 0.0 13.792000 1.13 744.820007 318.290009 56.880001 0.0 5.762000 1.761000 1.090 0.336 2.054000 47.0 153.0 0.804 336.0 803.0 0.382 0.300000 -38.540001 1.758 301.404999 0.908 -96.829002 -39.400002 -69.010002 -38.330002 0.0 18.870001 14.97 0.598 50.097000 5.146 0.110 14.03 4.567 13.583 49.900002 23.632999 8.734000 -0.439 1.737293e+07 2.010284e+07 0.0 0.0 11.840000 38.929001 29.760000 24.896000 26.091000 857.804016 99.709999 33736.968750 -332.709991 0.2893 120.379997 149.000000 106.059998 20.120001 0.0 0.2722 63.512001 56.881001 143.382004 6.733 4.026745e+07 3.652828e+06 4.042270e+06 3.194880e+06 5.467737e+06 -8.872674e+06 2.167114e+06 -1.694584e+06 9.807164e+07 5.529505e+07 0.0 0.0 5326.0 2.540611e+07 0.000000e+00 7.013762e+07 3.0 4.591603e+06 0.0 0.0 0.0 0.0 0.0 0.0 3.0 4591603.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000e+00 0.000000e+00 3.272604e+07 42776592.0 0.0 2.258876e+05 2.001666e+07 3.723285e+08 0.0 0.0 0.0 0.000000e+00 2.929803e+07 0.0 0.0 0.0 0.0 5.15 0.0326 1.955538e+04 0.00000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.807178e+07 2.115504e+07 5.000000e+04 0.000000e+00 0.0 1.538643e+06 0.000000e+00 1.979077e+07 0.0 1.717036e+07 0.000000e+00 -188671.5 2.328821e+07 2.828580e+03 2659.489990 -1.050050e+03 0.0500 4.026740e+03 0.0 231030.0 0.0 -2.577356e+03 0.0 0.0 1.955538e+04 0.0 0.12 0.12 2.813640e+03 385.630005 0.0 0.000000e+00 2.210000 1.833020e+03 5.19 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.0 0.0 0.000000 0.000000 5.681000e+02 0.000000 0.0 0.000000e+00 2.375700e+02 136.570007 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.20 1.410670e+04 0.0 1938.709961 62.950001 0.000000 0.0 0.000000 0.000000 0.000000 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.220224e+04 74.739998 -34.009998 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.000000 0.0 0.0 0.000000 0.0 0.0 0.000000 0.0 0.000000 0.000000 0.0 0.0 0.0

1.每股指标

'001基本每股收益', 'EPS',
'002扣除非经常性损益每股收益', 'deductEPS',
'003每股未分配利润', 'undistributedProfitPerShare',
'004每股净资产', 'netAssetsPerShare',
'005每股资本公积金', 'capitalReservePerShare',
'006净资产收益率', 'ROE',
'007每股经营现金流量', 'operatingCashFlowPerShare',

2.1.1 流动资产

'008货币资金', 'moneyFunds',
'009交易性金融资产', 'tradingFinancialAssets',
'010应收票据', 'billsReceivables',
'011应收账款', 'accountsReceivables',
'012预付款项', 'prepayments',
'013其他应收款', 'otherReceivables',
'014应收关联公司款', 'interCompanyReceivables',
'015应收利息', 'interestReceivables',
'016应收股利', 'dividendsReceivables',
'017存货', 'inventory',
'018其中,消耗性生物资产', 'expendableBiologicalAssets',
'019一年内到期的非流动资产', 'noncurrentAssetsDueWithinOneYear',
'020其他流动资产', 'otherLiquidAssets',
'021流动资产合计', 'totalLiquidAssets',

2.1.2 非流动资产

'022可供出售金融资产', 'availableForSaleSecurities',
'023持有至到期投资', 'heldToMaturityInvestments',
'024长期应收款', 'longTermReceivables',
'025长期股权投资', 'longTermEquityInvestment',
'026投资性房地产', 'investmentRealEstate',
'027固定资产', 'fixedAssets',
'028在建工程', 'constructionInProgress',
'029工程物资', 'engineerMaterial',
'030固定资产清理', 'fixedAssetsCleanUp',
'031生产性生物资产', 'productiveBiologicalAssets',
'032油气资产', 'oilAndGasAssets',
'033无形资产', 'intangibleAssets',
'034开发支出', 'developmentExpenditure',
'035商誉', 'goodwill',
'036长期待摊费用', 'longTermDeferredExpenses',
'037递延所得税资产', 'deferredIncomeTaxAssets',
'038其他非流动资产', 'otherNonCurrentAssets',
'039非流动资产合计', 'totalNonCurrentAssets',
'040资产总计', 'totalAssets',   

2.2.1 流动负债

'041短期借款', 'shortTermLoan',
'042交易性金融负债', 'tradingFinancialLiabilities',
'043应付票据', 'billsPayable',
'044应付账款', 'accountsPayable',
'045预收款项', 'advancedReceivable',
'046应付职工薪酬', 'employeesPayable',
'047应交税费', 'taxPayable',
'048应付利息', 'interestPayable',
'049应付股利', 'dividendPayable',
'050其他应付款', 'otherPayable',
'051应付关联公司款', 'interCompanyPayable',
'052一年内到期的非流动负债', 'noncurrentLiabilitiesDueWithinOneYear',
'053其他流动负债', 'otherCurrentLiabilities',
'054流动负债合计', 'totalCurrentLiabilities',

2.2.2 非流动负债

'055长期借款', 'longTermLoans',
'056应付债券', 'bondsPayable',
'057长期应付款', 'longTermPayable',
'058专项应付款', 'specialPayable',
'059预计负债', 'estimatedLiabilities',
'060递延所得税负债', 'defferredIncomeTaxLiabilities',
'061其他非流动负债', 'otherNonCurrentLiabilities',
'062非流动负债合计', 'totalNonCurrentLiabilities',
'063负债合计', 'totalLiabilities',

2.3 所有者权益

'064实收资本(或股本)', 'totalShare',
'065资本公积', 'capitalReserve',
'066盈余公积', 'surplusReserve',
'067减,库存股', 'treasuryStock',
'068未分配利润', 'undistributedProfits',
'069少数股东权益', 'minorityEquity',
'070外币报表折算价差', 'foreignCurrencyReportTranslationSpread',
'071非正常经营项目收益调整', 'abnormalBusinessProjectEarningsAdjustment',
'072所有者权益(或股东权益)合计', 'totalOwnersEquity',
'073负债和所有者(或股东权益)合计', 'totalLiabilitiesAndOwnersEquity',

3. 利润表

'074其中,营业收入', 'operatingRevenue',
'075其中,营业成本', 'operatingCosts',
'076营业税金及附加', 'taxAndSurcharges',
'077销售费用', 'salesCosts',
'078管理费用', 'managementCosts',
'079堪探费用', 'explorationCosts',
'080财务费用', 'financialCosts',
'081资产减值损失', 'assestsDevaluation',
'082加,公允价值变动净收益', 'profitAndLossFromFairValueChanges',
'083投资收益', 'investmentIncome',
'084其中,对联营企业和合营企业的投资收益', 'investmentIncomeFromAffiliatedBusinessAndCooperativeEnterprise',
'085影响营业利润的其他科目', 'otherSubjectsAffectingOperatingProfit',
'086三、营业利润', 'operatingProfit',
'087加,补贴收入', 'subsidyIncome',
'088营业外收入', 'nonOperatingIncome',
'089减,营业外支出', 'nonOperatingExpenses',
'090其中,非流动资产处置净损失', 'netLossFromDisposalOfNonCurrentAssets',
'091加,影响利润总额的其他科目', 'otherSubjectsAffectTotalProfit',
'092四、利润总额', 'totalProfit',
'093减,所得税', 'incomeTax',
'094加,影响净利润的其他科目', 'otherSubjectsAffectNetProfit',
'095五、净利润', 'netProfit',
'096归属于母公司所有者的净利润', 'netProfitsBelongToParentCompanyOwner',
'097少数股东损益', 'minorityProfitAndLoss',    

4.1 经营活动 Operating

'098销售商品、提供劳务收到的现金', 'cashFromGoodsSalesorOrRenderingOfServices',
'099收到的税费返还', 'refundOfTaxAndFeeReceived',
'100收到其他与经营活动有关的现金', 'otherCashRelatedBusinessActivitiesReceived',
'101经营活动现金流入小计', 'cashInflowsFromOperatingActivities',
'102购买商品、接受劳务支付的现金', 'buyingGoodsReceivingCashPaidForLabor',
'103支付给职工以及为职工支付的现金', 'paymentToEmployeesAndCashPaidForEmployees',
'104支付的各项税费', 'paymentsOfVariousTaxes',
'105支付其他与经营活动有关的现金', 'paymentOfOtherCashRelatedToBusinessActivities',
'106经营活动现金流出小计', 'cashOutflowsFromOperatingActivities',
'107经营活动产生的现金流量净额', 'netCashFlowsFromOperatingActivities',

4.2 投资活动 Investment

'108收回投资收到的现金', 'cashReceivedFromInvestmentReceived',
'109取得投资收益收到的现金', 'cashReceivedFromInvestmentIncome',
'110处置固定资产、无形资产和其他长期资产收回的现金净额', 'disposalOfNetCashForRecoveryOfFixedAssetsIntangibleAssetsAndOtherLongTermAssets',
'111处置子公司及其他营业单位收到的现金净额', 'disposalOfNetCashReceivedFromSubsidiariesAndOtherBusinessUnits',
'112收到其他与投资活动有关的现金', 'otherCashReceivedRelatingToInvestingActivities',
'113投资活动现金流入小计', 'cashinFlowsFromInvestmentActivities',
'114购建固定资产、无形资产和其他长期资产支付的现金', 'cashForThePurchaseConstructionPaymentOfFixedAssetsIntangibleAssetsAndOtherLongTermAssets',
'115投资支付的现金', 'cashInvestment',
'116取得子公司及其他营业单位支付的现金净额', 'acquisitionOfNetCashPaidBySubsidiariesAndOtherBusinessUnits',
'117支付其他与投资活动有关的现金', 'otherCashPaidRelatingToInvestingActivities',
'118投资活动现金流出小计', 'cashOutflowsFromInvestmentActivities',
'119投资活动产生的现金流量净额', 'netCashFlowsFromInvestingActivities',

4.x.1 将净利润调节为经营活动现金流量 Convert net profit to cash flow from operating activities

'134净利润', 'netProfitFromOperatingActivities',
'135资产减值准备', 'provisionForAssetsLosses',
'136固定资产折旧、油气资产折耗、生产性生物资产折旧', 'depreciationForFixedAssets',
'137无形资产摊销', 'amortizationOfIntangibleAssets',
'138长期待摊费用摊销', 'amortizationOfLong-termDeferredExpenses',
'139处置固定资产、无形资产和其他长期资产的损失', 'lossOfDisposingFixedAssetsIntangibleAssetsAndOtherLong-termAssets',
'140固定资产报废损失', 'scrapLossOfFixedAssets',
'141公允价值变动损失', 'lossFromFairValueChange',
'142财务费用', 'financialExpenses',
'143投资损失', 'investmentLosses',
'144递延所得税资产减少', 'decreaseOfDeferredTaxAssets',
'145递延所得税负债增加', 'increaseOfDeferredTaxLiabilities',
'146存货的减少', 'decreaseOfInventory',
'147经营性应收项目的减少', 'decreaseOfOperationReceivables',
'148经营性应付项目的增加', 'increaseOfOperationPayables',
'149其他', 'others',
'150经营活动产生的现金流量净额2', 'netCashFromOperatingActivities2',

4.x.3 现金及现金等价物净增加情况 Net increase of cash and cash equivalents

'154现金的期末余额', 'cashEndingBal',
'155现金的期初余额', 'cashBeginingBal',
'156现金等价物的期末余额', 'cashEquivalentsEndingBal',
'157现金等价物的期初余额', 'cashEquivalentsBeginningBal',
'158现金及现金等价物净增加额', 'netIncreaseOfCashAndCashEquivalents',

5. 偿债能力分析

'159流动比率', 'currentRatio',  # 流动资产/流动负债
'160速动比率', 'acidTestRatio',  # (流动资产-存货)/流动负债
'161现金比率(%)', 'cashRatio',  # (货币资金+有价证券)÷流动负债
'162利息保障倍数', 'interestCoverageRatio',  # (利润总额+财务费用(仅指利息费用部份))/利息费用
'163非流动负债比率(%)', 'noncurrentLiabilitiesRatio',
'164流动负债比率(%)', 'currentLiabilitiesRatio',
'165现金到期债务比率(%)', 'cashDebtRatio',  # 企业经营现金净流入/(本期到期长期负债+本期应付票据)
'166有形资产净值债务率(%)', 'debtToTangibleAssetsRatio',
'167权益乘数(%)', 'equityMultiplier',  # 资产总额/股东权益总额
'168股东的权益/负债合计(%)', 'equityDebtRatio',  # 权益负债率
'169有形资产/负债合计(%)', 'tangibleAssetDebtRatio ',  # 有形资产负债率
'170经营活动产生的现金流量净额/负债合计(%)', 'netCashFlowsFromOperatingActivitiesDebtRatio',
'171EBITDA/负债合计(%)', 'EBITDA/Liabilities',

6. 经营效率分析

销售收入÷平均应收账款=销售收入\(0.5 x(应收账款期初+期末))
'172应收帐款周转率', 'turnoverRatioOfReceivable;',
'173存货周转率', 'turnoverRatioOfInventory',
(存货周转天数+应收帐款周转天数-应付帐款周转天数+预付帐款周转天数-预收帐款周转天数)/365
'174运营资金周转率', 'turnoverRatioOfOperatingAssets',
'175总资产周转率', 'turnoverRatioOfTotalAssets',
'176固定资产周转率', 'turnoverRatioOfFixedAssets',  # 企业销售收入与固定资产净值的比率
'177应收帐款周转天数', 'daysSalesOutstanding',  # 企业从取得应收账款的权利到收回款项、转换为现金所需要的时间
'178存货周转天数', 'daysSalesOfInventory',  # 企业从取得存货开始,至消耗、销售为止所经历的天数
'179流动资产周转率', 'turnoverRatioOfCurrentAssets',  # 流动资产周转率(次)=主营业务收入/平均流动资产总额
'180流动资产周转天数', 'daysSalesofCurrentAssets',
'181总资产周转天数', 'daysSalesofTotalAssets',
'182股东权益周转率', 'equityTurnover',  # 销售收入/平均股东权益

7. 发展能力分析

'183营业收入增长率(%)', 'operatingIncomeGrowth',
'184净利润增长率(%)', 'netProfitGrowthRate',  # NPGR  利润总额-所得税
'185净资产增长率(%)', 'netAssetsGrowthRate',
'186固定资产增长率(%)', 'fixedAssetsGrowthRate',
'187总资产增长率(%)', 'totalAssetsGrowthRate',
'188投资收益增长率(%)', 'investmentIncomeGrowthRate',
'189营业利润增长率(%)', 'operatingProfitGrowthRate',
'190暂无', 'None1',
'191暂无', 'None2',
'192暂无', 'None3',

8. 获利能力分析

'193成本费用利润率(%)', 'rateOfReturnOnCost',
'194营业利润率', 'rateOfReturnOnOperatingProfit',
'195营业税金率', 'rateOfReturnOnBusinessTax',
'196营业成本率', 'rateOfReturnOnOperatingCost',
'197净资产收益率', 'rateOfReturnOnCommonStockholdersEquity',
'198投资收益率', 'rateOfReturnOnInvestmentIncome',
'199销售净利率(%)', 'rateOfReturnOnNetSalesProfit',
'200总资产报酬率', 'rateOfReturnOnTotalAssets',
'201净利润率', 'netProfitMargin',
'202销售毛利率(%)', 'rateOfReturnOnGrossProfitFromSales',
'203三费比重', 'threeFeeProportion',
'204管理费用率', 'ratioOfChargingExpense',
'205财务费用率', 'ratioOfFinancialExpense',
'206扣除非经常性损益后的净利润', 'netProfitAfterExtraordinaryGainsAndLosses',
'207息税前利润(EBIT)', 'EBIT',
'208息税折旧摊销前利润(EBITDA)', 'EBITDA',
'209EBITDA/营业总收入(%)', 'EBITDA/GrossRevenueRate',

9. 资本结构分析

'210资产负债率(%)', 'assetsLiabilitiesRatio',
'211流动资产比率', 'currentAssetsRatio',  # 期末的流动资产除以所有者权益
'212货币资金比率', 'monetaryFundRatio',
'213存货比率', 'inventoryRatio',
'214固定资产比率', 'fixedAssetsRatio',
'215负债结构比', 'liabilitiesStructureRatio',
'216归属于母公司股东权益/全部投入资本(%)', 'shareholdersOwnershipOfAParentCompany/TotalCapital',
'217股东的权益/带息债务(%)', 'shareholdersInterest/InterestRateDebtRatio',
'218有形资产/净债务(%)', 'tangibleAssets/NetDebtRatio',

10. 现金流量分析

'219每股经营性现金流(元)', 'operatingCashFlowPerShare',
'220营业收入现金含量(%)', 'cashOfOperatingIncome',
'221经营活动产生的现金流量净额/经营活动净收益(%)', 'netOperatingCashFlow/netOperationProfit',
'222销售商品提供劳务收到的现金/营业收入(%)', 'cashFromGoodsSales/OperatingRevenue',
'223经营活动产生的现金流量净额/营业收入', 'netOperatingCashFlow/OperatingRevenue',
'224资本支出/折旧和摊销', 'capitalExpenditure/DepreciationAndAmortization',
'225每股现金流量净额(元)', 'netCashFlowPerShare',
'226经营净现金比率(短期债务)', 'operatingCashFlow/ShortTermDebtRatio',
'227经营净现金比率(全部债务)', 'operatingCashFlow/LongTermDebtRatio',
'228经营活动现金净流量与净利润比率', 'cashFlowRateAndNetProfitRatioOfOperatingActivities',
'229全部资产现金回收率', 'cashRecoveryForAllAssets',

11. 单季度财务指标

'230营业收入', 'operatingRevenueSingle',
'231营业利润', 'operatingProfitSingle',
'232归属于母公司所有者的净利润', 'netProfitBelongingToTheOwnerOfTheParentCompanySingle',
'233扣除非经常性损益后的净利润', 'netProfitAfterExtraordinaryGainsAndLossesSingle',
'234经营活动产生的现金流量净额', 'netCashFlowsFromOperatingActivitiesSingle',
'235投资活动产生的现金流量净额', 'netCashFlowsFromInvestingActivitiesSingle',
'236筹资活动产生的现金流量净额', 'netCashFlowsFromFinancingActivitiesSingle',
'237现金及现金等价物净增加额', 'netIncreaseInCashAndCashEquivalentsSingle',
"""
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
str1 = [
'001基本每股收益',
'EPS',
'002扣除非经常性损益每股收益',
'deductEPS',
'003每股未分配利润',
'undistributedProfitPerShare',
'004每股净资产',
'netAssetsPerShare',
'005每股资本公积金',
'capitalReservePerShare',
'006净资产收益率',
'ROE',
'007每股经营现金流量',
'operatingCashFlowPerShare',
'008货币资金',
'moneyFunds',
'009交易性金融资产',
'tradingFinancialAssets',
'010应收票据',
'billsReceivables',
'011应收账款',
'accountsReceivables',
'012预付款项',
'prepayments',
'013其他应收款',
'otherReceivables',
'014应收关联公司款',
'interCompanyReceivables',
'015应收利息',
'interestReceivables',
'016应收股利',
'dividendsReceivables',
'017存货',
'inventory',
'018其中,消耗性生物资产',
'expendableBiologicalAssets',
'019一年内到期的非流动资产',
'noncurrentAssetsDueWithinOneYear',
'020其他流动资产',
'otherLiquidAssets',
'021流动资产合计',
'totalLiquidAssets',
'022可供出售金融资产',
'availableForSaleSecurities',
'023持有至到期投资',
'heldToMaturityInvestments',
'024长期应收款',
'longTermReceivables',
'025长期股权投资',
'longTermEquityInvestment',
'026投资性房地产',
'investmentRealEstate',
'027固定资产',
'fixedAssets',
'028在建工程',
'constructionInProgress',
'029工程物资',
'engineerMaterial',
'030固定资产清理',
'fixedAssetsCleanUp',
'031生产性生物资产',
'productiveBiologicalAssets',
'032油气资产',
'oilAndGasAssets',
'033无形资产',
'intangibleAssets',
'034开发支出',
'developmentExpenditure',
'035商誉',
'goodwill',
'036长期待摊费用',
'longTermDeferredExpenses',
'037递延所得税资产',
'deferredIncomeTaxAssets',
'038其他非流动资产',
'otherNonCurrentAssets',
'039非流动资产合计',
'totalNonCurrentAssets',
'040资产总计',
'totalAssets',
'041短期借款',
'shortTermLoan',
'042交易性金融负债',
'tradingFinancialLiabilities',
'043应付票据',
'billsPayable',
'044应付账款',
'accountsPayable',
'045预收款项',
'advancedReceivable',
'046应付职工薪酬',
'employeesPayable',
'047应交税费',
'taxPayable',
'048应付利息',
'interestPayable',
'049应付股利',
'dividendPayable',
'050其他应付款',
'otherPayable',
'051应付关联公司款',
'interCompanyPayable',
'052一年内到期的非流动负债',
'noncurrentLiabilitiesDueWithinOneYear',
'053其他流动负债',
'otherCurrentLiabilities',
'054流动负债合计',
'totalCurrentLiabilities',
'055长期借款',
'longTermLoans',
'056应付债券',
'bondsPayable',
'057长期应付款',
'longTermPayable',
'058专项应付款',
'specialPayable',
'059预计负债',
'estimatedLiabilities',
'060递延所得税负债',
'defferredIncomeTaxLiabilities',
'061其他非流动负债',
'otherNonCurrentLiabilities',
'062非流动负债合计',
'totalNonCurrentLiabilities',
'063负债合计',
'totalLiabilities',
'064实收资本(或股本)',
'totalShare',
'065资本公积',
'capitalReserve',
'066盈余公积',
'surplusReserve',
'067减,库存股',
'treasuryStock',
'068未分配利润',
'undistributedProfits',
'069少数股东权益',
'minorityEquity',
'070外币报表折算价差',
'foreignCurrencyReportTranslationSpread',
'071非正常经营项目收益调整',
'abnormalBusinessProjectEarningsAdjustment',
'072所有者权益(或股东权益)合计',
'totalOwnersEquity',
'073负债和所有者(或股东权益)合计',
'totalLiabilitiesAndOwnersEquity',
'074其中,营业收入',
'operatingRevenue',
'075其中,营业成本',
'operatingCosts',
'076营业税金及附加',
'taxAndSurcharges',
'077销售费用',
'salesCosts',
'078管理费用',
'managementCosts',
'079堪探费用',
'explorationCosts',
'080财务费用',
'financialCosts',
'081资产减值损失',
'assestsDevaluation',
'082加,公允价值变动净收益',
'profitAndLossFromFairValueChanges',
'083投资收益',
'investmentIncome',
'084其中,对联营企业和合营企业的投资收益',
'investmentIncomeFromAffiliatedBusinessAndCooperativeEnterprise',
'085影响营业利润的其他科目',
'otherSubjectsAffectingOperatingProfit',
'086三、营业利润',
'operatingProfit',
'087加,补贴收入',
'subsidyIncome',
'088营业外收入',
'nonOperatingIncome',
'089减,营业外支出',
'nonOperatingExpenses',
'090其中,非流动资产处置净损失',
'netLossFromDisposalOfNonCurrentAssets',
'091加,影响利润总额的其他科目',
'otherSubjectsAffectTotalProfit',
'092四、利润总额',
'totalProfit',
'093减,所得税',
'incomeTax',
'094加,影响净利润的其他科目',
'otherSubjectsAffectNetProfit',
'095五、净利润',
'netProfit',
'096归属于母公司所有者的净利润',
'netProfitsBelongToParentCompanyOwner',
'097少数股东损益',
'minorityProfitAndLoss',
'098销售商品、提供劳务收到的现金',
'cashFromGoodsSalesorOrRenderingOfServices',
'099收到的税费返还',
'refundOfTaxAndFeeReceived',
'100收到其他与经营活动有关的现金',
'otherCashRelatedBusinessActivitiesReceived',
'101经营活动现金流入小计',
'cashInflowsFromOperatingActivities',
'102购买商品、接受劳务支付的现金',
'buyingGoodsReceivingCashPaidForLabor',
'103支付给职工以及为职工支付的现金',
'paymentToEmployeesAndCashPaidForEmployees',
'104支付的各项税费',
'paymentsOfVariousTaxes',
'105支付其他与经营活动有关的现金',
'paymentOfOtherCashRelatedToBusinessActivities',
'106经营活动现金流出小计',
'cashOutflowsFromOperatingActivities',
'107经营活动产生的现金流量净额',
'netCashFlowsFromOperatingActivities',
'108收回投资收到的现金',
'cashReceivedFromInvestmentReceived',
'109取得投资收益收到的现金',
'cashReceivedFromInvestmentIncome',
'110处置固定资产、无形资产和其他长期资产收回的现金净额',
'disposalOfNetCashForRecoveryOfFixedAssetsIntangibleAssetsAndOtherLongTermAssets',
'111处置子公司及其他营业单位收到的现金净额',
'disposalOfNetCashReceivedFromSubsidiariesAndOtherBusinessUnits',
'112收到其他与投资活动有关的现金',
'otherCashReceivedRelatingToInvestingActivities',
'113投资活动现金流入小计',
'cashinFlowsFromInvestmentActivities',
'114购建固定资产、无形资产和其他长期资产支付的现金',
'cashForThePurchaseConstructionPaymentOfFixedAssetsIntangibleAssetsAndOtherLongTermAssets',
'115投资支付的现金',
'cashInvestment',
'116取得子公司及其他营业单位支付的现金净额',
'acquisitionOfNetCashPaidBySubsidiariesAndOtherBusinessUnits',
'117支付其他与投资活动有关的现金',
'otherCashPaidRelatingToInvestingActivities',
'118投资活动现金流出小计',
'cashOutflowsFromInvestmentActivities',
'119投资活动产生的现金流量净额',
'netCashFlowsFromInvestingActivities',
'134净利润',
'netProfitFromOperatingActivities',
'135资产减值准备',
'provisionForAssetsLosses',
'136固定资产折旧、油气资产折耗、生产性生物资产折旧',
'depreciationForFixedAssets',
'137无形资产摊销',
'amortizationOfIntangibleAssets',
'138长期待摊费用摊销',
'amortizationOfLong-termDeferredExpenses',
'139处置固定资产、无形资产和其他长期资产的损失',
'lossOfDisposingFixedAssetsIntangibleAssetsAndOtherLong-termAssets',
'140固定资产报废损失',
'scrapLossOfFixedAssets',
'141公允价值变动损失',
'lossFromFairValueChange',
'142财务费用',
'financialExpenses',
'143投资损失',
'investmentLosses',
'144递延所得税资产减少',
'decreaseOfDeferredTaxAssets',
'145递延所得税负债增加',
'increaseOfDeferredTaxLiabilities',
'146存货的减少',
'decreaseOfInventory',
'147经营性应收项目的减少',
'decreaseOfOperationReceivables',
'148经营性应付项目的增加',
'increaseOfOperationPayables',
'149其他',
'others',
'150经营活动产生的现金流量净额2',
'netCashFromOperatingActivities2',
'154现金的期末余额',
'cashEndingBal',
'155现金的期初余额',
'cashBeginingBal',
'156现金等价物的期末余额',
'cashEquivalentsEndingBal',
'157现金等价物的期初余额',
'cashEquivalentsBeginningBal',
'158现金及现金等价物净增加额',
'netIncreaseOfCashAndCashEquivalents',
'159流动比率',
'currentRatio',
'160速动比率',
'acidTestRatio',
'161现金比率(%)',
'cashRatio',
'162利息保障倍数',
'interestCoverageRatio',
'163非流动负债比率(%)',
'noncurrentLiabilitiesRatio',
'164流动负债比率(%)',
'currentLiabilitiesRatio',
'165现金到期债务比率(%)',
'cashDebtRatio',
'166有形资产净值债务率(%)',
'debtToTangibleAssetsRatio',
'167权益乘数(%)',
'equityMultiplier',
'168股东的权益/负债合计(%)',
'equityDebtRatio',
'169有形资产/负债合计(%)',
'tangibleAssetDebtRatio ',
'170经营活动产生的现金流量净额/负债合计(%)',
'netCashFlowsFromOperatingActivitiesDebtRatio',
'171EBITDA/负债合计(%)',
'EBITDA/Liabilities',
'172应收帐款周转率',
'turnoverRatioOfReceivable;',
'173存货周转率',
'turnoverRatioOfInventory',
'174运营资金周转率',
'turnoverRatioOfOperatingAssets',
'175总资产周转率',
'turnoverRatioOfTotalAssets',
'176固定资产周转率',
'turnoverRatioOfFixedAssets',
'177应收帐款周转天数',
'daysSalesOutstanding',
'178存货周转天数',
'daysSalesOfInventory',
'179流动资产周转率',
'turnoverRatioOfCurrentAssets',
'180流动资产周转天数',
'daysSalesofCurrentAssets',
'181总资产周转天数',
'daysSalesofTotalAssets',
'182股东权益周转率',
'equityTurnover',
'183营业收入增长率(%)',
'operatingIncomeGrowth',
'184净利润增长率(%)',
'netProfitGrowthRate',
'185净资产增长率(%)',
'netAssetsGrowthRate',
'186固定资产增长率(%)',
'fixedAssetsGrowthRate',
'187总资产增长率(%)',
'totalAssetsGrowthRate',
'188投资收益增长率(%)',
'investmentIncomeGrowthRate',
'189营业利润增长率(%)',
'operatingProfitGrowthRate',
'190暂无',
'None1',
'191暂无',
'None2',
'192暂无',
'None3',
'193成本费用利润率(%)',
'rateOfReturnOnCost',
'194营业利润率',
'rateOfReturnOnOperatingProfit',
'195营业税金率',
'rateOfReturnOnBusinessTax',
'196营业成本率',
'rateOfReturnOnOperatingCost',
'197净资产收益率',
'rateOfReturnOnCommonStockholdersEquity',
'198投资收益率',
'rateOfReturnOnInvestmentIncome',
'199销售净利率(%)',
'rateOfReturnOnNetSalesProfit',
'200总资产报酬率',
'rateOfReturnOnTotalAssets',
'201净利润率',
'netProfitMargin',
'202销售毛利率(%)',
'rateOfReturnOnGrossProfitFromSales',
'203三费比重',
'threeFeeProportion',
'204管理费用率',
'ratioOfChargingExpense',
'205财务费用率',
'ratioOfFinancialExpense',
'206扣除非经常性损益后的净利润',
'netProfitAfterExtraordinaryGainsAndLosses',
'207息税前利润(EBIT)',
'EBIT',
'208息税折旧摊销前利润(EBITDA)',
'EBITDA',
'209EBITDA/营业总收入(%)',
'EBITDA/GrossRevenueRate',
'210资产负债率(%)',
'assetsLiabilitiesRatio',
'211流动资产比率',
'currentAssetsRatio',
'212货币资金比率',
'monetaryFundRatio',
'213存货比率',
'inventoryRatio',
'214固定资产比率',
'fixedAssetsRatio',
'215负债结构比',
'liabilitiesStructureRatio',
'216归属于母公司股东权益/全部投入资本(%)',
'shareholdersOwnershipOfAParentCompany/TotalCapital',
'217股东的权益/带息债务(%)',
'shareholdersInterest/InterestRateDebtRatio',
'218有形资产/净债务(%)',
'tangibleAssets/NetDebtRatio',
'219每股经营性现金流(元)',
'operatingCashFlowPerShare',
'220营业收入现金含量(%)',
'cashOfOperatingIncome',
'221经营活动产生的现金流量净额/经营活动净收益(%)',
'netOperatingCashFlow/netOperationProfit',
'222销售商品提供劳务收到的现金/营业收入(%)',
'cashFromGoodsSales/OperatingRevenue',
'223经营活动产生的现金流量净额/营业收入',
'netOperatingCashFlow/OperatingRevenue',
'224资本支出/折旧和摊销',
'capitalExpenditure/DepreciationAndAmortization',
'225每股现金流量净额(元)',
'netCashFlowPerShare',
'226经营净现金比率(短期债务)',
'operatingCashFlow/ShortTermDebtRatio',
'227经营净现金比率(全部债务)',
'operatingCashFlow/LongTermDebtRatio',
'228经营活动现金净流量与净利润比率',
'cashFlowRateAndNetProfitRatioOfOperatingActivities',
'229全部资产现金回收率',
'cashRecoveryForAllAssets',
'230营业收入',
'operatingRevenueSingle',
'231营业利润',
'operatingProfitSingle',
'232归属于母公司所有者的净利润',
'netProfitBelongingToTheOwnerOfTheParentCompanySingle',
'233扣除非经常性损益后的净利润',
'netProfitAfterExtraordinaryGainsAndLossesSingle',
'234经营活动产生的现金流量净额',
'netCashFlowsFromOperatingActivitiesSingle',
'235投资活动产生的现金流量净额',
'netCashFlowsFromInvestingActivitiesSingle',
'236筹资活动产生的现金流量净额',
'netCashFlowsFromFinancingActivitiesSingle',
'237现金及现金等价物净增加额',
'netIncreaseInCashAndCashEquivalentsSingle',
]

标准行情接口数据下载实例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from pytdx.hq import TdxHq_API
from pytdx.exhq import TdxExHq_API
from pytdx.hq import TDXParams


api = TdxHq_API(multithread=True, heartbeat=True, auto_retry=True)

with api.connect('116.205.171.132', 7709):
# 获取股票列表
# api.to_df(api.get_security_list(0, 0))
# 日k数据
api.get_k_data('000409', '2017-07-03', '2017-07-10')
# 获取即时行情
api.to_df(api.get_security_quotes([(0, '000409'), (1, '600963')])).head()
# 查询分时行情
api.to_df(api.get_minute_time_data(1, '600963')).sample(3)[-10:]
# 查询历史分时行情
api.get_history_minute_time_data(1, '600963', 20161209)[-3:]
# 查询分笔成交
api.to_df(api.get_transaction_data(0, '000409', 0, 30)).sample(3)
# 查询历史分笔成交
# api.get_history_transaction_data(0, '000409', 0, 10, 20170209)
# 查询公司信息目录
api.to_df(api.get_company_info_category(0, '000409')).sample(3)
# 读取公司信息详情,经测试无效
# api.get_company_info_content(0, '000409', '000409.txt', 0, 0)
# 读取除权除息信息
# api.to_df(api.get_xdxr_info(1, '600963'))
# 读取财务信息
api.to_df(api.get_finance_info(0, '000409'))
# 读取板块信息
api.to_df(api.get_and_parse_block_info("block.dat")).sample(3)
open close high low vol amount date code
date
2017-07-06 9.01 9.25 9.47 9.01 251818.0 231596432.0 2017-07-06 000409
2017-07-07 9.00 9.54 9.65 8.81 277977.0 254308064.0 2017-07-07 000409
2017-07-10 9.30 9.27 9.47 9.19 146859.0 136830960.0 2017-07-10 000409
market code active1 price last_close open high low servertime reversed_bytes0 reversed_bytes1 vol cur_vol amount s_vol b_vol reversed_bytes2 reversed_bytes3 bid1 ask1 bid_vol1 ask_vol1 bid2 ask2 bid_vol2 ask_vol2 bid3 ask3 bid_vol3 ask_vol3 bid4 ask4 bid_vol4 ask_vol4 bid5 ask5 bid_vol5 ask_vol5 reversed_bytes4 reversed_bytes5 reversed_bytes6 reversed_bytes7 reversed_bytes8 reversed_bytes9 active2
0 0 000409 1721 8.13 8.15 8.12 8.16 8.05 14:59:58.157 14999488 -813 50176 494 40632060.0 25458 24718 1 1916 8.12 8.13 7 432 8.11 8.14 220 875 8.10 8.15 693 1281 8.09 8.16 491 361 8.08 8.17 503 629 (2582,) 0 0 0 0 0.25 1721
1 1 600963 1847 6.77 6.69 6.79 6.79 6.61 14:59:58.286 14999524 -677 117399 2417 78754760.0 50442 66957 0 11720 6.76 6.77 311 969 6.75 6.78 284 1955 6.74 6.79 757 1364 6.73 6.80 111 2551 6.72 6.81 171 572 (1750,) 0 0 0 0 0.30 1847
price vol
120 635.60 -1
49 635.09 -1
234 639.53 -1
[OrderedDict([('price', 7.77), ('vol', 154)]),
 OrderedDict([('price', 7.78), ('vol', 374)]),
 OrderedDict([('price', 7.77), ('vol', 141)])]
time price vol num buyorsell
15 14:55 8.12 1 1 0
29 15:00 8.13 494 54 2
14 14:55 8.12 3 1 0
name filename start length
13 经营分析 000409.txt 358726 41572
15 价值分析 000409.txt 415056 3353
5 机构持股 000409.txt 123934 17584
market code liutongguben province industry updated_date ipo_date zongguben guojiagu faqirenfarengu farengu bgu hgu zhigonggu zongzichan liudongzichan gudingzichan wuxingzichan gudongrenshu liudongfuzhai changqifuzhai zibengongjijin jingzichan zhuyingshouru zhuyinglirun yingshouzhangkuan yingyelirun touzishouyu jingyingxianjinliu zongxianjinliu cunhuo lirunzonghe shuihoulirun jinglirun weifenpeilirun meigujingzichan baoliu2
0 0 000409 4.233770e+08 15 24 20231027 19960627 6.642105e+08 18650000.0 1.680654e+08 5.590088e+09 0.0 0.0 599.999987 2.472525e+10 1.888938e+10 2.086324e+09 6.247770e+08 40457.0 7.123425e+09 2.822442e+09 1.228920e+10 1.425566e+10 7.028646e+09 4.110453e+09 5.319482e+09 8.844610e+08 492000.007629 -664674062.5 -1.030491e+09 3.033311e+09 8.875140e+08 7.122640e+08 374410000.0 -4.687032e+09 2.146 9.0
blockname block_type code_index code
3688 含可转债 2 339 600909
10994 汽车电子 2 85 300304
4417 稀缺资源 2 36 600331

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# !/usr/bin/python3
# coding=utf-8
# date=20231117
# name=下载更新通达信行情数据

from pytdx.hq import TdxHq_API
from pytdx.hq import TDXParams
from pytdx.crawler.history_financial_crawler import HistoryFinancialListCrawler
from pytdx.crawler.history_financial_crawler import HistoryFinancialCrawler
from pytdx.reader import HistoryFinancialReader
from pytdx.crawler.base_crawler import demo_reporthook
import pandas as pd
from datetime import date, datetime, timedelta
import os
import re
from chinese_calendar import is_workday


api = TdxHq_API(multithread=True, heartbeat=True, auto_retry=True)

def downkdata(code,startdate,enddate,file):
data = api.get_k_data(code,startdate,enddate)
if data.empty:
pass
else:
data.to_csv(file,encoding="utf-8-sig")
print(f"{code} 下载数据 {len(data)} 行")

def updatekdate(code,startdate,enddate,file):
data = api.get_k_data(code,startdate,enddate)
if data.empty:
pass
else:
data.to_csv(file,mode="a",header=0,encoding="utf-8-sig")
print(f"{code} 更新数据 {len(data)} 行")

def get_workdate(olddate):
workday = olddate + timedelta(days=1)
while not is_workday(pd.to_datetime(f"{workday:%Y-%m-%d}")):
workday += timedelta(days=1)
return workday

下载更新K线数据

  1. 行情数据存放目录:"D:\Stock_data\kdata
  2. 所有的股票代码及名称等信息文件:"D:\stock_data\allstock.csv"
  3. 读取股票代码名称文件,获取全部股票代码sr
1
2
3
fd = r"D:\Stock_data\kdata"
df_code = pd.read_csv(r"D:\stock_data\allstock.csv", dtype={"代码": str})
df_code.head()
代码 名称 细分行业 地区
0 000001 平安银行 股份制银行 深圳
1 000002 万 科A 住宅开发 深圳
2 000004 国华网安 基础软件 深圳
3 000005 ST星源 水治理 深圳
4 000006 深振业A 住宅开发 深圳
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
with api.connect('124.71.9.153', 7709):
data = pd.DataFrame()
for code in df_code.代码:
filename = f"{code}.csv"
file = os.path.join(fd,filename)
if os.path.exists(file) and os.path.getsize(file)>=100:
olddate = pd.read_csv(file, dtype={"code": str},parse_dates=['date']).iloc[-1, 0]
startdate = f"{get_workdate(olddate):%Y-%m-%d}"
enddate = f"{date.today():%Y-%m-%d}"
if startdate < enddate:
updatekdate(code=code,startdate=startdate,enddate=enddate,file=file)
elif startdate == enddate:
if datetime.now().hour < 16:
updatekdate(code=code,startdate=startdate,enddate=enddate,file=file)
else:
pass
else:
startdate = "2020-01-01"
enddate = f"{date.today():%Y-%m-%d}"
try:
downkdata(code,startdate,enddate,file)
except:
print(code,'无数据可下载!')
pass
001326 下载数据 7 行
001376 下载数据 11 行
001378 下载数据 15 行
301489 下载数据 19 行
301517 下载数据 24 行
301555 下载数据 14 行
001306 下载数据 2 行
301568 无数据可下载!
603107 下载数据 13 行
603107 下载数据 13 行
603193 下载数据 24 行
603273 下载数据 20 行
603361 无数据可下载!
688648 下载数据 5 行
688653 下载数据 1 行

转化成.py 文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# !/usr/bin/python3
# coding=utf-8
# date=20231117
# name=下载更新通达信行情数据

from pytdx.hq import TdxHq_API
from pytdx.hq import TDXParams
from pytdx.crawler.history_financial_crawler import HistoryFinancialListCrawler
from pytdx.crawler.history_financial_crawler import HistoryFinancialCrawler
from pytdx.reader import HistoryFinancialReader
from pytdx.crawler.base_crawler import demo_reporthook
import pandas as pd
from datetime import date, datetime, timedelta
import os
import re
from chinese_calendar import is_workday


api = TdxHq_API(multithread=True, heartbeat=True, auto_retry=True)

def downkdata(code,startdate,enddate,file):
data = api.get_k_data(code,startdate,enddate)
if data.empty:
pass
else:
data.to_csv(file,encoding="utf-8-sig")
print(f"{code} 更新数据 {len(data)} 行")

def updatekdate(code,startdate,enddate,file):
data = api.get_k_data(code,startdate,enddate)
if data.empty:
pass
else:
data.to_csv(file,mode="a",header=0,encoding="utf-8-sig")
print(f"{code} 更新数据 {len(data)} 行")

def get_workdate(olddate):
workday = olddate + timedelta(days=1)
while not is_workday(pd.to_datetime(f"{workday:%Y-%m-%d}")):
workday += timedelta(days=1)
return workday

with api.connect('124.71.9.153', 7709):
data = pd.DataFrame()
for code in df_code.代码:
filename = f"{code}.csv"
file = os.path.join(fd,filename)
if os.path.exists(file) and os.path.getsize(file)>=100:
olddate = pd.read_csv(file, dtype={"code": str},parse_dates=['date']).iloc[-1, 0]
startdate = f"{get_workdate(olddate):%Y-%m-%d}"
enddate = f"{date.today():%Y-%m-%d}"
if startdate < enddate:
updatekdate(code=code,startdate=startdate,enddate=enddate,file=file)
elif startdate == enddate:
if datetime.now().hour < 16:
updatekdate(code=code,startdate=startdate,enddate=enddate,file=file)
else:
pass
else:
startdate = "2020-01-01"
enddate = f"{date.today():%Y-%m-%d}"
try:
downkdata(code,startdate,enddate,file)
except:
print(code,'无数据可下载!')
pass
301568 无数据可下载!
603361 无数据可下载!

读取本地通达信软件下载的行情数据

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from pytdx.reader import TdxDailyBarReader, TdxFileNotFoundException
import re,os
reader = TdxDailyBarReader()

code = '600004'
def get_filepath(code):
"""
根据6位数字的股票代码获取完整的日k线数据路径
"""
if code.startswith('6',0,1):
code = 'sh' + code
elif code.startswith('0',0,1) or code.startswith('3',0,1):
code = 'sz' + code
fd1 = r'D:\new_tdx\vipdoc'
fd2 = f"{re.match(r'[a-z]+',code).group()}\lday\{code}.day"
return os.path.join(fd1,fd2)

df = reader.get_df(get_filepath(code))
df.tail()
open high low close amount volume
date
2023-11-13 10.84 10.89 10.72 10.80 83254888.0 77213.47
2023-11-14 10.81 10.93 10.78 10.91 104742512.0 96441.44
2023-11-15 11.01 11.04 10.87 10.91 96345712.0 88116.11
2023-11-16 10.92 10.93 10.81 10.86 70977744.0 65407.95
2023-11-17 10.86 10.95 10.83 10.91 79382128.0 72868.78

1
2
3
4
5
6
7
8
9
10
11
12
from pytdx.crawler.history_financial_crawler import HistoryFinancialCrawler,HistoryFinancialListCrawler
from pytdx.hq import TdxHq_API
from pytdx.reader import HistoryFinancialReader
from pytdx.crawler.base_crawler import demo_reporthook

import pandas as pd
from datetime import date, datetime, timedelta
import os,re,random
from chinese_calendar import is_workday

api = TdxHq_API(multithread=True, heartbeat=True, auto_retry=True)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
def updateallfns():
'''更新汇总的财务报表数据'''
# 汇总的财报文件中的最新日期
file = 'D:\\stock_data\\allfns.csv'
allfns = pd.read_csv(file,index_col='date',dtype={'code':str},parse_dates=['date'])
newdate_allfns = max(allfns.index)
# 获取已经下载的最新的文件的财报日期
fnsfold = r"D:\stock_data\fdata"
localfnsfiles = [i for i in os.listdir(fnsfold) if re.search('\.zip$',i)]
fnsfilesdates = [re.sub(r'\D','',i) for i in os.listdir(fnsfold) if re.search('\.zip$',i)]
newdate_fnsfiles = pd.to_datetime(max(fnsfilesdates))
# 判断是否需要更新allfns文件
updatefiles = [i for i in localfnsfiles if re.findall(r'\d+',i)[0] > f"{newdate_allfns:%Y%m%d}"]
if not updatefiles:
pass
else:
for filename in updatefiles:
zipfile = os.path.join(fnsfold,filename)
cols = ['report_date', 'col1', 'col4', 'col6']
single_fns = HistoryFinancialReader().get_df(zipfile).filter(cols)
single_fns.reset_index().to_csv(file,mode='a',header=0,index=False,encoding='utf-8-sig')


def total_fnsfile():
'''汇总所有的财报数据文件'''
# 列出已经下载的所有财报数据文件,2013年后的
fnsfold = r"D:\stock_data\fdata"
filenames = [i for i in os.listdir(fnsfold) if re.search(r'\.zip$',i) and (re.findall('\d+',i)[0]>'20131231')]
random.choices(filenames,k=3)
# 需要筛选的列名称
cols = ['report_date', 'col1', 'col4', 'col6']
total_fns = pd.DataFrame()
for filename in filenames:
file = os.path.join(fnsfold,filename)
# 读取历史财报数据文件
single_fns = HistoryFinancialReader().get_df(file).filter(cols)
# 合并fns_sigle
total_fns = pd.concat([total_fns,single_fns])
# 重新命名列名称
total_fns.columns = ["date", "EPS", "BPS", "ROE"]
# 输出到csv文件
total_fns.to_csv(os.path.join("D:\stock_data",'allfns.csv'),encoding='utf-8-sig')

if __name__ == '__main__':
file = 'D:\\stock_data\\allfns.csv'
if os.path.exists(file):
updateallfns()
else:
total_fnsfile()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# !/usr/bin/python3
# coding=utf-8
# 2023-11-15
# name = 下载更新通达信财务报表数据


from pytdx.hq import TdxHq_API ,TDXParams
from pytdx.crawler.history_financial_crawler import HistoryFinancialListCrawler
from pytdx.crawler.history_financial_crawler import HistoryFinancialCrawler
from pytdx.reader import HistoryFinancialReader
from pytdx.crawler.base_crawler import demo_reporthook
import pandas as pd
from datetime import date, datetime, timedelta
import os,re,sys
from chinese_calendar import is_workday

api = TdxHq_API(multithread=True, heartbeat=True, auto_retry=True)


下载财务数据

已经存在于本地的则不需要再下载

  1. 查看本地财务数据文件列表 如[‘gpcw20201231.zip’]
  2. 将文件名列表转化成日期样式的列表 [‘20201231’,’20210131’]
1
2
3
4
5
# 查看已经下载到本地的财务数据
fd = "d:\\stock_data\\fdata"
filels = [i for i in os.listdir(fd) if re.search(r"\.zip$", i)]
len(filels)

111
1
2
3
4
5
6
# 计算当前最新期的财务数据
tmpdate = pd.to_datetime(datetime.now() - timedelta(days=90))
tmpdate
tras = {1: "0331", 2: "0630", 3: "0930", 4: "1231"}
newreport = f"gpcw{tmpdate.year}{tras.get(tmpdate.quarter)}.zip"
newreport
Timestamp('2023-08-21 20:33:42.882088')


'gpcw20230930.zip'
1
2
3
4
5
6
7
8
9
# 网络查询财务数据文件df
crawler = HistoryFinancialListCrawler()
df_fns = api.to_df(crawler.fetch_and_parse())
# 筛选文件大小和文件名
sift = (df_fns.filesize>2000) & (df_fns.filename.map(lambda x: re.findall(r'\d+',x)[0])>'20000101'
)
df_fns = df_fns.query('@sift')
downfiles = [i for i in df_fns.filename if i not in filels]
downfiles
[]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
if not downfiles:
print("无财报文件需要下载!")
pass
else:
print("有新季报需要下载!")
crawler = HistoryFinancialCrawler()
for name in downfiles:
if os.path.exists(os.path.join(fd,name)):
pass
else:
crawler.fetch_and_parse(reporthook=demo_reporthook,
filename=name,
path_to_download=os.path.join(fd,name)
)
无财报文件需要下载!

生成的updatefnsdata.py文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# !/usr/bin/python3
# coding=utf-8
# 2023-11-15

from pytdx.hq import TdxHq_API ,TDXParams
from pytdx.crawler.history_financial_crawler import HistoryFinancialListCrawler
from pytdx.crawler.history_financial_crawler import HistoryFinancialCrawler
from pytdx.reader import HistoryFinancialReader
from pytdx.crawler.base_crawler import demo_reporthook
import pandas as pd
from datetime import date, datetime, timedelta
import os,re,sys
from chinese_calendar import is_workday

api = TdxHq_API(multithread=True, heartbeat=True, auto_retry=True)


def updatefnsdata():
# 查看已经下载到本地的财务数据
fd = "d:\\stock_data\\fdata"
localfilels = [i for i in os.listdir(fd) if re.search(r"\.zip$", i)]
# 网络查询财务数据文件df
crawler = HistoryFinancialListCrawler()
netdf = api.to_df(crawler.fetch_and_parse())
# 筛选文件大小和文件名
sift = (netdf.filesize>2000) & (netdf.filename.map(lambda x: re.findall(r'\d+',x)[0])>'20000101'
)
netfiles = df_fns.query('@sift').filename.tolist()

downfiles = [i for i in netfiles if i not in localfilels]
if not downfiles:
print("无财报文件需要下载!")
pass
else:
print("有新季报需要下载!")
crawler = HistoryFinancialCrawler()
for name in downfiles:
if os.path.exists(os.path.join(fd,name)):
pass
else:
crawler.fetch_and_parse(reporthook=demo_reporthook,
filename=name,
path_to_download=os.path.join(fd,name)
)

if __name__ == '__main__':
updatefnsdata()
无财报文件需要下载!

Python 调用自编程序的方法

步骤:

  1. import sys
  2. sys.path.append(path)
    • path: 存放自定义程序的文件夹路径
    • 并在路径目录下创建 __init__.py 空文件
  3. from filename import func
1
2
import sys, os
sys.path.append(r'D:\OneDrive\Code\Note\my_module')
1
2
3
# 查看路径下的 .py 文件
path = r'D:\OneDrive\Code\Note\my_module'
os.listdir(path)
['clacpe.py',
 'drawkline.py',
 'golden_fork.py',
 'mysql.py',
 'purge.py',
 'updatestock.py',
 'update_tdx_kdata.py',
 '__init__.py',
 '__pycache__']
1
2
3
4
# 调用一个求阶乘的程序
from purge import jiecheng
jiecheng()

Out: 提示输入要计算阶乘的数字

输入 5 ,回车

120