Skip to main content

A tool for local http server!

Project description

AkTools

AkTools is a package for local HTTP server for AkShare!

It depends on AkShare and FastAPI.

pip install aktools

AkShare

[...]

FastAPI

[...]

Demo

Installation[windows]

pip install akshare
pip install fastapi[all]

Run CMD command[windows]

1. cd into the path of aktools: e.g., aktools/news/
2. then type the cmd command ```uvicorn news_api:app --reload```, just as ```C:\Anaconda3\envs\ak_test\Lib\site-packages\aktools\news>uvicorn news_api:app --reload```
3. type ```http://127.0.0.1:8000/amac_fund_abs``` in your chrome for test

Test-R

R-Program

library(RCurl)
library(jsonlite)

url <- "http://127.0.0.1:8000/stock_js_weibo_report_df"
temp_df <- getURI(url, .encoding = "utf-8")
inner_df <- fromJSON(temp_df)
df <- t(rbind(inner_df$name, inner_df$rate))
colnames(df) <- c("name", "rate")
print(df)

Result

   name       rate    
0  "北玻股份" "-10.06"
1  "乾照光电" "-10.00"
2  "紫江企业" "-10.02"
3  "铜峰电子" "10.08" 
4  "晶方科技" "-10.00"
5  "希努尔"   "4.90"  
6  "株冶集团" "0.00"  
7  "东方财富" "1.33"  
8  "秀强股份" "-9.96" 
9  "方直科技" "10.00" 
10 "三五互联" "10.04" 
11 "得润电子" "7.91"  
12 "泰达股份" "-2.19" 
13 "万达信息" "6.82"  
14 "台基股份" "-9.98" 
15 "牧原股份" "2.24"  
16 "长高集团" "9.93"  
17 "合肥城建" "10.04" 
18 "碧水源"   "9.17"  
19 "海陆重工" "-9.98" 
20 "中国软件" "-0.11" 
21 "苏大维格" "6.94"  
22 "立思辰"   "7.80"  
23 "涪陵榨菜" "4.39"  
24 "雪浪环境" "10.03" 
25 "湘电股份" "-5.74" 
26 "同花顺"   "2.15"  
27 "贵州茅台" "1.28"  
28 "万邦达"   "7.01"  
29 "东华科技" "9.99"  
30 "福建水泥" "6.62"  
31 "科斯伍德" "10.00" 
32 "国电南自" "10.08" 
33 "江淮汽车" "2.21"  
34 "欧菲光"   "-4.25" 
35 "太极实业" "-9.76" 
36 "华天科技" "-5.40" 
37 "宏润建设" "10.13" 
38 "新开普"   "9.71"  
39 "上峰水泥" "5.01"  
40 "中信证券" "0.24"  
41 "荣科科技" "10.07" 
42 "哈投股份" "0.91"  
43 "中国平安" "-0.05" 
44 "山东路桥" "10.00" 
45 "宜通世纪" "-9.13" 
46 "东易日盛" "9.95"  
47 "汉钟精机" "9.96"  
48 "三一重工" "4.73"  
49 "华塑控股" "10.19"

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

aktools-0.0.14.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aktools-0.0.14-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file aktools-0.0.14.tar.gz.

File metadata

  • Download URL: aktools-0.0.14.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for aktools-0.0.14.tar.gz
Algorithm Hash digest
SHA256 1ca5ebd210b2efefd88f60a3b5b78982c6a89162fc7418a50bd7e4c96a8ed12d
MD5 78034081092a2913665eb810541d7ffc
BLAKE2b-256 c10579ffcb0299b2b1c9e41e3f7f87db4c778161b56f5050e5f3f79ef9b988df

See more details on using hashes here.

File details

Details for the file aktools-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: aktools-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for aktools-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 0c2feffb80d0c59bac3d2525c8617a119816e44b34d1572ea3bdb684fc7d5b54
MD5 f4932b749e867a439b994801cb921a21
BLAKE2b-256 c25ba607510b7d17b827f4f98adbc9243b301e1ad4d82c2d5dc065c8621550fc

See more details on using hashes here.

Supported by

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