https://github.com/soontao/cbdb_api
cbdb to api
https://github.com/soontao/cbdb_api
cbdb database python sqlite3
Last synced: about 2 months ago
JSON representation
cbdb to api
- Host: GitHub
- URL: https://github.com/soontao/cbdb_api
- Owner: Soontao
- License: other
- Created: 2017-03-18T13:18:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T05:11:09.000Z (over 2 years ago)
- Last Synced: 2025-03-17T02:44:34.765Z (over 1 year ago)
- Topics: cbdb, database, python, sqlite3
- Language: Python
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cbdb_api
cbdb to api
in dev,欢迎与我交流,theo.sun@outlook.com
## install
```text
pip install -r requirements.txt
```
download and save **cbdb_sqlite.db** in root directory, you can download it from [here](http://projects.iq.harvard.edu/chinesecbdb/%E4%B8%8B%E8%BC%89cbdb%E5%96%AE%E6%A9%9F%E7%89%88)
## api
* http://server/ -- home page
* http://server/table-desc -- all table describe info
* http://server/table-desc?table_name=[tablename] -- specific table describe info
* http://server/query?sql=[sql] -- query table with sql
* http://server/tree/office-type -- give an office_type_tree json hierarchy object
Note: 可以不带括号
## sample
```text
GET https://cbdb-api.fornever.org
GET https://cbdb-api.fornever.org/table-desc
GET https://cbdb-api.fornever.org/table-desc?table_name=addresses
GET https://cbdb-api.fornever.org/query?sql=select * from addresses limit 10
GET https://cbdb-api.fornever.org/tree/office-type
```
## todo
* [x] query api
* [x] query should be limit, only can be query
* [x] server metadata
* [ ] any rdb data query server
* [ ] make api easy to use
* [ ] history address name change
* [ ] tree
* [ ] simplified chinese, introduce opencc
## Reference
* [CHINA BIOGRAPHICAL DATABASE PROJECT (CBDB)](http://projects.iq.harvard.edu/chinesecbdb)
## LICENCE
Since CBDB uses [CC BY-NC-SA 4.0 license](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh), the license is also used for this project