Skip to main content

converter from xinrui url to pbn files

Project description

xin2pbn

==> Deprecated, this module is moved into bridge-utils since 2022.05.27, all features are kept

$ pip uninstall xin2pbn
$ pip install bridge-utils

xinrui bridge online url to pbn converter

xinrui url looks like this, it can be converted to standard pbn files output.pbn

Usage

pip install xin2pbn
xin2pbn "url"
xin2pbn "local.html"

example

$ xin2pbn "http://www.xinruibridge.com/deallog/DealLog.html?bidlog=P%3BP,1S,X,2S%3BP,P,X,P%3B3C,P,4C,P%3B5C,P,P,P%3B&playlog=W:TH,KH,AH,4H%3BE:TS,KS,AS,6C%3BN:3H,2H,9H,8H%3BS:TD,KD,AD,7D%3BN:3D,9D,2C,2D%3BS:3C,4C,TC,5C%3BN:6D,5D,QC,4D%3BS:7C,KC,AC,8C%3BN:&deal=T96.A62.J975.985%20KQ832.954.T.Q732%20AJ754.T8.K842.K4%20.KQJ73.AQ63.AJT6&vul=NS&dealer=E&contract=5C&declarer=S&wintrick=12&score=620&str=%E7%BE%A4%E7%BB%84IMP%E8%B5%9B%2020201121%20%E7%89%8C%E5%8F%B7%202/8&dealid=984602529&pbnid=344008254"
write to file output.pbn

$ curl -O https://isoliu.gitlab.io/book2020/web/1-chapter2-B01-zdjs.html
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5054  100  5054    0     0  11512      0 --:--:-- --:--:-- --:--:-- 11512
$ xin2pbn 1-chapter2-B01-zdjs.html
[b'https://isoliu.gitlab.io/deallog/DealLog.html?bidlog=1D,1S,P;2D,3C,P,P;4S,P,P,X;P,P,P&playlog=E:5D,KD,2D,6D;S:3H,5H,8H,7H;N:8S,TS,AS,3D;S:4C,KC,3C,2C;W:8D,7D,2S,9D;E:8C,JC,AC,5C;W:QD,TH,5S,4D;E:6H,9H,KH,AH;N:&deal=.K5.QJT832.AK976%20KQ874.AT8.76.Q53%20JT652.7642.5.T82%20A93.QJ93.AK94.J4&vul=All&dealer=W&contract=4SX&declarer=N&wintrick=9&score=-200&str=%E9%94%A6%E6%A0%87%E8%B5%9B%20%E7%AC%AC12%E8%BD%AE%20%E7%89%8C%E5%8F%B7%204/12&dealid=653117488&pbnid=127397878', b'https://isoliu.gitlab.io/deallog/DealLog.html?bidlog=1D,1S,P;2D,3C,P,P;4S,P,P,X;P,P,P&playlog=E:5D,AD,2D,6D;S:QH,KH,AH,7H;N:KS,2S,3S,3D;N:4S,TS,AS,8D;S:3H,5H,8H,2H;N:TH,6H,JH,7C;S:9H,6C,7D,4H;S:4C,KC,3C,2C;W:AC,5C,8C,JC;W:QD,QS,TC,4D;N:&deal=.K5.QJT832.AK976%20KQ874.AT8.76.Q53%20JT652.7642.5.T82%20A93.QJ93.AK94.J4&vul=All&dealer=W&contract=4SX&declarer=N&wintrick=10&score=790&str=%E9%94%A6%E6%A0%87%E8%B5%9B%20%E7%AC%AC12%E8%BD%AE%20%E7%89%8C%E5%8F%B7%204/12&dealid=653247876&pbnid=127397878']
write to file ./1-chapter2-B01-zdjs-01.pbn
write to file ./1-chapter2-B01-zdjs-02.pbn

$ cat 1-cha*.pbn > all.pbn

snapshot

original source in xinrui UI

The outputed pbn can be viewed inside bridgecomposer & pbnjview

Development

# docker run -it  -v $PWD:/app  -w /app python:3.8  bash
# python3 -m pip install --user --upgrade twine wheel
# python3 setup.py sdist clean
# rm -rf dist
# python3 setup.py sdist bdist_wheel
# cat > ~/.pypirc
# python3 -m twine upload --skip-existing --verbose dist/*

TODO

  • Web interface
  • convert to js to be used by anyone

Reference

Project details


Download files

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

Source Distribution

xin2pbn-0.1.18.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

xin2pbn-0.1.18-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file xin2pbn-0.1.18.tar.gz.

File metadata

  • Download URL: xin2pbn-0.1.18.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.11

File hashes

Hashes for xin2pbn-0.1.18.tar.gz
Algorithm Hash digest
SHA256 ccce7dec68b78b32538cdf98f10769b87c8e8c546ff26e63d8daec22e65b5630
MD5 c6ff5066d7e415d3d17dac1167570091
BLAKE2b-256 010fb3f64c5ed74e51dc2ac6f405a091c5ae3fb7babad4272986e5a3e5a7fe73

See more details on using hashes here.

File details

Details for the file xin2pbn-0.1.18-py3-none-any.whl.

File metadata

  • Download URL: xin2pbn-0.1.18-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.11

File hashes

Hashes for xin2pbn-0.1.18-py3-none-any.whl
Algorithm Hash digest
SHA256 1cff35245f5cbbed52154bfd5f66eb699d5c45e941f11df9df00783d55496d78
MD5 c04208d9ff96ba70748cd29b47e7a1a5
BLAKE2b-256 b4501ba2973704ca04f952bdd2621dadc1deefa0882f31a183303d1e6b7b337d

See more details on using hashes here.

Supported by

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