Giter Site home page Giter Site logo

otomegame's Introduction

VNDB Thigh-highs(otome)

本文参考VNDB,提供的python http api

并提供了对otome game数据提取与处理的一些代码:

getvnid.py(从api获取数据存入test.json)

getotomevn.py(将获取的json调整为更容易调取的格式)

readotome.py(读取出需要的json数据特征,转化为列表格式输出)

get_tag_vn.py(读取出各乙游的tag并进行处理)

如下为源文档readme文件: This module provides a VNDB client api implementation. It aims to provide some high level features to easily use VNDB api. It also includes some helper functions and classes to easily use database dumps.

API Quick start

from vndb_thigh_highs import VNDB
from vndb_thigh_highs.models import VN

vndb = VNDB()
vns = vndb.get_vn(VN.id == 17)
vn = vns[0]
print(vn.title)

Check the documentation for more details

Dumps Quick start

from vndb_thigh_highs.dumps import TraitDatabaseBuilder

builder = TraitDatabaseBuilder()
trait_db = builder.build_with_archive("path/to/traits.json.gz")
trait_id = 186
trait = trait_db.get_trait(trait_id)
print(trait.name)

Check the documentation for more details

Testing

Run test/main.py.

By default tests are run using predefined responses. It is possible to run them with vndb by editing use_mock_socket = True in test/test_case.py, though logged in tests require valid credentials in data/login.json. A few troublesome tests are also skipped when using vndb.

Database dumps tests will need dumps, compressed and decompressed, in data/.

License

This module is licensed under the AGPLv3.

otomegame's People

Contributors

yunpingwang27 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.